debian packagin updates from Eloy
[Samba.git] / packaging / Debian / debian / samba.prerm
blobec30ff6687bf42d3e182b561bd9be5458df0df1a
1 #!/bin/sh -e
3 # Clean up any such stale file.
4 rm -f /tmp/samba-was-not-running
6 # The smbd pid file is missing, or points to a dead process
7 if [ ! -f /var/run/samba/smbd.pid ] || \
8 ! ps h `cat /var/run/samba/smbd.pid` > /dev/null
9 then
10 # The nmbd pid file is missing, or points to a dead process
11 if [ -f /var/run/samba/nmbd.pid ] || \
12 ! ps h `cat /var/run/samba/nmbd.pid` > /dev/null
13 then
14 # let the postinst know not to start samba.
15 [ "$1" = "upgrade" ] && touch /tmp/samba-was-not-running
19 # We read /etc/default/samba to know if we're running from inetd or as
20 # daemons so we don't call the init script if we are running from inetd.
21 [ -r /etc/default/samba ] && . /etc/default/samba
23 # We call the init script to stop Samba only if we are running as daemons.
24 [ -x /etc/init.d/samba -a "$RUN_MODE" != "inetd" ] && /etc/init.d/samba stop
26 #DEBHELPER#