That’s why you launch them through systemd.
The constant nagging by you systemd people worked. I’ve written a unit that does what I need it to do. That was more annoying than I think it needed to be, but well… my solution didn’t work at all.
You are never guaranteed to be able to do anything during a crash. You are better off handling these kinds of edge cases in a recovery phase during the start of your app.
It’s not a crash. It’s a graceful shutdown. I expected that to also shutdown my app gracefully.
I’m actually trying to store the program state that hasn’t been persisted yet to disk. Good luck doing that after the next boot.
Persist everything to disk in real time. When the signal hits exit immediately.
Persist everything to disk in real time.
That’s the thing I’m trying to avoid.
Crash-only software. To be resilient you need some kind of ACID anyway which means that you can let go of your shutdown procedure and just send yourself SIGKILL instead.
This is legitimately the best usage of this meme I’ve seen in years. Termination signals hnnngg
Can’t SIGTERM be observed to react to a poweroff?
How are you running your script?
(I have no idea how to solve your issue I’m just asking questions to sound smart and helpful)
It’s a node process invoked by a run.sh
, which gets executed via a .desktop
file in the ~/.config/autostart
directory.
I went with a systemd unit now and it works.
I can’t remember off the top of my head, but your shell script might not be relaying the SIGTERM. Make sure you start your node process with the “exec” statement. This will replace the script’s process with node instead of having node be a subprocess of your script.