this post was submitted on 25 Dec 2024
380 points (99.2% liked)

Programmer Humor

24052 readers
1340 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] bleistift2@sopuli.xyz 8 points 5 months ago (3 children)

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.

[–] sik0fewl@lemmy.ca 8 points 5 months ago* (last edited 5 months ago) (1 children)

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.

[–] bleistift2@sopuli.xyz 3 points 5 months ago

When 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.

I also tried prepending exec, but no dice.

[–] RustyShackleford@programming.dev 3 points 5 months ago

"SyStEmD iS bLoAt..."

[–] marcos@lemmy.world 1 points 5 months ago

Your DE may be the one not relaying the sigterm, or it may be losing the PID because of the double launching.

Does the LSB have something to call on termination? Or you may want to call an executable there instead of a script.