Answer the question
In order to leave comments, you need to log in
How to make BASH script keep track of hundreds of running processes?
Hello
everyone I made this sh-script for my specific task:
#! /bin/bash
if [ -e /home/user/pid/program1.pid ]
then
exit
else
nohup /home/user/start/program1 > /dev/null &
fi
if [ -e /home/user/pid/program1.pid ]
then
exit
fi
exit 0
Answer the question
In order to leave comments, you need to log in
To monitor the status of daemons, there is a supervisor and watchdog, the second one is part of systemd.
In general, the answers that were given to me are very practical, but if you still need it that way, then you can work with the parameters.
#! /bin/bash
if [ -e $1 ];then
exit
else
nohup $2 > /dev/null &
fi
exit 0
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question