PDA

View Full Version : [SOLVED] Where is /etc/init.d/samba in 10.04?



thebrotherofasis
May 1st, 2010, 01:01 PM
In the old days (9.10) samba service used to be located in /etc/init.d/samba

Where did it go in 10.04?

I installed samba using


sudo apt-get install samba smbfs

and restarted the computer.

Now, doing


findsmb

works ok.

However, if I want to restart the service after editing smb.conf by running


sudo /etc/init.d/samba restart

it outputs


sudo: /etc/init.d/samba: command not found

Then I open a terminal and navigate to /etc/init.d/ and I can't see samba there.

However, samba is working ok and identifying all computers in my home network.

Where did the service go then?

Thank you!

Morbius1
May 1st, 2010, 01:32 PM
Two things have happened - "upstart" has replaced the old way of starting services and the "samba" service has been replaced by the old way of separating the smbd and nmbd daemons.

So the way you need to restart samba is now this way:

sudo service smbd restart
sudo service nmbd restart

thebrotherofasis
May 1st, 2010, 01:49 PM
Thank you.

It shows then now.

pupEOkami
June 5th, 2010, 07:02 AM
Two things have happened - "upstart" has replaced the old way of starting services and the "samba" service has been replaced by the old way of separating the smbd and nmbd daemons.

So the way you need to restart samba is now this way:

sudo service smbd restart
sudo service nmbd restart


now will they make a fix or patch for webmin
Access control violation : /etc/init.d/samba start failed

Morbius1
June 5th, 2010, 01:02 PM
now will they make a fix or patch for webmin
Access control violation : /etc/init.d/samba start failed
According to this it's in the next release of webmin:
http://sourceforge.net/tracker/index.php?func=detail&aid=2995073&group_id=17457&atid=117457

You know when I originally posted this:

Two things have happened - "upstart" has replaced the old way of starting services and the "samba" service has been replaced by the old way of separating the smbd and nmbd daemons.

So the way you need to restart samba is now this way:

sudo service smbd restart
sudo service nmbd restart I was unaware that there was a third change to all of this - just to aggravate and confuse those of us not on the "need to know" mailing list:

Back in the good old days ( 6 months to a year ago ) if smbd was stopped or not started and you did a "sudo service smbd restart" it would start the daemon. Not any longer:

sudo service smbd stop
smbd stop/waiting
sudo service smbd restart
restart: Unknown instance: The only logic I can think of for this change is that it is now grammatically correct - you can't restart something that hasn't started :roll: So if smbd is stopped you need to do a "sudo service smbd start"

gabak
June 21st, 2010, 05:03 AM
why did they do that? why confuse ppl?
is there any reasonable explanation?

Jml79
July 30th, 2010, 08:49 PM
Somebody needs to update the docs. The 10.04 server guide still has "/etc/init.d/samba restart" in its documentation for samba. Very confusing.

also, "restart smbd" works. This is all that I have needed after a change to the smb.conf file.

edit: already reported to docs bug teacker. Hopefully it will get updated soon.

gabak
August 3rd, 2010, 03:44 AM
how can i report that bug without hassle?

matthewdial
August 11th, 2010, 03:07 AM
Ubuntu 10.04 server ed.
Samba 3.4.7


Two things have happened - "upstart" has replaced the old way of starting services and the "samba" service has been replaced by the old way of separating the smbd and nmbd daemons.

So the way you need to restart samba is now this way:

sudo service smbd restart
sudo service nmbd restart

When I try the smbd restart I receive "restart: Unknown instance:"

I'm new to this and not sure what in the world I'm doing (including did I post in the wrong place since this thread is labeled "Solved"?). I've tried configuring it via CLI and also Webmin. But as mentioned above, restarting Samba in Webmin does not work.

Morbius1
August 11th, 2010, 11:22 AM
Ubuntu 10.04 server ed.
Samba 3.4.7
When I try the smbd restart I receive "restart: Unknown instance:"

You didn't read the rest of my posts.

If smbd is already running and you want to restart samba:

sudo service smbd restartIf smbd is currently not running:

sudo service smbd startIf you use "restart" when smbd in not running you will get the error message:

"restart: Unknown instance:"All of this is not as it used to be. Before you could use "restart" to start a service that is not running. They must have hired a developer that is very persnickety about grammar - you can't restart something that hasn't started ;)

chaumurky
August 15th, 2010, 08:01 AM
...They must have hired a developer that is very persnickety about grammar - you can't restart something that hasn't started ;)

But what if it had started and then stopped? Wouldn't I restart it? :P

herauthon
August 22nd, 2010, 11:59 AM
:KS
Checked the boot and startup processes in webmin
viewed content of the mechanics.

found: service
Usage: service < option > | --status-all | [ service_name [ command | --full-restart ] ]


service smbd start
smbd start/running, process 1510

service nmbd start
nmbd start/running, process 1527

made 2 shell scripts

open shell and..

cd /etc/init.d
echo service smbd start > samba-up
echo service nmbd start >> samba-up

echo service smbd stop > samba-down
echo service nmbd stop >> samba-down

chmod +rx samba-up samba-down

replace the Samba start/stop entries in Webmin
with /etc/init.d/samba-up - and /etc/init.d/samba-down


issue resolved?

andydread
August 25th, 2010, 12:10 PM
So now How does one disable the starting of samba on boot? Back about a decade ago when I setup Red Hat and Mandrake servers it was as simple as

service smb off

I used to be able to apt-get install rcconf and disable it there. does rcconf play well with upstart?

How does one simply disable samba on boot now that everything is moved to upstart.

doubleu-
August 27th, 2010, 03:59 PM
lol the documentation needs changed too

https://help.ubuntu.com/10.04/serverguide/C/samba-fileserver.html


#

Finally, restart the samba services to enable the new configuration:

sudo /etc/init.d/samba restart

dremelts
September 14th, 2010, 03:20 AM
Two things have happened - "upstart" has replaced the old way of starting services and the "samba" service has been replaced by the old way of separating the smbd and nmbd daemons.

So the way you need to restart samba is now this way:

sudo service smbd restart
sudo service nmbd restart

Does this detach the daemons so they run in the background? Just today I set up samba and after making changes to the smb.conf file I used the above commands to restart samba. All was good until I logged out of the server and people lost their connections to the network share. So I restarted them again and left the server logged in until I could sort it out.

hagfish52
January 29th, 2012, 10:34 PM
It looks like you should have to use initctl to start or stop SAMBA, but there is some problem with the /etc/init/smbd.conf file used by Upstart that prevents it from working. Anybody have any ideas about how to modify the script so it will work correctly? --John