How do I run a script as a service
Hi,
I have a bash script I wrote to monitor two VPN connections. I currently start it from rc.local, but to kill it I have to do a ps aux .... and a kill. To get round this I have hacked another init script, but it does not work as expected. My script is: Code:
#!/bin/sh Code:
ps aux | grep ipsec.c How do I get it to run just one process? |
Might be worth reading the start-stop-daemon man page.
|
I've had a read of it. If I understand it the -b switch may be useful but it says use as a last resort.
I've tried the start-stop-daemon command instead of just daemon, but the system (ClarkConnect CE5.0) just says command not found. If I try the -b switch with the daemon command then run ps aux nothing shows so either it has run and terminated or not run at all. I may be being dense here or I'm just too new. |
Quote:
|
When you say "what does it look like", how to I tell?
|
The answer seems to be to change the starting daemon line to:
Code:
daemon "/etc/ipsec-check &" |
All times are GMT -5. The time now is 06:14 AM. |