corrected exit code handling
This commit is contained in:
parent
5f937c7ccf
commit
29f94e070c
2 changed files with 7 additions and 5 deletions
|
@ -70,7 +70,7 @@ static void exit_sighup(int signal) {
|
|||
static void exit_sigint(int signal) {
|
||||
assert(signal == SIGINT);
|
||||
LOG_CS << "SIGINT caught, exiting without cleanup immediately.\n";
|
||||
exit(1);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
static void exit_sigterm(int signal) {
|
||||
|
|
|
@ -34,9 +34,11 @@ do
|
|||
COMMAND="$HOME/bin/campaignd-$VERSION $THREADS $PARAMETERS"
|
||||
echo "started $VERSION campaignd with command: '$COMMAND' at: $DATE"
|
||||
$COMMAND &> $SERVERBASE/logs/campaignd.$DATE
|
||||
EXIT_CODE="$?"
|
||||
echo "$EXIT_CODE"
|
||||
mv gmon.out gmon.$DATE.out &> /dev/null
|
||||
[ "$?" != "0" ] || exit
|
||||
[ "$?" != "1" ] || die "File I/O error."
|
||||
[ "$?" != "2" ] || die "Could not parse config file."
|
||||
[ "$?" != "3" ] || die "Could not bind to port."
|
||||
[ "$EXIT_CODE" != "0" ] || exit
|
||||
[ "$EXIT_CODE" != "1" ] || die "File I/O error."
|
||||
[ "$EXIT_CODE" != "2" ] || die "Could not parse config file."
|
||||
[ "$EXIT_CODE" != "3" ] || die "Could not bind to port."
|
||||
done
|
||||
|
|
Loading…
Add table
Reference in a new issue