Sample Header Ad - 728x90

How to make sure that a child process of a supervisor job dies when I kill supervisor

3 votes
2 answers
6992 views
My app is a jar file that requires some environment variables. I have all the environment variables in one file, which looks like this: export VAR=value export VAR2=value2 #....etc My supervisor config file looks like this: [program:programname] command=bash -c "source /path/to/env/file && java -jar /path/to/jar.jar" ps -ef | grep programname shows two processes on two separate lines: one is bash -c "source blah && java blah" and the other one is just java blah. Now, here's the problem: whether I do supervisorctl stop programname or service supervisor stop or even kill -9 whatever the supervisor pid is, the first process dies, but the regular java process stays and becomes orphaned, with parent pid now 1. How do I make the jar die without manually killing it?
Asked by snetch (187 rep)
Jun 3, 2016, 02:44 PM
Last activity: Nov 19, 2020, 03:58 AM