This file is indexed.

postinst is in runit 2.1.2-3ubuntu1.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh
set -e

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

# workaround #766187
# copy from sysvinit-2.88dsf/debian/sysvinit-core.postinst and adjust
if [ ! -f /etc/inittab ]
then
        cp -p /usr/share/runit/inittab /etc/inittab
fi
# end copy from sysvinit-2.88dsf

if test -z "$2"; then
  # not upgrading
  if [ -f /etc/inittab ] && grep '^SV:' /etc/inittab >/dev/null; then
    if ! grep '^#-- runit begin' /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
fi

if [ -f /etc/inittab ] && ! grep '^SV:' /etc/inittab >/dev/null; then
  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
fi

test ! -d /proc/1 || kill -s HUP 1

# systemd service
test -h /etc/systemd/system/multi-user.target.wants/runit.service ||
  test ! -d /etc/systemd/system/multi-user.target.wants ||
    ln -s /lib/systemd/system/runit.service \
      /etc/systemd/system/multi-user.target.wants/
test ! -d /run/systemd/system || systemctl start runit.service

# remove lingering debconf-managed configuration
# from versions 2.1.0-1 through 2.1.1-6.1.
if test -r /usr/share/debconf/confmodule; then
  . /usr/share/debconf/confmodule
  db_purge
fi

if [ -x /sbin/start ]; then #provided by upstart
  /sbin/start runsvdir
fi