0

I have a very simple script, let's call it foo.sh. It's this:

#!/bin/sh
sxhkd &
panel &

where panel is a script (I won't post it here because it's very long and I don't think it would be relevant) which will spawn some child processes.
I execute the script with sh foo.sh.
Now, my problem is that if I kill panel from another shell with pkill panel for some reason sxhkd is also killed, and that is very undesiderable. I tried ampersand, disown, nohup, and I haven't got other ideas.

How can I avoid that?

0

untested, but try

#!/bin/sh
nohup sxhkd </dev/null >/dev/null 2>/dev/null &
nohup panel </dev/null >/dev/null 2>/dev/null &

To completely disassociate them from each other

  • Tried now, it still doesn't work. – pinusc Feb 7 '16 at 15:19
  • Check that panel doesn't have any traps that might kill the other process – glenn jackman Feb 7 '16 at 15:28
  • Oh, damn. thank you, that was it! Panel had a trap I didn't notice. – pinusc Feb 7 '16 at 15:42
  • What did the trap look like? I have the exact same problem running panel and sxhkd. (I copied somebody's panel a long while back and modified it heavily) – Dino Hensen Jun 14 '16 at 22:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.