162044407b
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>
26 lines
480 B
Plaintext
Executable File
26 lines
480 B
Plaintext
Executable File
#!/sbin/openrc-run
|
|
|
|
description="start or stop sysv rc[S,K] scripts"
|
|
|
|
depend() {
|
|
after local
|
|
}
|
|
|
|
start() {
|
|
einfo "Starting sysv rc scripts"
|
|
for i in /etc/init.d/S??*; do
|
|
# Ignore dangling symlinks (if any).
|
|
[ -e "$i" ] || continue
|
|
$i start
|
|
done
|
|
}
|
|
|
|
stop() {
|
|
einfo "Stopping sysv rc scripts"
|
|
for i in $(ls -r /etc/init.d/S??*); do
|
|
# Ignore dangling symlinks (if any).
|
|
[ -e "$i" ] || continue
|
|
$i stop
|
|
done
|
|
}
|