File: run_sysv_scripts

package info (click to toggle)
runit 2.2.0-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,568 kB
  • sloc: ansic: 6,071; sh: 3,419; makefile: 399
file content (28 lines) | stat: -rwxr-xr-x 712 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh -u
# Deliberately NO `set -e'. See #923957.
initdir="${1}"
set +u
if [ x = x$2 ]; then
	rcommand=start
	rX=S
else
	rcommand=stop
	rX=K
fi
set -u
for script in "$initdir/$rX"* ; do
	[ ! -x "$script" ] && continue
	path=$(realpath "$script")
	name=${path##*/}
	[ -f /etc/runit/override-sysv.d/"$name".block ] && continue
	[ -f /etc/runit/override-sysv.d/"$name".pkgblock ] && continue
	if [ -f /etc/runit/override-sysv.d/"$name".sysv ]; then
		"$script" "$rcommand"
		continue
	fi
	[ -L "/etc/service/$name" ] && continue
# undo fix for #1022837 but provide alternative, see #1071395
	[ -d "/etc/sv/$name" ] && continue
	[ -d "/usr/share/runit/sv.current/$name" ] && continue
	"$script" "$rcommand"
done