kumquat-buildroot/package/openrc/sysv-rcs
Michał Łyszczek 162044407b package/skeleton-init-openrc: add support for starting sysv scripts
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>
2019-09-23 22:29:28 +02:00

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
}