I use demo.sh
to start a daemon mpi task:
#! /bin/sh
if ! kill -0 $(cat pid) > /dev/null 2>&1
then
/sbin/start-stop-daemon -p pid -m pid --start --background --exec mpirun -n 2 a.out
fi
But it can not work, how can I use start-stop-daemon
to start a mpi job?