File: runit.postrm

package info (click to toggle)
runit 2.1.1-6.2
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 1,412 kB
  • ctags: 987
  • sloc: ansic: 5,685; sh: 709; makefile: 435
file content (26 lines) | stat: -rw-r--r-- 691 bytes parent folder | download
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
#!/bin/sh
set -e

test "$1" = 'remove' || test "$1" = 'purge' || exit 0

if grep '#-- runit begin' /etc/inittab >/dev/null; then
  echo 'Removing SV inittab entry...'
  rm -f /etc/inittab'{new}'
  sed -e '/#-- runit begin/,/#-- runit end/d' \
    </etc/inittab >/etc/inittab'{new}'
  mv -f /etc/inittab'{new}' /etc/inittab
  if ps -p 1 >/dev/null; then
    kill -s HUP 1
  fi
fi

test "$1" = 'purge' || exit 0

rm -rf /etc/sv/getty-5/supervise /var/run/sv.getty-5
test ! -h /var/service || rm -f /var/service

# remove lingering debconf-managed configuration
# from versions 2.1.0-1 through 2.1.1-6.1.
test -r /usr/share/debconf/confmodule || exit 0
. /usr/share/debconf/confmodule
db_purge