Supervisord requires that the programs it is configured to run don’t daemonize themselves. Instead, they should run in the foreground and respond to the stop signal (TERM by default) by properly shutting down.
Use Following shell script to wrapper your background program.12345678910111213141516171819# run something background./run &# get nearest running background pid$PID=$!# Perform program exit housekeepingfunction clean_up { # dosomething for cleanup rm -rf dump_file # remove trap trap - SIGHUP SIGINT SIGTERM SIGQUIT SIGKILL exit $?}# Add trap for catch sistem signaltrap clean_up SIGHUP SIGINT SIGTERM SIGQUIT SIGKILLwait $PID