Sample Header Ad - 728x90

How to run long time process on Udev event?

17 votes
6 answers
21392 views
I want to run a _ppp_ connection when my USB modem is connected, so I use this udev rule:
ACTION=="add", SUBSYSTEM=="tty", ATTRS{idVendor}=="16d8",\
    RUN+="/usr/local/bin/newPPP.sh $env{DEVNAME}"
(My modem appears in /dev as ttyACM0) **newPPP.sh:** #!/bin/bash /usr/bin/pon prov $1 >/dev/null 2>&1 & ###Problem:### The udev event fires, and newPPP.sh is running, but newPPP.sh process is killed after ~4-5s. ppp does not have time to connect (its timeout is 10s for dial up). How can I run a long time process, that will not be killed? I tried using nohup, but it didn't work either. System: Arch Linux **Update** I found a solution here , thanks to maxschlepzig . I use at now to run my job detached from udev process. But the one question remains unanswered: Why do nohup and & not work?
Asked by neclude
Nov 20, 2012, 09:51 AM
Last activity: Nov 23, 2021, 12:21 PM