[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#614959: marked as done (libbsd: please implement setproctitle)



Your message dated Mon, 27 May 2013 04:33:45 +0000
with message-id <E1Ugp7x-0001us-SE@franck.debian.org>
and subject line Bug#614959: fixed in libbsd 0.5.0-1
has caused the Debian Bug report #614959,
regarding libbsd: please implement setproctitle
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
614959: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=614959
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: libbsd
Version: 0.2.0-1
Severity: wishlist
Tags: upstream

Hi,

In libbsd, we find:

 void
 setproctitle(const char *fmt, ...)
 {
	/* Stub so that we can implement it later on and programs will
	 * automatically benefit from it, w/o needing to recompile. */
 }

I would like to see a standard and clean implementation so Bug#24148
can be fixed more easily.  So here is a summary of existing practice.

Herbert mentioned sendmail, inn, and netstd as sample programs
implementing it.  I'd suggest grabbing the implementation from
postgresql, but maybe making it less portable and stripping out
some comments. ;-)

sendmail strategy
-----------------
setproctitle and an init function are defined in sendmail/conf.c.

Compile-time parameter: SPT_TYPE.  Possible values:

 SPT_REUSEARGV		overwrite command line at argv[0] [e.g. linux, kfreebsd]
			move environ out of the way to make room
			pad with null bytes
 SPT_BUILTIN		call setproctitle() from libc [newish bsd]
 SPT_PSTAT		call pstat() from libc [hpux]
 SPT_PSSTRINGS		set PS_STRINGS->ps_argvstr [4.4bsd, old mac os x]
 SPT_SYSMIPS		call sysmips() from libc [sony news]
 SPT_SCO		write to u-area structure in kernel memory [sco?]
 SPT_CHANGEARGV		assign pointer to argv[0] [hurd]

It's nicely documented in sendmail/README.

inn2 strategy
-------------
inn2 is under the ISC license.

setproctitle and setproctitle_init are defined in lib/setproctitle.c.
Supported configurations:

 - HAVE_PSTAT [hpux]
 - everyone else.

In the "everyone else" case, it simply overwrites the area from
&argv[0][0] to &argv[argc-1][strlen(argv[argc-1])].  The only trick is
to start with "- " as a way of prepending the program name.

rdist strategy
--------------
In rdist 7.0.0-alpha10, it has a 3-clause BSD-style license from
MagniComp and 4-clause BSD-style license from UCB.  Presumably the
latter falls under the scope of the grand license change, but
someone would have to check.

setargs_settup and setproctitle are defined in src/setargs.c.

It first makes room for a longer command line by copying environ
and then overwrites the area from &argv[0][0] to
&envp[envlen-1][strlen(envp[envlen-1])].  Nice and clean.

linux-ftpd strategy
-------------------
"Stolen from sendmail 8.7.4 and bashed around by David A. Holland"
Has a 4-clause BSD license from Allman and UCB.

Just like rdist's.  A little cleaner.

postgresql strategy
-------------------
Very simple license (halfway between ISC and BSD-style)

 PS_USE_SETPROCTITLE	call setproctitle() from libc [newish bsd]
 PS_USE_PSTAT		call pstat(PSTAT_SETCMD, ) [hpux]
 PS_USE_PS_STRINGS	assign PS_STRINGS->ps_argvstr = "str" [some bsd]
 PS_USE_CHANGE_ARGV	assign argv[0] = "str" [hurd, other bsd]
 PS_USE_CLOBBER_ARGV	write over argv and environment area [linux, most sysv-like]
 PS_USE_WIN32		... blah blah ...
 PS_USE_NONE

When clobbering at argv[0], uses null bytes for padding on Linux,
AIX, svr4, and Darwin, spaces elsewhere.

libiberty strategy
------------------
/* On Linux this sets the top visible "comm", but not necessarily
   the name visible in ps. */
prctl(PR_SET_NAME, "string");

python-setproctitle strategy
----------------------------
Like postgresql, but calls prctl like liberty on top of that.

Hope that helps,
Jonathan



--- End Message ---
--- Begin Message ---
Source: libbsd
Source-Version: 0.5.0-1

We believe that the bug you reported is fixed in the latest version of
libbsd, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 614959@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Guillem Jover <guillem@debian.org> (supplier of updated libbsd package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Mon, 27 May 2013 06:07:08 +0200
Source: libbsd
Binary: libbsd-dev libbsd0 libbsd0-udeb libbsd0-dbg
Architecture: source amd64
Version: 0.5.0-1
Distribution: unstable
Urgency: low
Maintainer: Debian GNU/kFreeBSD <debian-bsd@lists.debian.org>
Changed-By: Guillem Jover <guillem@debian.org>
Description: 
 libbsd-dev - utility functions from BSD systems - development files
 libbsd0    - utility functions from BSD systems - shared library
 libbsd0-dbg - utility functions from BSD systems - debugging symbols
 libbsd0-udeb - utility functions from BSD systems - shared library (udeb)
Closes: 614959 665997
Changes: 
 libbsd (0.5.0-1) unstable; urgency=low
 .
   * New upstream release.
     - Implement setproctitle(). (Closes: #614959)
     - Fix «make distclean» target to not remove distributed files.
   * Change watch file to also look for xz compressed upstream releases.
   * Fix two builds in a row by calling «make distclean» on clean.
   * Fix cross-building support by passing correct --build and --host options
     to configure. Based on patch by Colin Watson <cjwatson@ubuntu.com>.
     (Closes: #665997)
   * Move -e option from postinst's shebang to an explicit set call.
   * Switch to canonical Vcs URLs.
   * Switch source package to xz compression.
   * Switch to debhelper compatibility level 9.
   * Now using Standards-Version 3.9.4 (no changes needed).
Checksums-Sha1: 
 36a52f68821bcb504059b8b0d2b87ed6fa516132 1475 libbsd_0.5.0-1.dsc
 d2ce5d985d8ef27f7669970f6d7b102daaf4c6d3 306668 libbsd_0.5.0.orig.tar.xz
 08d227153dce737874852bbc8fec9b1310b1af3f 8704 libbsd_0.5.0-1.debian.tar.xz
 43ece878f456d463d856d013cd374c4c7c555385 153948 libbsd-dev_0.5.0-1_amd64.deb
 e7e17f8fee5a7c6996317b181677ffe5be62a9ee 64652 libbsd0_0.5.0-1_amd64.deb
 042a328d4770e1622a2a3c8f75185b1258ebf0b7 24714 libbsd0-udeb_0.5.0-1_amd64.udeb
 dd0634491bf2c998c131367c0c1ba7f6f542340a 101208 libbsd0-dbg_0.5.0-1_amd64.deb
Checksums-Sha256: 
 2daada9129643d03d3eb39f6b5ef6916991f5fe9e20866a61e3749f1939ab9e7 1475 libbsd_0.5.0-1.dsc
 1d2aaa5e14fd3bba9a74786ebbcf664b57346a01d47f83d82e7638d74d5626e4 306668 libbsd_0.5.0.orig.tar.xz
 b2eca529699d9e4768d1010a2e3f1bfcf568e8aeeb6fdd952bbc3eca511045f3 8704 libbsd_0.5.0-1.debian.tar.xz
 1b7e0eef807f3e865177f7dda05c8c24ec62bb3802fa7bbbc92aef8607a18f90 153948 libbsd-dev_0.5.0-1_amd64.deb
 dd9b0ff7f0202181a404b79358763cea10e189e7a38833c7bc9aea6009140a28 64652 libbsd0_0.5.0-1_amd64.deb
 72cf3326513df501fdf2fd312c51ee3dfc03f55eccf04c7656667bab47ff34e8 24714 libbsd0-udeb_0.5.0-1_amd64.udeb
 32fe259d6cb2b480d1df636eaa45cb4cc41c7212ced2eff7a1bf0f6d04d8d065 101208 libbsd0-dbg_0.5.0-1_amd64.deb
Files: 
 906e4276e2c3ed8e30bb68b6f4625cd0 1475 libs optional libbsd_0.5.0-1.dsc
 0c4527b79fc69036adc38a9b7520eb35 306668 libs optional libbsd_0.5.0.orig.tar.xz
 5d9f2f7f4dc98eb5b394c16ed21fa37a 8704 libs optional libbsd_0.5.0-1.debian.tar.xz
 dc1dec715ae339e7cd9883587d4ccba2 153948 libdevel optional libbsd-dev_0.5.0-1_amd64.deb
 a2007740ea7381771348ea4af4da4404 64652 libs optional libbsd0_0.5.0-1_amd64.deb
 5fd143e17bd8312aee53eb70f8f635dd 24714 debian-installer optional libbsd0-udeb_0.5.0-1_amd64.udeb
 f68121fb4416e313f61d197838de7a8f 101208 debug extra libbsd0-dbg_0.5.0-1_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlGi3dQACgkQuW9ciZ2SjJu56wCfW57I3cz+7FhYquJSzCqy72Zq
L70AoJRo8vTgqY8O41AgOhCTSwvOv+0O
=NQrR
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: