Imported Debian patch 2.5.0-2
[debian/amanda] / debian / postinst
index 046f020502e54a5ae03a6793ad8f74ba528d7155..0c1f8076668be3453f00a88e1bfd7feb721ddc01 100644 (file)
@@ -6,6 +6,10 @@ if [ "$1" = configure ]; then
        useradd -d /var/backups -c backup -s /bin/sh \
                -u 34 -g 34 backup 2> /dev/null 
 
+       if [ ! -f /var/backups/.profile ]; then
+               echo 'PATH="$PATH:/usr/sbin"' > /var/backups/.profile
+       fi
+
        groupadd -g 34 backup 2> /dev/null
        groupadd -g 26 tape 2> /dev/null
 
@@ -39,8 +43,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#