This file is indexed.

postinst is in socklog-run 2.1.0-8.1.

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

# create log directories that don't exist
TEMP=`mktemp -d`
trap '! test -e "$TEMP" || rm -rf "$TEMP"' EXIT

if ! test -d /var/log/socklog; then
  socklog-conf unix nobody log "$TEMP" && \
  chown -R log:adm /var/log/socklog && \
  chmod 2750 /var/log/socklog /var/log/socklog/* || exit 1
fi
for i in klog inet ucspi-tcp; do
  if ! test -d /var/log/socklog-$i; then
    socklog-conf $i nobody log "$TEMP" && \
    chown -R log:adm /var/log/socklog-$i && \
    chmod 2750 /var/log/socklog-$i /var/log/socklog-$i/* || exit 1
  fi
done

mv_conffile() {
  test -e "$1" || return 0
  echo "Preserving user changes to $2..."
  mv -f "$2" "$2".dpkg-new
  mv -f "$1" "$2"
}

test -z "$2" || dpkg --compare-versions "$2" gt '2.1.0-0' || {
  for i in unix/log/run unix/check unix/run klog/log/run klog/run \
   inet/log/run inet/run ucspi-tcp/log/run ucspi-tcp/run notify/run; do
    mv_conffile /etc/socklog/$i /etc/sv/socklog-$i
  done
  for i in unix klog inet ucspi-tcp notify; do
    test -h /var/service/socklog-$i || continue
    test "`readlink /var/service/socklog-$i`" = "/etc/socklog/$i" || continue
    rm -f /var/service/socklog-$i &&
      ln -s /etc/sv/socklog-$i /var/service/ || exit 1
  done
}

test -z "$2" || dpkg --compare-versions "$2" gt '2.1.0-7' || {
  for i in unix klog; do
    update-service --remove /etc/sv/socklog-$i || :
  done
  for i in inet ucspi-tcp; do
    update-service --check socklog-$i || continue
    ln -s /var/run/sv.socklog-$i /etc/sv/socklog-$i/supervise
    ln -s /var/run/sv.socklog-$i.log /etc/sv/socklog-$i/log/supervise
  done
  ! update-service --check socklog-notify ||
    ln -s /var/run/sv.socklog-notify /etc/sv/socklog-notify/supervise
  sleep 6
}

# enable system- and kernel-log-service
for i in unix klog; do
  update-service --add /etc/sv/socklog-$i
done