Re: NetworkManager-dispatcher killing my scripts

2013-07-31 Thread Jeff Sadowski
but echoing the command to "at now" does start a new process and
worked beautifully.

On Wed, Jul 31, 2013 at 4:41 AM, Simon Geard  wrote:
> On Tue, 2013-07-30 at 14:04 -0600, Jeff Sadowski wrote:
>>  exec /bin/bash -c "$0 test" &
>
> Running it with exec means you're not starting a new process, just
> overwriting the current one. Same PID, so NM will still kill it...
>
> Simon.
>
> ___
> networkmanager-list mailing list
> networkmanager-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/networkmanager-list
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: NetworkManager-dispatcher killing my scripts

2013-07-31 Thread Simon Geard
On Tue, 2013-07-30 at 14:04 -0600, Jeff Sadowski wrote:
>  exec /bin/bash -c "$0 test" &

Running it with exec means you're not starting a new process, just
overwriting the current one. Same PID, so NM will still kill it...

Simon.

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: NetworkManager-dispatcher killing my scripts

2013-07-30 Thread Jeff Sadowski
Found a work around sending the task to "at now" completed it.
The following counts all the way to 24

<---start of /etc/NetworkManager/
dispatcher.d/99-test script
#!/bin/bash
test()
{
 x=0
 while [ ${x} -lt 25 ];do
 sleep 1
 echo ${x} > /tmp/test
 let x=${x}+1
 done
}
if [ "$1" = "test" ];then
 test
else
 echo "$0 test" | at now
fi
<--end of script

On Tue, Jul 30, 2013 at 2:04 PM, Jeff Sadowski  wrote:
> I tried having it recall itself as follows but it is still getting
> killed now after 9 seconds.
>
> updated script
> <---start of /etc/NetworkManager/dispatcher.d/99-test script
> #!/bin/bash
> test()
> {
>  x=0
>  while [ ${x} -lt 25 ];do
>  sleep 1
>  echo ${x} > /tmp/test
>  let x=${x}+1
>  done
> }
> if [ "$1" = "test" ];then
>  test
> else
>  exec /bin/bash -c "$0 test" &
> fi
> <--end of script
>
> On Mon, Jul 29, 2013 at 10:51 PM, Dan Williams  wrote:
>> On Mon, 2013-07-29 at 22:35 -0600, Jeff Sadowski wrote:
>>> Is there any way to have it launch maybe another script that can take
>>> as long as it needs?
>>> I thought putting the script in the background would allow it to run
>>> till finished but it is still getting killed.
>>
>> You might be able to get around it if you exec a second script; the
>> dispatcher only kills the PID that it originally spawned.
>>
>> Dan
>>
>>> On Mon, Jul 29, 2013 at 10:21 PM, Dan Williams  wrote:
>>> > On Mon, 2013-07-29 at 09:35 -0600, Jeff Sadowski wrote:
>>> >> I created a simple script to show my problem.
>>> >> <---start of /etc/NetworkManager/dispatcher.d/99-test script
>>> >> test()
>>> >> {
>>> >> x=0
>>> >> while [ ${x} -lt 25 ];do
>>> >> sleep 1
>>> >> echo ${x} > /tmp/test
>>> >> let x=${x}+1
>>> >> done
>>> >> }
>>> >> test &
>>> >> <--end of script
>>> >>
>>> >> the script gets killed after 8 seconds ie:
>>> >> >cat /tmp/test
>>> >> 8
>>> >> >
>>> >>
>>> >> I don't see any error messages in /var/log/message pertaining to it.
>>> >>
>>> >> Is there a way to get my script to not get killed?
>>> >> Maybe a way to externally call my script using dispatcher?
>>> >
>>> > Scripts actually get 3 seconds to complete.  They aren't currently
>>> > expected to run for long, especially on network disconnection, because
>>> > the network is already gone.  You can run the dispatcher with debug mode
>>> > like:
>>> >
>>> > /usr/libexec/nm-dispatcher.action --debug --persist
>>> >
>>> > The daemon currently doesn't block waiting on scripts, but there have
>>> > been discussions to make it do so.  Which would make this problem even
>>> > more acute, since network changes could block on long-running scripts.
>>> >
>>> > Dan
>>> >
>>
>>
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: NetworkManager-dispatcher killing my scripts

2013-07-30 Thread Jeff Sadowski
I tried having it recall itself as follows but it is still getting
killed now after 9 seconds.

updated script
<---start of /etc/NetworkManager/dispatcher.d/99-test script
#!/bin/bash
test()
{
 x=0
 while [ ${x} -lt 25 ];do
 sleep 1
 echo ${x} > /tmp/test
 let x=${x}+1
 done
}
if [ "$1" = "test" ];then
 test
else
 exec /bin/bash -c "$0 test" &
fi
<--end of script

On Mon, Jul 29, 2013 at 10:51 PM, Dan Williams  wrote:
> On Mon, 2013-07-29 at 22:35 -0600, Jeff Sadowski wrote:
>> Is there any way to have it launch maybe another script that can take
>> as long as it needs?
>> I thought putting the script in the background would allow it to run
>> till finished but it is still getting killed.
>
> You might be able to get around it if you exec a second script; the
> dispatcher only kills the PID that it originally spawned.
>
> Dan
>
>> On Mon, Jul 29, 2013 at 10:21 PM, Dan Williams  wrote:
>> > On Mon, 2013-07-29 at 09:35 -0600, Jeff Sadowski wrote:
>> >> I created a simple script to show my problem.
>> >> <---start of /etc/NetworkManager/dispatcher.d/99-test script
>> >> test()
>> >> {
>> >> x=0
>> >> while [ ${x} -lt 25 ];do
>> >> sleep 1
>> >> echo ${x} > /tmp/test
>> >> let x=${x}+1
>> >> done
>> >> }
>> >> test &
>> >> <--end of script
>> >>
>> >> the script gets killed after 8 seconds ie:
>> >> >cat /tmp/test
>> >> 8
>> >> >
>> >>
>> >> I don't see any error messages in /var/log/message pertaining to it.
>> >>
>> >> Is there a way to get my script to not get killed?
>> >> Maybe a way to externally call my script using dispatcher?
>> >
>> > Scripts actually get 3 seconds to complete.  They aren't currently
>> > expected to run for long, especially on network disconnection, because
>> > the network is already gone.  You can run the dispatcher with debug mode
>> > like:
>> >
>> > /usr/libexec/nm-dispatcher.action --debug --persist
>> >
>> > The daemon currently doesn't block waiting on scripts, but there have
>> > been discussions to make it do so.  Which would make this problem even
>> > more acute, since network changes could block on long-running scripts.
>> >
>> > Dan
>> >
>
>
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: NetworkManager-dispatcher killing my scripts

2013-07-29 Thread Dan Williams
On Mon, 2013-07-29 at 22:35 -0600, Jeff Sadowski wrote:
> Is there any way to have it launch maybe another script that can take
> as long as it needs?
> I thought putting the script in the background would allow it to run
> till finished but it is still getting killed.

You might be able to get around it if you exec a second script; the
dispatcher only kills the PID that it originally spawned.

Dan

> On Mon, Jul 29, 2013 at 10:21 PM, Dan Williams  wrote:
> > On Mon, 2013-07-29 at 09:35 -0600, Jeff Sadowski wrote:
> >> I created a simple script to show my problem.
> >> <---start of /etc/NetworkManager/dispatcher.d/99-test script
> >> test()
> >> {
> >> x=0
> >> while [ ${x} -lt 25 ];do
> >> sleep 1
> >> echo ${x} > /tmp/test
> >> let x=${x}+1
> >> done
> >> }
> >> test &
> >> <--end of script
> >>
> >> the script gets killed after 8 seconds ie:
> >> >cat /tmp/test
> >> 8
> >> >
> >>
> >> I don't see any error messages in /var/log/message pertaining to it.
> >>
> >> Is there a way to get my script to not get killed?
> >> Maybe a way to externally call my script using dispatcher?
> >
> > Scripts actually get 3 seconds to complete.  They aren't currently
> > expected to run for long, especially on network disconnection, because
> > the network is already gone.  You can run the dispatcher with debug mode
> > like:
> >
> > /usr/libexec/nm-dispatcher.action --debug --persist
> >
> > The daemon currently doesn't block waiting on scripts, but there have
> > been discussions to make it do so.  Which would make this problem even
> > more acute, since network changes could block on long-running scripts.
> >
> > Dan
> >


___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: NetworkManager-dispatcher killing my scripts

2013-07-29 Thread Jeff Sadowski
Is there any way to have it launch maybe another script that can take
as long as it needs?
I thought putting the script in the background would allow it to run
till finished but it is still getting killed.

On Mon, Jul 29, 2013 at 10:21 PM, Dan Williams  wrote:
> On Mon, 2013-07-29 at 09:35 -0600, Jeff Sadowski wrote:
>> I created a simple script to show my problem.
>> <---start of /etc/NetworkManager/dispatcher.d/99-test script
>> test()
>> {
>> x=0
>> while [ ${x} -lt 25 ];do
>> sleep 1
>> echo ${x} > /tmp/test
>> let x=${x}+1
>> done
>> }
>> test &
>> <--end of script
>>
>> the script gets killed after 8 seconds ie:
>> >cat /tmp/test
>> 8
>> >
>>
>> I don't see any error messages in /var/log/message pertaining to it.
>>
>> Is there a way to get my script to not get killed?
>> Maybe a way to externally call my script using dispatcher?
>
> Scripts actually get 3 seconds to complete.  They aren't currently
> expected to run for long, especially on network disconnection, because
> the network is already gone.  You can run the dispatcher with debug mode
> like:
>
> /usr/libexec/nm-dispatcher.action --debug --persist
>
> The daemon currently doesn't block waiting on scripts, but there have
> been discussions to make it do so.  Which would make this problem even
> more acute, since network changes could block on long-running scripts.
>
> Dan
>
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: NetworkManager-dispatcher killing my scripts

2013-07-29 Thread Dan Williams
On Mon, 2013-07-29 at 09:35 -0600, Jeff Sadowski wrote:
> I created a simple script to show my problem.
> <---start of /etc/NetworkManager/dispatcher.d/99-test script
> test()
> {
> x=0
> while [ ${x} -lt 25 ];do
> sleep 1
> echo ${x} > /tmp/test
> let x=${x}+1
> done
> }
> test &
> <--end of script
> 
> the script gets killed after 8 seconds ie:
> >cat /tmp/test
> 8
> >
> 
> I don't see any error messages in /var/log/message pertaining to it.
> 
> Is there a way to get my script to not get killed?
> Maybe a way to externally call my script using dispatcher?

Scripts actually get 3 seconds to complete.  They aren't currently
expected to run for long, especially on network disconnection, because
the network is already gone.  You can run the dispatcher with debug mode
like:

/usr/libexec/nm-dispatcher.action --debug --persist

The daemon currently doesn't block waiting on scripts, but there have
been discussions to make it do so.  Which would make this problem even
more acute, since network changes could block on long-running scripts.

Dan

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


NetworkManager-dispatcher killing my scripts

2013-07-29 Thread Jeff Sadowski
I created a simple script to show my problem.
<---start of /etc/NetworkManager/dispatcher.d/99-test script
test()
{
x=0
while [ ${x} -lt 25 ];do
sleep 1
echo ${x} > /tmp/test
let x=${x}+1
done
}
test &
<--end of script

the script gets killed after 8 seconds ie:
>cat /tmp/test
8
>

I don't see any error messages in /var/log/message pertaining to it.

Is there a way to get my script to not get killed?
Maybe a way to externally call my script using dispatcher?
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list