Re: running a shell script in the init file
"Dave \"doughnut\" Fogarty" <[email protected]>
| Newsgroups | gmane.org.user-groups.linux.pdxlug |
|---|---|
| Message-ID | <[email protected]> |
After you start a program with "&" in the background, "$!" will contain the PID of that program. Write that to a file in /var/run/. You can kill that PID when you run your stop. -- ------------------------------------------------------------------------ /(D|\|\))([o0](u[g6]h)?nu[t+7]|[a\@4](v|\\\/)([e3]|[i1!](d|\|\))))/i On Wed, 8 Dec 2004, 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, > >Kevin Williams >_______________________________________________ >PDXLUG mailing list >[email protected] >http://pdxlug.org/mailman/listinfo/pdxlug >