forked from void-linux/void-runit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
2
executable file
·40 lines (33 loc) · 1.39 KB
/
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
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
# vim: set ts=4 sw=4 et:
PATH=/usr/bin:/usr/sbin
readproctitle='log: ...........................................................................................................................................................................................................................................................................................................................................................................................................'
for arg in $(cat /proc/cmdline); do
case $arg in
'void.runit_readproctitle='* )
doreadproctitle="$(echo "${arg}" | cut -d'=' -f2)"
if [ "0" = "${doreadproctitle}" ]; then
echo 'runit readproctitle disabled: '"${arg}"' (via kernel cmdline)'
readproctitle=
fi
;;
esac
done
runlevel=default
for arg in $(cat /proc/cmdline); do
if [ -d /etc/runit/runsvdir/"${arg}" ]; then
echo 'runit runlevel detected: '"${arg}"' (via kernel cmdline)'
runlevel="${arg}"
fi
done
[ -x /etc/rc.local ] && /etc/rc.local
runsvchdir "${runlevel}"
mkdir -p /run/runit/runsvdir
ln -s /etc/runit/runsvdir/current /run/runit/runsvdir/current
if [ -z "${readproctitle}" ]; then
exec env - PATH="${PATH}" \
runsvdir -P /run/runit/runsvdir/current
else
exec env - PATH="${PATH}" \
runsvdir -P /run/runit/runsvdir/current "${readproctitle}"
fi