You're viewing a single thread.
View all comments
40
comments
I realise I'm late to the party and you've alreadu gone the systemd unit way, but had your script trapped sigterm to begin with?
5 0 ReplyWhen I run the script myself and kill it, it gets the signal and acts correctly. Only when I poweroff the system, this doesn’t work.
5 0 ReplySIGINT is sent when you press Ctrl+C. SIGTERM is sent in just about every other situation - basically when the system wants the program to end. For instance when systemd wants to stop the service or the default signal with programs like
kill
pkill
htop
etc. You should catch both of these signals.7 0 ReplyI did try to catch all of these signals:
| "SIGABRT" | "SIGALRM" | "SIGBUS" | "SIGCHLD" | "SIGCONT" | "SIGFPE" | "SIGHUP" | "SIGILL" | "SIGINT" | "SIGIO" | "SIGIOT" | "SIGKILL" | "SIGPIPE" | "SIGPOLL" | "SIGPROF" | "SIGPWR" | "SIGQUIT" | "SIGSEGV" | "SIGSTKFLT" | "SIGSTOP" | "SIGSYS" | "SIGTERM" | "SIGTRAP" | "SIGTSTP" | "SIGTTIN" | "SIGTTOU" | "SIGUNUSED" | "SIGURG" | "SIGUSR1" | "SIGUSR2" | "SIGVTALRM" | "SIGWINCH" | "SIGXCPU" | "SIGXFSZ" | "SIGBREAK" | "SIGLOST" | "SIGINFO";
2 0 ReplyGood luck trapping the SIGKILL signal
1 0 Reply
You've viewed 40 comments.
Scroll to top