0

I use debian, same service /usr/bin/something starts same daemon with different config file:

#!/bin/sh

# veriables
service1=on
service9=on
service45=on
[...]

/usr/bin/something /home/user/conf1/something
/usr/bin/something /home/user/conf9/something
/usr/bin/something /home/user/conf45/something

from command line I see with ps:

user 123 0.0 0.0 0.0 pts/2 /usr/bin/something /home/user/conf1/something
user 124 0.0 0.0 0.0 pts/2 /usr/bin/something /home/user/conf9/something
user 125 0.0 0.0 0.0 pts/2 /usr/bin/something /home/user/conf45/something

sometimes linux kills one these and I need to automatically restart. These services really are less or more 100 but does not consecutive, so I need to check with ps which are not started and restart.

If os kills (ie)

user 123 0.0 0.0 0.0 pts/2 /usr/bin/something /home/user/conf1/something

the script should be "scan" with ps which daemon are off (in this case) only

/home/user/conf1/something

and hence start it

  • 1
    You need to edit your question to tell answerers what operating system this is. Then they stand at least a chance of telling you how to use whatever service management your operating system provides. – JdeBP 2 days ago
  • It would also be interesting to know what in "linux kills one of these" and for what reason. – MC68020 2 days ago
  • depends: sometime in dmesg I see "out of memory", although there's some free ram :-/ – Pol Hallen yesterday

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.