On Fri, 2011-12-16 at 11:15 +0100, Raphael Hertzog wrote:
> Hi,
>
> On Thu, 15 Dec 2011, Henrique de Moraes Holschuh wrote:
> > > <503 pcew80@reincke:~> ps -aef | grep amavis
> > > amavis 2299 1 0 00:47 ? 00:00:01 amavisd (master)
> > > amavis 2496 2299 0 00:47 ? 00:00:00 amavisd (ch7-avail)
> > > amavis 2497 2299 0 00:47 ? 00:00:00 amavisd (ch7-avail)
> > > amavis 2498 2299 0 00:47 ? 00:00:00 amavisd (ch6-avail)
> > > reincke 7749 7078 0 08:32 pts/1 00:00:00 grep amavis
> > >
> > > <504 pcew80@reincke:~> cat /proc/2299/stat
> > > 2299 (amavisd (master) S 1 2299 2299 0 -1 4202560 9771 0 4 0 119 5 0
> > > 0 20 0 1 0 22660083 221208576 22204 18446744073709551615 1 1 0 0 0 0
> > > 0 4224 81927 18446744073709551615 0 0 17 2 0 0 7 0 0
> >
> > Crap. The kernel has done us in. Reassigning to dpkg to get some input on
> > what should be done. Raising severity because it will cause some services
> > to not be stopped or restarted properly, which has security implications.
> >
> > Guys, 3.1 changes /proc/<pid>/stat, and breaks anything using
> > start-stop-daemon --name that also messes with the name of the process. Due
> > to the chage in /proc/<pid>/stat, the executable name is not matched
> > anymore.
>
> What are those changes exactly?
[...]
Whatever they are, they're not in the kernel.
It is possible to change command names stored by the kernel, by writing
to /proc/<pid>/tasks/<tid>/comm or by calling prctl(PR_SET_NAME, ...)
within the process. A quick grep doesn't show amavis using those
explicitly; it just sets $0.
Sure enough, this is a documented change in Perl 5.14:
Assignment to $0 sets the legacy process name with prctl() on
Linux
On Linux the legacy process name is now set with prctl(2), in
addition to altering the POSIX name via argv[0], as Perl has
done since version 4.000. Now system utilities that read the
legacy process name such as ps, top, and killall recognize the
name you set when assigning to $0. The string you supply is
truncated at 16 bytes; this limitation is imposed by Linux.
Ben.
--
Ben Hutchings
Computers are not intelligent. They only think they are.
Attachment:
signature.asc
Description: This is a digitally signed message part