Discussion:
[Supervisor-users] bash exec & trap, how to work together?
Ryan Chan
2014-06-19 04:44:16 UTC
Permalink
I see a lot of tutorial pointing to use bash script as a wrapper, e.g.

command=/opt/program/start.sh

And in the start.sh, we can have something like..

#!/bin/bash

exec myprogram


What if, I want to place a trap function in my shell script, will it still
be possible with my above method?

e.g.

function myexit {

echo "bye"

}


trap myexit EXIT


or any work around to execute some code if my process exit?

Loading...