Starting and killing services on system cycle:
Ok, I figured that to add a startup process (samba is what I'm working on), you can add that to the rc.local file in /etc/rc.d
Here's what I put in: Code:
if ps -ef | grep mbd | grep -v grep ; then I figure it would be smart to have a kill script in the rc.6 directory as well ... but I don't know how to do that (or even if what I've done is "correct" even though it works ;) ). All the files in rc.6 are linked files ... plus, smb doesn't want a "kill" signal per se (and as I understand it, the rc.6 files are simply sent a term signal?). I just want a script that'll say something to the effect of: Code:
if ps -ef | grep mbd | grep -v grep ; then |
Sorry but I don't really get what you're trying to do here, if you're trying to run smbd on startup can't you put it in the runlevels you desire?
|
Erm ... I suppose I could. I guess that's part of my question. I'm not nearly 100% familiar with what the runlevels do ... do they simply send an init and term signal to the process you identify? For example, if I ln -s the smb init file to a Snn or Knn in one of the rc.X directories, I think it'll work, but is that correct to do?
Samba asks for you to run "smb xxx" where xxx is start, restart, or stop. I've heard people can just put them in the rc folders as a runlevel link, but I'd like to get in the habit of doing things correctly. I guess in basic my question might be, /should/ you use the runlevels if the script you're starting asks for a command line input? |
If you want to know more about runlevels try this guide
http://www.icon.co.za/~psheer/book/index.html particularly on chapter 32 For a quick answer yes you should have a dedicated script for starting a service on boot for a particular runlevel, though you don't have to, this makes it easier to manage. for example if you want to add smb to the default runlevel(5 in Mandrake I think) instead of doing the symlinks manually you can use: Code:
/sbin/chkconfig --level 5 smb on |
Good grief that's a long one! ha! Ok, I'll start reading that and get back to you.
For now, I redid it and currently have: Code:
smb 0:off 1:off 2:off 3:on 4:off 5:on 6:off as it appears this is what everyone is telling me to do. This seems to be working just fine. I guess my current question, then, is moot, but I'm still curious; if using the runlevel starts and kills these things just fine ... does smb or network or eth0 or whatnot accept an init signal instead of the "start" "stop" or "restart" ... or do those simply echo a term and init signal to these scripts? Thanks for the manual to look at! |
Sorry, I'm a moron ... didn't disable smilies /or/ preview my post. Just that section again:
Code:
smb 0ff 1ff 2ff 3n 4ff 5n 6ff |
Last time ... this time without the idiocy ....
Code:
smb 0:off 1:off 2:off 3:on 4:off 5:on 6:off |
All times are GMT -5. The time now is 12:04 AM. |