B
Brandon Metcalf
I'm seeing a behavior with using "kill 0,$pid" to determine if a
process is running that I didn't expect. It seems that only root can
correctly get the status on processes that root or another user that
is different from the one calling kill() owns. For example,
$ whoami
bmetcalf
$ ps -ef|grep gdm
root 965 1 0 Jul19 ? 00:00:00 /usr/bin/gdm
root 978 965 0 Jul19 ? 00:00:00 /usr/bin/gdm
root 979 978 0 Jul19 ? 00:37:20 /usr/X11R6/bin/X :0 -deferglyphs 16 -nolisten tcp -audit 0 -auth /var/lib/gdm/:0.Xauth -nolisten tcp vt7
bmetcalf 24443 23845 0 09:19 pts/5 00:00:00 grep gdm
$ perl -le '$a = kill 0,965;print $a'
0
$ su
Password:
# perl -le '$a = kill 0,965;print $a'
1
Is this the expected behavior? I'm sure it is since every platform
and version of Perl I've tried behave the same way.
process is running that I didn't expect. It seems that only root can
correctly get the status on processes that root or another user that
is different from the one calling kill() owns. For example,
$ whoami
bmetcalf
$ ps -ef|grep gdm
root 965 1 0 Jul19 ? 00:00:00 /usr/bin/gdm
root 978 965 0 Jul19 ? 00:00:00 /usr/bin/gdm
root 979 978 0 Jul19 ? 00:37:20 /usr/X11R6/bin/X :0 -deferglyphs 16 -nolisten tcp -audit 0 -auth /var/lib/gdm/:0.Xauth -nolisten tcp vt7
bmetcalf 24443 23845 0 09:19 pts/5 00:00:00 grep gdm
$ perl -le '$a = kill 0,965;print $a'
0
$ su
Password:
# perl -le '$a = kill 0,965;print $a'
1
Is this the expected behavior? I'm sure it is since every platform
and version of Perl I've tried behave the same way.