Re: running a shell script in the init file
David Gibbons <[email protected]>
| Newsgroups | gmane.org.user-groups.linux.pdxlug |
|---|---|
| Message-ID | <[email protected]> |
Kevin Williams wrote: >All, > >I'm working on a project where I have to start up some commands that run >for the life of the computer's up time. I would like these to start >when the computer boots up, and stop after the computer shuts down >(running Redhat). > >What I have to run are pretty simple commands: >1. multiple perl calls >2. multiple command tail -f log_file_name | logger local3.info > >What I figured I would do would be to create a startup script for the >perl commands and another for the tail commands (shell script that >executes them all). > >>From my understanding, I will have to have a start, stop, and restart >method (which calls stop and start). The start method I can handle >(simply call the command and append the &), but how do I go about >stopping the bash scripts? > >Thanks in advance, > > Log the pids as part of your script(s) to a file and loop over them with a kill -9 to halt them? or assuming your scripts are named uniquely a killall bobjoe.PL ?