Winfried
2017-May-17 10:17 UTC
[Samba] Upgraded > Samba no longer listening on 192.168.0.x
Hello Since I last ran "apt-get upgrade" on a Debian host which upgraded Debian to 8.8 and Samba to 4.2.14, Samba is no longer listening on the 192.168.0.x network after waking up from suspend mode. As a result, it's not listed in Windows' Network Neighborhood and, thus, not reachable from a Windows host where a backup job is running that uses the Debian host as a file server. Samba runs as a stand-alone server at home, and is only used to share a directory, with write access; It handles no printer. This computer only has one Ethernet card, and is scheduled to wake up and go back to sleep every day with enough time to be used to run the backup job. Running "/etc/init.d/samba restart" does solve the problem but I must find the root of the problem and solve it accordingly. Here's what /var/log/syslog says when I run the init.d script; Notice the "At this time the 'samba' binary should only be used for either" at the end: =========May 17 11:56:02 debian systemd[1]: Stopping LSB: start Samba NetBIOS nameserver (nmbd)... May 17 11:56:02 debian nmbd[719]: [2017/05/17 11:56:02.577041, 0] ../source3/nmbd/nmbd.c:58(terminate) May 17 11:56:02 debian nmbd[719]: Got SIGTERM: going down... May 17 11:56:03 debian nmbd[1373]: Stopping NetBIOS name server: nmbd. May 17 11:56:03 debian systemd[1]: Starting LSB: start Samba NetBIOS nameserver (nmbd)... May 17 11:56:07 debian nmbd[1377]: Starting NetBIOS name server: nmbd. May 17 11:56:07 debian systemd[1]: Started LSB: start Samba NetBIOS nameserver (nmbd). May 17 11:56:07 debian nmbd[1389]: [2017/05/17 11:56:07.186384, 0] ../lib/util/become_daemon.c:124(daemon_ready) May 17 11:56:07 debian nmbd[1389]: STATUS=daemon 'nmbd' finished starting up and ready to serve connections May 17 11:56:07 debian systemd[1]: Stopping LSB: start Samba SMB/CIFS daemon (smbd)... May 17 11:56:07 debian smbd[763]: [2017/05/17 11:56:07.320366, 0] ../lib/util/pidfile.c:153(pidfile_unlink) May 17 11:56:07 debian smbd[763]: Failed to delete pidfile /var/run/samba/smbd.pid. Error was No such file or directory May 17 11:56:08 debian smbd[1417]: Stopping SMB/CIFS daemon: smbd. May 17 11:56:08 debian systemd[1]: Starting LSB: start Samba SMB/CIFS daemon (smbd)... May 17 11:56:09 debian smbd[1423]: Starting SMB/CIFS daemon: smbd. May 17 11:56:09 debian systemd[1]: Started LSB: start Samba SMB/CIFS daemon (smbd). May 17 11:56:09 debian smbd[1432]: [2017/05/17 11:56:09.360728, 0] ../lib/util/become_daemon.c:124(daemon_ready) May 17 11:56:09 debian smbd[1432]: STATUS=daemon 'smbd' finished starting up and ready to serve connections May 17 11:56:09 debian systemd[1]: Stopping LSB: start Samba daemons for the AD DC... May 17 11:56:10 debian samba-ad-dc[1461]: Stopping Samba AD DC daemon: samba. May 17 11:56:10 debian systemd[1]: Starting LSB: start Samba daemons for the AD DC... May 17 11:56:11 debian systemd[1]: Started LSB: start Samba daemons for the AD DC. May 17 12:02:19 debian crontab[1516]: (root) LIST (root) May 17 12:02:39 debian kernel: [ 7713.661907] perf interrupt took too long (5003 > 5000), lowering kernel.perf_event_max_sample_rate to 25000 May 17 12:03:30 debian samba[1521]: [2017/05/17 12:03:30.212614, 0] ../source4/smbd/server.c:370(binary_smbd_main) May 17 12:03:30 debian samba[1521]: samba version 4.2.14-Debian started. May 17 12:03:30 debian samba[1521]: Copyright Andrew Tridgell and the Samba Team 1992-2014 May 17 12:03:30 debian samba[1522]: [2017/05/17 12:03:30.650332, 0] ../source4/smbd/server.c:475(binary_smbd_main) May 17 12:03:30 debian samba[1522]: At this time the 'samba' binary should only be used for either: May 17 12:03:30 debian samba[1522]: 'server role = active directory domain controller' or to access the ntvfs file server with 'server services = +smb' or the rpc proxy with 'dcerpc endpoint servers = remote' May 17 12:03:30 debian samba[1522]: You should start smbd/nmbd/winbindd instead for domain member and standalone file server tasks May 17 12:03:30 debian samba[1522]: [2017/05/17 12:03:30.650724, 0] ../lib/util/become_daemon.c:111(exit_daemon) May 17 12:03:30 debian samba[1522]: STATUS=daemon failed to start: Samba detected misconfigured 'server role' and exited. Check logs for details, error code 22 ========= This is the smb.conf I wrote: =========[global] workgroup = WORKGROUP ;netbios name = LINUX log level = 2 ;this avoids needless errors in the logs if you have no printer printcap name = /dev/null load printers = no printing = bsd security = user hosts allow = 127.0.0.1 192.168.0.0/24 hosts deny = 0.0.0.0/0 bind interfaces only = yes map to guest = bad user ;Sheevaplug wins server = 192.168.0.15 [write] path = /BackupFromWindows7 guest ok = yes writeable=yes browseable=yes ========= And I notice that Samba mentions "samba-ad-dc" when running the init.d script: =========root at debian:~# /etc/init.d/samba restart [ ok ] Restarting nmbd (via systemctl): nmbd.service. [ ok ] Restarting smbd (via systemctl): smbd.service. [ ok ] Restarting samba-ad-dc (via systemctl): samba-ad-dc.service. ========= It used to work fine before upgrading: Do I need to change something in smb.conf? And should I run add a Cron job to run the init.d script after the computer wakes up? Thank you. -- View this message in context: http://samba.2283325.n4.nabble.com/Upgraded-Samba-no-longer-listening-on-192-168-0-x-tp4718767.html Sent from the Samba - General mailing list archive at Nabble.com.
Winfried
2017-May-17 10:45 UTC
[Samba] Upgraded > Samba no longer listening on 192.168.0.x
Here goes: root at debian:~# cat /etc/init.d/samba #!/bin/sh ### BEGIN INIT INFO # Provides: samba # Required-Start: # Required-Stop: # Default-Start: # Default-Stop: # Short-Description: ensure Samba daemons are started (nmbd and smbd) ### END INIT INFO set -e # start nmbd, smbd and samba-ad-dc unconditionally # the init scripts themselves check if they are needed or not case $1 in start) /etc/init.d/nmbd start /etc/init.d/smbd start /etc/init.d/samba-ad-dc start ;; stop) /etc/init.d/samba-ad-dc stop /etc/init.d/smbd stop /etc/init.d/nmbd stop ;; reload) /etc/init.d/smbd reload ;; restart|force-reload) /etc/init.d/nmbd "$1" /etc/init.d/smbd "$1" /etc/init.d/samba-ad-dc "$1" ;; status) status=0 NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' 2>/dev/null || true` SERVER_ROLE=`samba-tool testparm --parameter-name="server role" 2>/dev/null | tail -1 || true` if [ "$SERVER_ROLE" != "active directory domain controller" ]; then if [ "$NMBD_DISABLED" != "Yes" ]; then /etc/init.d/nmbd status || status=$? fi /etc/init.d/smbd status || status=$? else /etc/init.d/samba-ad-dc status || status=$? fi exit $status ;; *) echo "Usage: /etc/init.d/samba {start|stop|reload|restart|force-reload|status}" exit 1 ;; esac root at debian:~# -- View this message in context: http://samba.2283325.n4.nabble.com/Upgraded-Samba-no-longer-listening-on-192-168-0-x-tp4718767p4718769.html Sent from the Samba - General mailing list archive at Nabble.com.
Rowland Penny
2017-May-17 10:53 UTC
[Samba] Upgraded > Samba no longer listening on 192.168.0.x
On Wed, 17 May 2017 03:17:13 -0700 (PDT) Winfried via samba <samba at lists.samba.org> wrote:> > And I notice that Samba mentions "samba-ad-dc" when running the init.d > script: > =========> root at debian:~# /etc/init.d/samba restart > [ ok ] Restarting nmbd (via systemctl): nmbd.service. > [ ok ] Restarting smbd (via systemctl): smbd.service. > [ ok ] Restarting samba-ad-dc (via systemctl): samba-ad-dc.service. > =========> > It used to work fine before upgrading: Do I need to change something > in smb.conf? And should I run add a Cron job to run the init.d script > after the computer wakes up? > > Thank you.It looks the init script is trying to start Samba as an AD DC, but you don't have an AD DC ;-) The init script is provided by Debian and not by Samba. Can you post the init script ? Rowland
Marc Muehlfeld
2017-May-17 10:58 UTC
[Samba] Upgraded > Samba no longer listening on 192.168.0.x
Hi Winfried, Am 17.05.2017 um 12:17 schrieb Winfried via samba:> Samba runs as a stand-alone server at home, ...> ... > Notice the "At this time the 'samba' binary should > only be used for either" at the end: > ...> May 17 12:03:30 debian samba[1522]: At this time the 'samba' binary should> only be used for either: > May 17 12:03:30 debian samba[1522]: 'server role = active directory domain > controller' or to access the ntvfs file server with 'server services = +smb' > or the rpc proxy with 'dcerpc endpoint servers = remote' > May 17 12:03:30 debian samba[1522]: You should start smbd/nmbd/winbindd > instead for domain member and standalone file server tasks > May 17 12:03:30 debian samba[1522]: [2017/05/17 12:03:30.650724, 0] > ../lib/util/become_daemon.c:111(exit_daemon) > May 17 12:03:30 debian samba[1522]: STATUS=daemon failed to start: Samba > detected misconfigured 'server role' and exited. Check logs for details, >> ...> And I notice that Samba mentions "samba-ad-dc" when running the init.d > script: > =========> root at debian:~# /etc/init.d/samba restart > [ ok ] Restarting nmbd (via systemctl): nmbd.service. > [ ok ] Restarting smbd (via systemctl): smbd.service. > [ ok ] Restarting samba-ad-dc (via systemctl): samba-ad-dc.service. > =========This is not a Samba problem. It looks like the update enabled a systemd service that starts the "samba" binary - which is the Samba AD DC. Because your config is not for a DC, Samba logs this error. * Disable the samba and samba-ad-dc services * Enable the nmbd and smbd services Regards, Marc
L.P.H. van Belle
2017-May-17 11:06 UTC
[Samba] Upgraded > Samba no longer listening on 192.168.0.x
that init script is ok. Try adding the following in your smb.conf Add : interfaces = 192.168.249.230 127.0.0.1 Or interfaces = eth0 lo ( change eth0 to your interface name) Check: systemctl status samba systemctl status samba-ad-dc If samba-ad-dc is enable, disable that one, and enable samba. systemctl disable samba-ad-dc systemctl enable samba Greetz, Louis> -----Oorspronkelijk bericht----- > Van: samba [mailto:samba-bounces at lists.samba.org] Namens > Winfried via samba > Verzonden: woensdag 17 mei 2017 12:45 > Aan: samba at lists.samba.org > Onderwerp: Re: [Samba] Upgraded > Samba no longer listening > on 192.168.0.x > > Here goes: > > root at debian:~# cat /etc/init.d/samba > #!/bin/sh > > ### BEGIN INIT INFO > # Provides: samba > # Required-Start: > # Required-Stop: > # Default-Start: > # Default-Stop: > # Short-Description: ensure Samba daemons are started (nmbd > and smbd) ### END INIT INFO > > set -e > > # start nmbd, smbd and samba-ad-dc unconditionally # the init > scripts themselves check if they are needed or not case $1 in > start) > /etc/init.d/nmbd start > /etc/init.d/smbd start > /etc/init.d/samba-ad-dc start > ;; > stop) > /etc/init.d/samba-ad-dc stop > /etc/init.d/smbd stop > /etc/init.d/nmbd stop > ;; > reload) > /etc/init.d/smbd reload > ;; > restart|force-reload) > /etc/init.d/nmbd "$1" > /etc/init.d/smbd "$1" > /etc/init.d/samba-ad-dc "$1" > ;; > status) > status=0 > NMBD_DISABLED=`testparm -s > --parameter-name='disable netbios' 2>/dev/null || true` > SERVER_ROLE=`samba-tool testparm > --parameter-name="server role" 2>/dev/null | tail -1 || true` > if [ "$SERVER_ROLE" != "active directory > domain controller" > ]; then > if [ "$NMBD_DISABLED" != "Yes" ]; then > /etc/init.d/nmbd status || status=$? > fi > /etc/init.d/smbd status || status=$? > else > /etc/init.d/samba-ad-dc status || status=$? > fi > exit $status > ;; > *) > echo "Usage: /etc/init.d/samba > {start|stop|reload|restart|force-reload|status}" > exit 1 > ;; > esac > root at debian:~# > > > > > -- > View this message in context: > http://samba.2283325.n4.nabble.com/Upgraded-Samba-no-longer-listening-on-192-168-0-x-tp4718767p4718769.html> Sent from the Samba - General mailing list archive at Nabble.com. > > -- > To unsubscribe from this list go to the following URL and read the > instructions: https://lists.samba.org/mailman/options/samba > >
Apparently Analagous Threads
- Upgraded > Samba no longer listening on 192.168.0.x
- Upgraded > Samba no longer listening on 192.168.0.x
- [4.2.14-Debian] Smbd not listening on 192.168.0.x on cold start
- [4.2.14-Debian] Smbd not listening on 192.168.0.x on cold start
- [4.2.14-Debian] Smbd not listening on 192.168.0.x on cold start