unknown
1970-01-01 00:00:00 UTC
There is nothing in the commit message about changed "kill" behaviour.
And I don't think I understand nor like that change.
to be sure to kill the process group.
Agents may spawn childs, killing
the agent should cleanup those childs as well.
Why did you change that?
Did it not work?
Break something?
Thanks,
--
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com
DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
_______________________________________________________
Linux-HA-Dev: Linux-HA-***@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/
--=__PartE9D84A71.3__Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Content-Description: HTML
<html><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><META name="Author" content="Novell GroupWise WebAccess"></head><body style='font-family: Helvetica, Arial, sans-serif; font-size: 13px; '>Hi Lars,<br><br>Because I found setsid have a different behavior between interactive shell and non-interactive shell.<br><br>I show the command first:<br><br><pre class="bbcodeblock" dir="ltr" style="
margin: 0px;
margin-right: -99999px;
padding: 3px;
border: 1px inset;
width: 98%;
height: 210px;
text-align: left;
overflow: auto">***@linux-ub7v:~> setsid sleep 5 & echo "$! setsid"; sleep 1; ps -eo pid,args | grep sleep | grep -v grep
12498 setsid
12502 sleep 5
***@linux-ub7v:~> killall sleep
***@linux-ub7v:~> bash -c 'setsid sleep 5 & echo "$! setsid"; sleep 1; ps -eo pid,args | grep sleep | grep -v grep'
12507 setsid
12507 sleep 5
***@linux-ub7v:~> setsid --version
setsid from util-linux 2.21.2</pre><br>The first commands were executed by an interactive shell, we can see there are the different pid between setsid and sleep, <br>
but the third commands, I put them into a non-interactive shell, and
then, we can see there are the same pid of setsid and sleep.<br>
I guess setsid in first command may be "fork -> exec sleep by child
-> parent exit" and setsid in third command just do "exec sleep"
directly.<br>
If I am right, why does setsid have a different behavior between interactive shell and non-interactive shell ?<br><br>So I am not sure the setsid have a same behavior on each LINUXs, can you point me ?<br>Thanks in advance!<br><br>Best regards,<br>John<br><br>>>> Lars Ellenberg <***@linbit.com> 2013-1-21 下午 18:44 >>><br>On Sun, Jan 20, 2013 at 09:23:05AM -0700, John Shi wrote:<br>> Medium: tools: ocft: update to version 0.44<br>> <br>> Added "incremental" mode (ocft test -i) , cache results and<br>> not repeatedly rerun those cases which succeeded.<br>> <br>> Improved *ocft make*, the ocft will only make the updated test-case file.<br>> <br>> The ocft test prints the actual case names instead of just case numbers.<br>> <br>> <br><br>> >
And I don't think I understand nor like that change.
- setsid $aroot/$agent $cmd >/tmp/.ocft_runlog 2>&1 &
+ $aroot/$agent $cmd >/tmp/.ocft_runlog 2>&1 &
pid=$!
i=0
@@ -111,9 +111,9 @@ agent_run()
done
if [ $i -ge $timeout ]; then
- kill -SIGTERM -$pid >/dev/null 2>&1
+ kill -SIGTERM $pid >/dev/null 2>&1
sleep 3
- kill -SIGKILL -$pid >/dev/null 2>&1
+ kill -SIGKILL $pid >/dev/null 2>&1
The setsid and "kill -SIG -$pid" was intentional,+ $aroot/$agent $cmd >/tmp/.ocft_runlog 2>&1 &
pid=$!
i=0
@@ -111,9 +111,9 @@ agent_run()
done
if [ $i -ge $timeout ]; then
- kill -SIGTERM -$pid >/dev/null 2>&1
+ kill -SIGTERM $pid >/dev/null 2>&1
sleep 3
- kill -SIGKILL -$pid >/dev/null 2>&1
+ kill -SIGKILL $pid >/dev/null 2>&1
to be sure to kill the process group.
Agents may spawn childs, killing
the agent should cleanup those childs as well.
Why did you change that?
Did it not work?
Break something?
Thanks,
--
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com
DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
_______________________________________________________
Linux-HA-Dev: Linux-HA-***@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/
--=__PartE9D84A71.3__Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Content-Description: HTML
<html><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><META name="Author" content="Novell GroupWise WebAccess"></head><body style='font-family: Helvetica, Arial, sans-serif; font-size: 13px; '>Hi Lars,<br><br>Because I found setsid have a different behavior between interactive shell and non-interactive shell.<br><br>I show the command first:<br><br><pre class="bbcodeblock" dir="ltr" style="
margin: 0px;
margin-right: -99999px;
padding: 3px;
border: 1px inset;
width: 98%;
height: 210px;
text-align: left;
overflow: auto">***@linux-ub7v:~> setsid sleep 5 & echo "$! setsid"; sleep 1; ps -eo pid,args | grep sleep | grep -v grep
12498 setsid
12502 sleep 5
***@linux-ub7v:~> killall sleep
***@linux-ub7v:~> bash -c 'setsid sleep 5 & echo "$! setsid"; sleep 1; ps -eo pid,args | grep sleep | grep -v grep'
12507 setsid
12507 sleep 5
***@linux-ub7v:~> setsid --version
setsid from util-linux 2.21.2</pre><br>The first commands were executed by an interactive shell, we can see there are the different pid between setsid and sleep, <br>
but the third commands, I put them into a non-interactive shell, and
then, we can see there are the same pid of setsid and sleep.<br>
I guess setsid in first command may be "fork -> exec sleep by child
-> parent exit" and setsid in third command just do "exec sleep"
directly.<br>
If I am right, why does setsid have a different behavior between interactive shell and non-interactive shell ?<br><br>So I am not sure the setsid have a same behavior on each LINUXs, can you point me ?<br>Thanks in advance!<br><br>Best regards,<br>John<br><br>>>> Lars Ellenberg <***@linbit.com> 2013-1-21 下午 18:44 >>><br>On Sun, Jan 20, 2013 at 09:23:05AM -0700, John Shi wrote:<br>> Medium: tools: ocft: update to version 0.44<br>> <br>> Added "incremental" mode (ocft test -i) , cache results and<br>> not repeatedly rerun those cases which succeeded.<br>> <br>> Improved *ocft make*, the ocft will only make the updated test-case file.<br>> <br>> The ocft test prints the actual case names instead of just case numbers.<br>> <br>> <br><br>> >