Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

OpenRC init script dependency

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
4 posts • Page 1 of 1
Author
Message
CyberMuz
n00b
n00b
Posts: 54
Joined: Tue Jan 03, 2012 1:57 pm

OpenRC init script dependency

  • Quote

Post by CyberMuz » Sat Mar 25, 2017 4:09 pm

Can someone explain to me the 'keyword' dependency inside init scripts? For example in /etc/init.d/hostname there is

Code: Select all

depend() {
        keyword -docker -lxc -prefix -systemd-nspawn
}
Where do this keywords come from? I have a problem that hostname script is not executed when I run gentoo as lxc guest, instead the hostname of the lxc host is used. If I remove "-lxc" from hostname script then everything works fine.
Top
Naib
Watchman
Watchman
User avatar
Posts: 6101
Joined: Fri May 21, 2004 9:42 pm
Location: Removed by Neddy
Contact:
Contact Naib
Website

  • Quote

Post by Naib » Sat Mar 25, 2017 4:18 pm

man openrc-run

Code: Select all

keyword          Tags a service with a keyword. These are the keywords we
                      currently understand:

                      -shutdown
                              Don't stop this service when shutting the system
                              down.  This is normally quite safe as remaining
                              daemons will be sent a SIGTERM just before final
                              shutdown.  Network related services such as the
                              network and dhcpcd init scripts normally have
                              this keyword.

                      -stop   Don't stop this service when changing runlevels,
                              even if not present.  This includes shutting the
                              system down.

                      -timeout
                              Other services should wait indefinitely for this
                              service to start. Use this keyword if your ser-
                              vice may take longer than 60 seconds to start.

                      -jail   When in a jail, exclude this service from any
                              dependencies. The service can still be run
                              directly. Set via rc sys in /etc/rc.conf
                                                  -       ------------

                      -lxc    Same as -jail, but for Linux Resource Containers
                              (LXC).

                      -openvz
                              Same as -jail, but for OpenVZ systems.

                      -prefix
                              Same as -jail, but for Prefix systems.

                      -rkt    Same as -jail, but for RKT systems.

                      -uml    Same as -jail, but for UML systems.

                      -vserver
                              Same as -jail, but for VServer systems.

                      -xen0   Same as -jail, but for Xen DOM0 systems.

                      -xenu   Same as -jail, but for Xen DOMU systems.

                      -docker
                              Same as -jail, but for docker systems.

                      -containers
                              Same as -jail, but for all relevant container
                              types on the operating system.
#define HelloWorld int
#define Int main()
#define Return printf
#define Print return
#include <stdio>
HelloWorld Int {
Return("Hello, world!\n");
Print 0;
Top
CyberMuz
n00b
n00b
Posts: 54
Joined: Tue Jan 03, 2012 1:57 pm

  • Quote

Post by CyberMuz » Sat Mar 25, 2017 4:43 pm

Tnx. I still don't understand why hostname script is not executed on boot inside lxc if "-lxc" flag is set. I have explicitly set it in 'default' runlevel but it doesn't start. It's not even listed in rc-status output. I expected that will get started since it's started directly and not as a dependency.
I can start it manually (/etc/init.d/hostname start) and it correctly sets the hostname. Without -lxc flag it starts on boot and is listed in rc-status output.
Top
face
n00b
n00b
Posts: 12
Joined: Sat Mar 20, 2004 1:34 am

  • Quote

Post by face » Sat Aug 10, 2019 7:12 am

CyberMuz wrote:Tnx. I still don't understand why hostname script is not executed on boot inside lxc if "-lxc" flag is set. I have explicitly set it in 'default' runlevel but it doesn't start. It's not even listed in rc-status output. I expected that will get started since it's started directly and not as a dependency.
I can start it manually (/etc/init.d/hostname start) and it correctly sets the hostname. Without -lxc flag it starts on boot and is listed in rc-status output.
I also face this issue. I don't understand the reason why the hostname init script is excluded on lxc guests. ¯\_(ツ)_/¯

Solved: https://github.com/OpenRC/openrc/commit ... d3e0176d66

The hostname (even fqdn) can be set via lxc config directive 'lxc.uts.name'.
Top
Post Reply

4 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic