many more lintian-related warnings addressed
[debian/amanda] / debian / postinst
index 41a946783204feadac29eb6000830f49455e4e8e..be6a549195592ebc5819a34f3ef788f07b15c8cd 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/sh -e
 
 . /usr/share/debconf/confmodule
 
@@ -13,7 +13,8 @@ if [ "$1" = configure ]; then
        groupadd -g 34 backup 2> /dev/null
        groupadd -g 26 tape 2> /dev/null
 
-       usermod -G disk,tape backup
+       adduser backup disk
+       adduser backup tape
 
        # in case we get installed first
        if [ ! -d /var/lib/amanda ]; then
@@ -43,8 +44,16 @@ if [ "$1" = configure ]; then
        if [ ! -L ~backup/.amandahosts ]; then
                ln -sf /etc/amandahosts ~backup/.amandahosts
        fi
-       chown backup:backup ~backup/.amandahosts /etc/amandahosts
-       chmod 660 ~backup/.amandahosts /etc/amandahosts
+
+       # make sure /var/log/amanda exists
+       if [ ! -d /var/log/amanda ]; then
+               mkdir -p /var/log/amanda
+       fi
+
+       chown backup:backup ~backup/.amandahosts /etc/amandahosts \
+               /var/log/amanda
+       chmod 600 ~backup/.amandahosts /etc/amandahosts
+       chmod 770 /var/log/amanda
 fi
 
 #DEBHELPER#