postinst is in inn 1:1.7.2q-44.1ubuntu2.
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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | #!/bin/sh -e
make_directories() {
  NEED_DIR='in.coming in.coming/bad in.coming/tmp
	out.going over.view news.archive'
  for D in $NEED_DIR; do
    if [ ! -d /var/spool/news/$D ]; then
      install -d -m 775 -o news -g news /var/spool/news/$D
    fi
  done
}
init_var_lib_news() {
  if [ ! -f /var/lib/news/active ]; then
    cat > /var/lib/news/active << END
control 0000000000 0000000001 n
control.cancel 0000000000 0000000001 n
junk 0000000000 0000000001 y
misc.test 0000000000 0000000001 y
misc.test.moderated 0000000000 0000000001 m
END
    chown news:news /var/lib/news/active
  fi
  if [ ! -f /var/lib/news/history ]; then
    touch /var/lib/news/history
    /usr/lib/news/bin/makehistory -or
    chown news:news /var/lib/news/history*
  fi
  if [ ! -f /var/lib/news/newsgroups ]; then
    cat > /var/lib/news/newsgroups << END
control		News server internal group.
control.cancel	News server internal group.
junk		News server internal group.
misc.test	For testing of network software.  Very boring.
misc.test.moderated	Testing of posting to moderated groups. (Moderated)
END
    chown news:news /var/lib/news/newsgroups
  fi
}
add_mail_alias() {
  if ! grep -q '^usenet:' /etc/aliases; then
    echo 'usenet: root' >> /etc/aliases
    newaliases || echo "newaliases command not available."
  fi
}
init_etc_files() {
  if [ ! -f /etc/news/server ]; then
    echo 'localhost' > /etc/news/server
  fi
  if [ ! -f /etc/news/whoami ]; then
    if [ -f /etc/mailname ]; then
      cp /etc/mailname /etc/news/whoami
    else
      hostname --fqdn > /etc/news/whoami
    fi
  fi
}
case "$1" in
    configure)
    make_directories
    init_var_lib_news
    add_mail_alias
    init_etc_files
    ;;
    abort-upgrade|abort-remove|abort-deconfigure)
    ;;
    *)
    echo "postinst called with unknown argument '$1'" >&2
    exit 1
    ;;
esac
# Automatically added by dh_systemd_enable
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask inn.service >/dev/null || true
# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled inn.service; then
	# Enables the unit on first installation, creates new
	# symlinks on upgrades if the unit file has changed.
	deb-systemd-helper enable inn.service >/dev/null || true
else
	# Update the statefile to add new symlinks (if any), which need to be
	# cleaned up on purge. Also remove old symlinks.
	deb-systemd-helper update-state inn.service >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_systemd_enable
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask inn.socket >/dev/null || true
# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled inn.socket; then
	# Enables the unit on first installation, creates new
	# symlinks on upgrades if the unit file has changed.
	deb-systemd-helper enable inn.socket >/dev/null || true
else
	# Update the statefile to add new symlinks (if any), which need to be
	# cleaned up on purge. Also remove old symlinks.
	deb-systemd-helper update-state inn.socket >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_installinit
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
	# In case this system is running systemd, we need to ensure that all
	# necessary tmpfiles (if any) are created before starting.
	if [ -d /run/systemd/system ] ; then
		systemd-tmpfiles --create /usr/lib/tmpfiles.d/inn.conf >/dev/null || true
	fi
fi
# End automatically added section
# Automatically added by dh_installinit
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
	if [ -x "/etc/init.d/inn" ]; then
		update-rc.d inn defaults >/dev/null
	fi
	if [ -x "/etc/init.d/inn" ] || [ -e "/etc/init/inn.conf" ]; then
		if [ -n "$2" ]; then
			_dh_action=restart
		else
			_dh_action=start
		fi
		invoke-rc.d inn $_dh_action || exit $?
	fi
fi
# End automatically added section
 |