File: runit-run.postinst

package info (click to toggle)
runit-run 0.5.0
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 112 kB
  • ctags: 3
  • sloc: sh: 134; makefile: 49
file content (22 lines) | stat: -rw-r--r-- 633 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
#!/bin/sh
set -e

test "$1" = 'configure' || exit 0
test -z "$2" || exit 0

add_alternative() {
  update-alternatives --install \
      /usr/sbin/policy-rc.d policy-rc.d /usr/sbin/runit-policy-rc.d 10 \
    --slave \
      /usr/share/man/man8/policy-rc.d.8.gz policy-rc.d.8.gz \
        /usr/share/man/man8/runit-policy-rc.d.8.gz
}

if test -d /var/service && ! test -h /var/service; then
  test "`echo /var/service/*`" = '/var/service/*' || \
    cp -a /var/service/* /etc/runit/runsvdir/default/
  rm -rf /var/service'{old}'
  mv /var/service /var/service'{old}'
  ln -s /etc/runit/runsvdir/current /var/service
fi
add_alternative