chiark / gitweb /
debian/: Redo the multiarch support for Debhelper 9.
[tripe] / debian / tripe.postinst
index 468f19691699dc52b6a84f305afbdf4d3cb90337..0ec93bc66e52618f8993bf68a1754cfb51d2e953 100644 (file)
@@ -2,8 +2,34 @@
 
 set -e
 
-if [ ! -c /dev/.devfsd ] && [ ! -c /dev/net/tun ]; then
+## Make sure that /dev/net/tun exists.  Don't do anything special if devfs or
+## udev is running.
+if [ ! -c /dev/.devfsd ] &&
+   [ ! -d /dev/.udev ] &&
+   [ ! -c /dev/net/tun ]
+then
+  echo "/dev/net/tun not present: invoking MAKEDEV to create it."
   (cd /dev && /sbin/MAKEDEV tun)
 fi
 
+## Make sure that the `tripe' user and group exist.
+getent group tripe >/dev/null ||
+       addgroup --system tripe
+getent passwd tripe >/dev/null || \
+       adduser --system \
+               --ingroup tripe \
+               --home /etc/tripe \
+               --gecos "TrIPE server" \
+               tripe
+
+## Create the log directory and an initial logfile.
+if [ ! -d /var/log/tripe ]; then
+  mkdir -m2750 /var/log/tripe
+  chown tripe:adm /var/log/tripe
+fi
+if [ ! -f /var/log/tripe/tripe.log ]; then
+  (umask 027; touch /var/log/tripe/tripe.log)
+  chown tripe:adm /var/log/tripe/tripe.log
+fi
+
 #DEBHELPER#