> -----Original Message----- > From: s. keeling [mailto:[EMAIL PROTECTED] > Sent: Friday, January 30, 2004 12:39 PM > To: [EMAIL PROTECTED] > Subject: Re: /etc/init.d/ - add/remove services > > > Incoming from Adam Aube: > > On Friday 30 January 2004 03:15 pm, [EMAIL PROTECTED] wrote: > > > What is the preferred way to add or remove a /etc/init.d/ service from > > > certain runlevels? > > > > For adding, use the update-rc.d script. To remove, just manually delete > > the symlink. You can use update-rc.d to remove, but you would need to > > first remove all the symlinks, then add the set that you want. > > Alternatively, leave the links alone and just manipulate the scripts > in /etc/init.d themselves. If you don't want something to run, insert > "exit" near the top of the script (after the shebang line). > >
I don't know if there is a preferred way. There are many ways and choose the one you like. The convention I use is to rename the file/link with a "no" in front. e.g. mv /etc/rc3.d/K96pcmcia /etc/rc3.d/noK96pcmcia mv /etc/rc3.d/S50snmpd /etc/rc3.d/noS50snmpd That way if I ever want to put it back, I know where the original file was . The advantage it would have over the "exit" method above is that by doing an "ls" on the /etc/rc*d directories you can see what services are started/killed clearly and also what services used to be started/killed by the "no" in the filename whereas with the "exit" you'd have to look in the file itself to find that the service was being killed. Also, you have finer control over the runlevels. Putting an "exit" in the script will kill the service for all runlevels. Whereas renaming a link will kill for an individual runlevel. THe disadvantage is if you do want to disable the service altogether, you wlil have to possibly rename up to 6 scripts where as in the "exit" method you just have to edit one script. Just another alternative. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]