Viewing 1 to 3 of 3 items
Tag Archives: Daemon

check process

check_process.sh check_process.sh The script checks whether a specific process is running. It just parses output of ps. If the process is not running, the script runs a command to start the process. Features: – check whether a process is running – try to start the process with a specified command – return the result of  Full Article…

0

Check if program is running with bash shell script?

This is an example of a bash script which checks for some running process (daemon or service) and does specific actions (reload, sends mail) if there is no such process running. check_process(){ # check the args if [ “$1” = “” ]; then return 0 fi #PROCESS_NUM => get the process number regarding the given  Full Article…

0

Excluding grep from process list

ps aux | grep daemon_name | awk “{ print $2 }” grep’s -v switch reverses the result, excluding it from the queue. So make it like: ps aux | grep daemon_name | grep -v grep | awk “{ print $2 }” Upd. You can also use -C switch to specify command name like so: ps -C daemon_name -o pid=  Full Article…

0