Currently, the sysv-rcs script has two issues:
- The return code of each RCS script is not checked.
- The output does not match the formatting of the other openrc
init scripts.
Modify the script in the following ways to fix both issues:
- Remove the "einfo "Starting sysv rc scripts"" at the top of the
start function in favor of "einfo "Starting $i" in the loop
itself.
- Add a "> /dev/null" to the end of $i start; this suppresses
stdout while still allowing for stderr messages to print to the
terminal.
- add an "eend $? to both the start and stop functions, this
allows for openrc to show if an RCS script returned 0 or
not.
The following is the startup output of OpenRC on a minimal system
with S01syslogd modified to exit with a return code 1 for testing
purposes:
Before:
* Adding static routes ...
[ ok ]
Starting default runlevel
* Starting sysv rc scripts
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
After:
* Adding static routes ...
[ ok ]
Starting default runlevel
* Starting /etc/init.d/S01syslogd ...
[ !! ]
* Starting /etc/init.d/S02klogd ...
[ ok ]
* Starting /etc/init.d/S02sysctl ...
[ ok ]
Signed-off-by: Adam Duskett <aduskett@greenlots.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/openrc has the file sysv-rcs which starts sysvinit services
not written for openrc. However, currently it is not installed to
the target.
Install this file to $(TARGET_DIR)/etc/init.d during the
target_install step.
Signed-off-by: Adam Duskett <aduskett@greenlots.com>
[yann.morin.1998@free.fr: use full-path for destination, not just dir]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
netifrc entirely replaces openrc's basic network management. As such, it
conflicts with the network services installed by openrc, so we remove
them from openrc when netifrc is enabled.
Currently, we only catter tfor the loopback interface, but we prepare
for also handling the DHCP interface, to come in a latter patch.
Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
[yann.morin.1998@free.fr:
- remove openrc files within the openrc package itself
- as it's a generic-package, no need to use post-install hooks
- use description from the homepage in the help text
- check-package fixes
- rename package
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
[Thomas:
- pass UDEVDIR to install udev rules at the correct location]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
We install a template getty service, and we 'instantiate' it in the
default runlevel, using the configured tty.
Ideally, packages that provide a getty program would be responsible
for installing the corresponding service file. However, to keep
consistency with the existing init systems (busybox, systemd, and
sysv), so we do provide it from the openrc package itself.
OpenRC only acts on the files in a runlevel sub-directory, but the
documentation [0] actually suggests that the instance symlink be done
in init.d, and then again symlinked into the actual runlevel
sub-directory. So, we abide by the rules.
Also, to be noted, the getty service file is installed without ensuring
that a getty command is available. This again is not unlike other init
systems, sysvinit and busybox, which behave the same.
[0] https://wiki.gentoo.org/wiki/OpenRC
Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
[yann.morin.1998@free.fr:
- move getty template to openrc package (Thomas)
- fix namespace of the vaiables (Thomas)
- simplify creation of the defaults file
- rewrite commit log
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Add an OpenRC service that starts and stops sysv-init scripts. We order
that script 'after local' so that it is started after all other native
openrc services.
Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
[yann.morin.1998@free.fr:
- don't propagate the micro optimisation for running .sh scripts
- use spaces, not TABs
- stop services in reverse order
- reword commit log
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
On gentoo /run/lock is owned by uucp group because of historical
reasons. However uucp does not exist on buildroot by default, and
it makes more sense that 'daemon' group should own this directory.
Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Busybox version of sysctl does not support --system argument, and
files need to be loaded one by one. This patch adds code to sysctl
service in openrc to recognize busybox sysctl and execute proper
function based on that.
Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This is very basic settings for openrc init.
* system/Config.in
Allows to select openrc as init system (which auto selects
openrc-skeleton and openrc package).
* package/ifupdown-scripts/Config.in
openrc has its own service to bring up/down interfaces, so
ifupdown-scripts should not be enabled when openrc is enabled to
prevent service clash.
Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
[Thomas: take into account the !BR2_STATIC_LIBS dependency]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This adds openrc init system package. This performs default openrc
installation with openrc-init that acts as pid1.
MKPKGCONFIG=no:
openrc does not use pkg-config per se, if MKPKGCONFIG is enabled,
it will just install *.pc files on rootfs for other programs to
find librc and libeinfo. These libs expose C api to control openrc
(al rc-* functions use it). From the looks of it, these libs would
be usefull if user wanted to write his own programs to manage
services, and vast majority of people using openrc won't need it.
Also, that's the reason why there is not INSTALL_STAGING=yes.
Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>