See if this works…
First check samba ISN’T running:
ps ax | grep smbd
If it ISN’T running, you should get something similar to -
1034 pts/0 S+ 0:00 grep --colour=auto smbd
If it IS running, you should get something similar to -
1053 ? Ss 0:00 /usr/sbin/smbd -D
1055 ? S 0:00 /usr/sbin/smbd -D
1057 pts/0 S+ 0:00 grep --colour=auto smbd
If it ISN’T running (at bootup), open /etc/network/if-up.d/samba for editing:
sudo leafpad /etc/network/if-up.d/samba
What opens, should look like this:
#!/bin/sh
Try to bring nmbd up when an interface comes up, if smbd is already running.
Don’t bother to do anything for lo.
if [ “$IFACE” = lo ]; then
exit 0
fi
Only run from ifup.
if [ “$MODE” != start ]; then
exit 0
fi
Samba only cares about inet and inet6. Get thee gone, strange people
still using ipx.
case $ADDRFAM in
inet|inet6|NetworkManager)
;;
*)
exit 0
;;
esac
status=$(/etc/init.d/samba status)
Really only necessary to do anything if nmbd is not already running
if echo “$status” | grep -q ‘smbd is running’
&& ! echo “$status” | grep -q ‘nmbd is running’
then
/etc/init.d/samba start
fi
exit 0
Add a line, just above the exit 0 line, that reads
service samba restart
So it now reads -
#!/bin/sh
Try to bring nmbd up when an interface comes up, if smbd is already running.
Don’t bother to do anything for lo.
if [ “$IFACE” = lo ]; then
exit 0
fi
Only run from ifup.
if [ “$MODE” != start ]; then
exit 0
fi
Samba only cares about inet and inet6. Get thee gone, strange people
still using ipx.
case $ADDRFAM in
inet|inet6|NetworkManager)
;;
*)
exit 0
;;
esac
status=$(/etc/init.d/samba status)
Really only necessary to do anything if nmbd is not already running
if echo “$status” | grep -q ‘smbd is running’
&& ! echo “$status” | grep -q ‘nmbd is running’
then
/etc/init.d/samba start
fi
service samba restart
exit 0
SAVE the file, and reboot… now test again with
ps ax | grep smbd