blob: e2e91981aec966b14179b76d59f504bf71a54298 (
plain) (
blame)
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
41
42
43
44
|
#!/bin/sh
set -e
test "$1" = 'configure' || exit 0
mv_conffile() {
test -e "$1" || return 0
echo "Preserving user changes to $2..."
mv -f "$2" "$2".dpkg-new
mv -f "$1" "$2"
}
if dpkg --compare-versions "$2" lt '1.4.0-0'; then
mv_conffile /etc/runit/getty-5/run /etc/sv/getty-5/run
mv_conffile /etc/runit/getty-5/finish /etc/sv/getty-5/finish
rmdir /etc/runit/getty-5 2>/dev/null || :
fi
if test -z "$2"; then
# not upgrading
if grep '^SV:' /etc/inittab >/dev/null; then
cat <<\EOT >&2
There already is an SV entry in /etc/inittab. In order to have this package
add an entry with the name SV to have runit's service supervision started
by sysvinit, you need to remove or rename the current SV entry first.
Installation failed.
EOT
exit 1
fi
fi
if ! grep '^SV:' /etc/inittab >/dev/null; then
echo 'Adding SV inittab entry...'
cp /etc/inittab /etc/inittab'{new}'
cat >>/etc/inittab'{new}' <<-\EOT
#-- runit begin
SV:123456:respawn:/usr/sbin/runsvdir-start
#-- runit end
EOT
mv -f /etc/inittab'{new}' /etc/inittab
kill -s HUP 1
fi
|