Samba fails to start at boot when not connected to network (and specific interfaces are configured)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
samba (Ubuntu) |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
Binary package hint: samba
When my laptop boots network is not yet configured since NM didn´t start it yet. Samba however tries to start since it is in S20 on rc2-5.d but it fails immediately because no network is configured yet. Running - sudo /etc/init.d/samba restart - is fine.
In the log file I can find the following pair of errors:
[2009/04/18 11:22:48, 0] lib/interface.
WARNING: no network interfaces found
[2009/04/18 11:22:49, 0] smbd/server.
open_
Trying to resolve the problem, I wrote an updown script in /etc/NetworkMan
$ ls -l /etc/NetworkMan
total 12K
-rwxr-xr-x 1 root root 1.3K 2008-10-21 05:17 01ifupdown
-rwxr-xr-x 1 root root 1.9K 2009-05-08 11:35 02samba
If this solution makes sense I would recommend that it would be added to Ubuntu samba server package.
Here is the script I wrote:
#!/bin/sh -e
# Script to dispatch NetworkManager events
#
# Runs ifupdown scripts when NetworkManager fiddles with interfaces.
if [ -z "$1" ]; then
echo "$0: called with no interface" 1>&2
exit 1;
fi
# Fake ifupdown environment
export IFACE="$1"
export LOGICAL="$1"
export ADDRFAM=
export METHOD=
export VERBOSITY="0"
notRunningCont=
# Run the right scripts
case "$2" in
up)
export MODE="start"
export PHASE="up"
if [ -e /var/run/
then
if grep --silent eth /var/run/
fi
fi
;;
down)
export MODE="stop"
export PHASE="down"
if [ -e /var/run/
then
if grep --silent eth /var/run/
fi
else # same here. Shut it down
fi
;;
pre-up)
export MODE="start"
export PHASE="pre-up"
exec run-parts /etc/network/
;;
post-down)
export MODE="stop"
export PHASE="post-down"
exec run-parts /etc/network/
;;
*)
echo "$0: called with unknown action \`$2'" 1>&2
exit 1
;;
esac
Changed in samba (Ubuntu): | |
status: | Confirmed → Triaged |
Can't reproduce that on Jaunty. On my laptop, switching to VC1 before logging into Gnome (and having NM connect to my wireless) smbd and nmbd (default smb.conf) are running, listening to *.*
Could you tell me what version of Ubuntu you're running and attach your smb.conf ?