Package: samba
Severity: normal

Purging the samba package deletes the directories /var/cache/samba,
/var/log/samba, and /var/run/samba, even though winbind might still
be running and have files in there.

The attached patch shows what I found necessary to have each package
only delete exactly those files that it creates.  But I fear that this
will be a maintenance issue if new file names pop up every now and
then.  Other ideas on how to fix this?
Index: debian/samba.postrm
===================================================================
--- debian/samba.postrm (Revision 1076)
+++ debian/samba.postrm (Arbeitskopie)
@@ -1,15 +1,11 @@
 #!/bin/sh -e
-#
-#
 
 if [ "$1" = purge ]; then
+       rm -rf /var/cache/samba/browse.dat
+       rm -rf /var/lib/samba/
+       rm -rf /var/log/samba/log.nmbd* /var/log/samba/log.smbd* 
/var/log/samba/cores/
+       rm -rf /var/run/samba/nmbd.pid /var/run/samba/smbd.pid 
/var/run/samba/*.tdb
 
-       # Remove Samba's state files, both volatile and non-volatile
-       rm -Rf /var/run/samba/ /var/cache/samba/ /var/lib/samba
-
-       # Remove log files
-       rm -Rf /var/log/samba/
-
        # Remove init.d configuration file
        echo  Removing configuration file /etc/default/samba...  >&2
        rm -f /etc/default/samba
Index: debian/winbind.dirs
===================================================================
--- debian/winbind.dirs (Revision 1076)
+++ debian/winbind.dirs (Arbeitskopie)
@@ -1,2 +1,3 @@
+var/cache/samba
 var/log/samba
 var/run/samba
Index: debian/winbind.postrm
===================================================================
--- debian/winbind.postrm       (Revision 0)
+++ debian/winbind.postrm       (Revision 0)
@@ -0,0 +1,9 @@
+#!/bin/sh -e
+
+if [ "$1" = purge ]; then
+       rm -rf /var/cache/samba/netsamlogon_cache.tdb 
/var/cache/samba/winbindd_cache.tdb
+       rm -rf /var/log/samba/log.winbind* /var/log/samba/log.wb*
+       rm -rf /var/run/samba/winbindd.pid /var/run/samba/winbindd_privileged/
+fi
+
+#DEBHELPER#

Reply via email to