Menu

#4329 Samba Restart fails in 1.660 against LinuxMint 16 / Ubuntu 13.10

1.660
closed-fixed
nobody
None
5
2016-10-30
2013-12-08
fbachofner
No

I installed 1.660 on LinuxMint 16 yesterday. Now, restarting Samba from within Webmin produces the following error:

"Failed to restart Samba servers : /etc/init.d/samba start || (/etc/init.d/nmbd start ; /etc/init.d/smbd start) failed"

In an Ubuntu based distro (LinuxMint 16 is based on Ubuntu 13.10) the Samba services running state should best be managed thusly:

sudo service smbd stop
sudo service smbd start

or
sudo service smbd restart

Previously I had 1.630 (or maybe 1.610 or even 1.590 since I last needed to restart Samba within Webmin) running on LinuxMint 15 and restarting Samba worked fine. This therefore seems to be a regression.

Webmin seems to call "restart.cgi" when clicking the button. Where is this file located? I'd like to try editing it to see whether I can fix the problem in this version.

Thanks!

Discussion

<< < 1 2 (Page 2 of 2)
  • fbachofner

    fbachofner - 2015-10-05

    "sudo" is not needed (see my post of 2013-12-08 )

    However, as Rodrigo mentions, the issue does still stand -- I too have to edit the Webmin samba config file with each new install.

     
  • Rodrigo R. Magalhães

    Hi all,

    Jamie is right, sudo is absolutelly not necessary. Having the *_cmd commands without the sudos:

    stop_cmd=service smbd stop;service nmbd stop
    restart_cmd=service smbd restart;service nmbd restart
    start_cmd=service smbd start;service nmbd start

    Does the job just fine.

    The important thing I'd like to mention though is that the original form for the *_cmd mentioned above:

    stop_cmd=/etc/init.d/samba stop || (/etc/init.d/nmbd stop ; /etc/init.d/smbd stop)
    restart_cmd=/etc/init.d/samba restart || (/etc/init.d/nmbd restart ; /etc/init./smbd restart)
    start_cmd=/etc/init.d/samba start || (/etc/init.d/nmbd start ; /etc/init.d/smbd start)

    Just does not work for Ubuntu (and apparently for Debian derivatives all the same).

    I tried issuing , and in the command line and, although they are accepted, they are of no effect over the actual state for the smbd and nmbd deamons.

    So, baseline is: how could we have it work out of the box then?

     
  • Jamie Cameron

    Jamie Cameron - 2015-10-06

    Ok, for systems based on Debian 8 and above, Webmin will use the "service smbd" and "service nmbd" commands in future releases.

     
  • Georg

    Georg - 2016-03-27

    Hi, I stumbled onto this thread, my OS is mint 17.3, same problem. The current webmin in the repository doesn't seem to have implemented the solution yet.
    This discussion helped me to fix it for now. These lines in /etc/webmin/samba/config work for me:

      stop_cmd=service nmbd stop ; service smbd stop
      start_cmd=/etc/init.d/samba start || (service nmbd start ; service smbd start)
      restart_cmd=/etc/init.d/samba restart || (service nmbd restart ; service smbd restart)
    

    The useless call "/etc/init.d/samba ..." needs to be deleted from the stop_cmd line, probably returns true, so that the call to 'service ...' never gets executed. One could of course delete the other 2 also.

    Now to the reason for this mess:

    Even though the scripts /etc.init.d/smbd|nmbd get properly executed, they have a secret enemy: systemd. systemd will immediately restart any daemon under its control, detectable by changed pids.

    So, "service" is the only effective way to start|stop|restart samba on mint 17.3 et al. The question for webmin is of course, how to sort this out scriptwise, many linuxes use systemd, some don't.

    The systemd discussion is quite controversial. Some linuxers even consider moving to BSD ...
    As an old Unix type I agree with Henry Spencer: "Those who do not understand Unix are condemned to reinvent it, poorly." Bless his heart.

    Thanks for webmin!

     

    Last edit: Georg 2016-03-27
  • fbachofner

    fbachofner - 2016-10-30

    I've been working with Samba a lot on a few machines over the last couple days. Webmin to the rescue! ;-)

    Unfortunately, the stop button still does not accurately reflect the samba daemon (smbd) state. (i.e. it is NOT green when the service is stopped.

    Interestingly, I noticed that Ubuntu Server 16.04 is not showing me SMBD status messages when invoking service smbd stop start or restart commands at the command line. I think this is new to Ubuntu 16.04 (although I may be confusin Ubuntu and Linux Mint performance).

    sudo service smbd status does give accurate status messages, so the requisite data is available

     
    • fbachofner

      fbachofner - 2016-10-30

      I should have mentioned, all these boxes are running Webmin 1.820, some on top of Ubuntu 16.04 some on LinuxMint 18.0 (which is based on Ubuntu 16.04)

       
<< < 1 2 (Page 2 of 2)

Log in to post a comment.

MongoDB Logo MongoDB