PDA

View Full Version : [ubuntu] 10.04 Correct way to start stop disable Services



andydread
August 25th, 2010, 12:52 PM
With the advent of Ubuntu 10.04 Lucid Lynx LTS People are migrating servers to the latest LTS. One fundamental thing that has changed is the move to Upstart. In the old days to stop multidaemon service such as Samba, one would simply type /etc/init.d/samba stop and to disable it from starting on boot one would simply type update-rcd samba disable.

Now its the year 2010 and in 10.04 it seems on has to edit a bunch of files, etc. Is there not an easy tool to correctly and properly disable services on startup in 10.04 consistently?

in Redhat/Mandrake 10 years ago it was simply

service smb off

In Ubuntu 10.04 its
1) edit /etc/init/smbd.conf and modify the line that says

stop on runlevel [!2345]
and change it to

stop on runlevel [!45]
because Ubuntu uses runlevel 2

2) edit /etc/init/nmbd.conf and do the same

then

3) sudo update-rc.d winbind disable

And one has to remember all these changes when the get ready to enable the samba service in the future?

This can't be right. I know I must be missing something here. or maybe overlooked something in the upstart documentation. Which seems quite sparse by the way.

So the question remains. How does one simply disable a multidaemon service starting on boot such as samba. Any tool to do this ? Is the above the correct method recommended by Canonical to disable services? and enable them?

john newbuntu
August 25th, 2010, 03:09 PM
Well, for 1 and 2, you could disable it by just renaming the files to end with something other than ".conf". Winbind is not in the samba package if I am right but it still uses init. So yeah, use the update-rc.d or sysv-rc-conf. I know it is still a minor pain to keep track of these.

But you are right. At some point there has to be a migration of every script from the sysV init to the upstart jobs plus a handy-dandy way to manage the jobs perhaps by using enable/disable flag through a CLI and in the GUI. Dont know if that is in the pipeline.

oooh
September 10th, 2010, 12:40 PM
I absolutelly agree with the starting comment

Starting and stopping something from booting editing a .conf file is A MESS

I hope they come up with something cleaner and more ellegant ...