X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/tripe/blobdiff_plain/ef4a1ab72d88f8790c367b513863d4f9a101a34d..03e37cbca5023308bbe7da3f4e4e8a66890e51aa:/debian/tripe.postinst diff --git a/debian/tripe.postinst b/debian/tripe.postinst index 311664a8..0ec93bc6 100644 --- a/debian/tripe.postinst +++ b/debian/tripe.postinst @@ -2,13 +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 -#DEBHELPER# +## 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 -if [ -x "/etc/init.d/tripe" ]; then - update-rc.d tripe defaults >/dev/null - invoke-rc.d tripe start +## 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#