Results 1 to 10 of 11
ok my distro is Debian Lenny
As I install/configure/troubleshoot/test new packages have a need for frequently stopping and starting services as I test various configurations. OK I have seen a ...
- 09-08-2009 #1
Various methods for restarting services
ok my distro is Debian Lenny
As I install/configure/troubleshoot/test new packages have a need for frequently stopping and starting services as I test various configurations. OK I have seen a few options. I'm interested to hear what people prefer for this sort of thing.
one thing that is not perfectly clear is how to be sure in advance whether a particular application or service needs a restart after a config change. And it's not clear whether there is a consistent strategy that always works. Are there any services which require a reboot?
Here are a few options I have looked at...
- source /etc/init.d/<startup script name> to manually invoke the startup script, which appears to both start a service if it is stopped and start a service if it is started.
- /etc/init.d/rc is a script, a tool which can be used to start/stop services haven't looked into this too much. I see it is already on my machine.
- a package called sysvconfig which can be downloaded looks pretty slick
so how do you like to deal with this?
edit: as I look into this further, I'm not so sure that the source command is supposed to be used to execute a startup script manually, it's not clear.
- source /etc/init.d/<startup script name> to manually invoke the startup script, which appears to both start a service if it is stopped and start a service if it is started.
- 09-08-2009 #2
I've always just used /etc/init.d/service [start|stop|restart] for Debian and derivative distros.
I think it's pretty safe to assume if you change configuration options, the service has to be restarted for the change to take effect.one thing that is not perfectly clear is how to be sure in advance whether a particular application or service needs a restart after a config change. And it's not clear whether there is a consistent strategy that always works. Are there any services which require a reboot?
- 09-08-2009 #3
right, thanks. /etc/init.d/service looked appealing to me to. Research tells me it is part of the sysvconfig package which I don't have on my bare bones install yet. perhaps I will download it. It looks like a good way to do things.
Ubuntu / Debian Linux: Services Configuration Tool to Start / Stop System Services
- 09-09-2009 #4
I use Ubuntu, but also use the reboot scripts from /etc/init.d/.
- 09-09-2009 #5
Can't say for sure, but I would expect that this sort of thing is pretty similar between Debian and Ubuntu. As I understood, most if not all services that one might need to restart had startup scripts that could be executed along with Start/Stop/Restart command line switches.
One thing that I couldn't nail down was whether all the scripts worked pretty much the same way as I described above, or just what it was that the service command from sysvconfig package provided as "value added" as compared to using the scripts directly like you describe.
- 09-09-2009 #6
As far as I know these scripts are called when the system starts and shuts down. In the first case with the start option and in the latter with the stop option.
I don't know how they work, as I have not yet emerged my self in the world of those scripts.
- 09-09-2009 #7
OK, continuing on with managing services. I have stop/start/restart nailed down pretty good, now looking at enable, disable. So there is two or three ways of dealing with that.
I looked, but I do not see a single overriding flat text file script, whereby one can comment out calls to the startup scripts of the various services. debconf.conf didn't meet the bill. The debian policy manual mentions the following...
The /etc/init.d directory contains the scripts executed by init at boot time. Now the only init I could find is /sbin/init which is not a flat text script.
ok that leaves two options...
apparently one can rename the symbolic links to the startup scripts in /etc/rc<n>.d, but I got the impression that was not always reliable, that sometimes the links couold be recreated?
So it looks like sysvconfig is the way to go for disabling services.
- 09-09-2009 #8
Init is one of the very first threads taking over control untill the system has been sufficiently bootstrapped to hand over control to the user.
I think Ubuntu uses startup instead of Init, but I could be wrong.
- 09-09-2009 #9
I've never used it, but there is sysv-rc-conf
Alternative for chkconfig in Ubuntu - sysv-rc-conf - enable or disable services at startup
The default tool for Debian/Ubuntu, I believe is, update-rc.d
All of this makes me appreciate Arch. Specifying services, modules, and network configuration all happen in one file, /etc/rc.conf, and services don't run by default, you have to list them in the daemons array.Code:sudo update-rc.d -f <service> remove
- 09-09-2009 #10
OK thanks it makes sense. Point is, it can't be edited manually as far as I can see. If anyone knows of an overriding editable script that calls the startup scripts of services and daemons, I'm all ears. So far it seems there isn't one, and we must use some kind of utility like sysvconfig, but i'm not certain.


Reply With Quote
