On 08/05/2014 12:52 AM, Carlos E. R. wrote:
I have this call in "/etc/NetworkManager/dispatcher.d/mine":
First of all, you didn't tell us what you want to achieve.
/usr/local/bin/nm-hook-mine-up $CONEXION >> /var/log/NetworkManager-mine.log &
This will run the program in the backgound, yes.
It runs, and it calls the other script, but this one after 10 seconds, it dies or it is killed.
I'm unsure if the position of the "&" above is correct :-?
I know that the script dies, because I have this code in it:
echo "waiting (3)..." ; sleep 3 echo "waiting (6)..." ; sleep 3 echo "waiting (9)..." ; sleep 3 echo "waiting (12)..." ; sleep 3 echo "waiting (15)..." ; sleep 3 echo "waiting (18)..." ; sleep 3
And in the log I see:
waiting (3)... waiting (6)... waiting (9)... waiting (12)...
and goes no further.
If the above echo calls are the only content of that script, then my guess is that the parent process (NetworkManager?) has sent a signal to the process ... which the script didn't handle (man trap). The question is: what signal? INT, HUP, QUIT, TERM, PIPE ...? If nm-hook-mine-up should run as a background process forever, i.e., unrelated to its mother process, then it has at least to ignore the HUP signal. You can either start it prefixed with nohup(1) nohup xxx & or ignore that signal inside the script: trap 'echo "ignored HUP"' HUP or trap '' HUP Furthermore, you'd usually also want to care about stdin and stderr: nohup xxx < /dev/null >> xxx.log 2> xxx.stderr.log & # closing stdin, redirecting stderr to the same as stdout (&1) nohup xxx <&- >> xxx.log 2>&1 & But again, without knowing what you wanted to do, it's hard to give an advise. Have a nice day, Berny -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org