1
zachowanie bash na sigterm
Przygotuj skrypt jak poniżej: #!/bin/bash # # run this script. don't run it if it's already running. # PIDFILE=/tmp/script.pid LOGFILE=script.log if [[ -f $PIDFILE ]]; then echo "$PIDFILE exists. Not going to run..." exit 0 fi sleep 10m >> $LOGFILE 2>&1 & PID=$! echo $PID > $PIDFILE trap "echo Exiting...; …