The following commit has been merged in the master branch:
commit bfda32490d1ff730322636c97a4ce4d65bbd69c5
Author: Guillem Jover <[email protected]>
Date: Thu May 21 06:02:17 2009 +0200
s-s-d: Warn if --name argument is longer than supported by kernel
Most kernels have a length limit on the process name stored in-kernel.
For now the checks done on Linux compatible procfs might hit this limit
and be unable to properly track the correct process. So warn in that
case and recommend switching to the more reliable --exec.
Closes: #353015, #519128
diff --git a/debian/changelog b/debian/changelog
index 94506f6..c0782c0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -133,6 +133,8 @@ dpkg (1.15.1) UNRELEASED; urgency=low
* Make deprecated dpkg-scanpackages --udeb option produce a warning.
* Change dpkg-source --help output to state there's no default substvar
file to match reality.
+ * Warn in start-stop-daemon if the argument to --name is longer than the
+ supported kernel process name size. Closes: #353015, #519128
[ Frank Lichtenheld ]
* Dpkg::Version: Remove unnecessary function next_elem which just
diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c
index b34d171..9f87ed3 100644
--- a/utils/start-stop-daemon.c
+++ b/utils/start-stop-daemon.c
@@ -115,6 +115,11 @@
#include <sys/syscall.h>
#endif
+#if defined(OSLinux)
+/* This comes from TASK_COMM_LEN defined in linux's include/linux/sched.h. */
+#define PROCESS_NAME_SIZE 15
+#endif
+
#if defined(SYS_ioprio_set) && defined(linux)
#define HAVE_IOPRIO_SET
#endif
@@ -842,6 +847,13 @@ parse_options(int argc, char * const *argv)
if (!execname && !pidfile && !userspec && !cmdname)
badusage("need at least one of --exec, --pidfile, --user or
--name");
+#ifdef PROCESS_NAME_SIZE
+ if (cmdname && strlen(cmdname) > PROCESS_NAME_SIZE)
+ warning("this system is not able to track process names\n"
+ "longer than %d characters, please use --exec "
+ "instead of --name.\n", PROCESS_NAME_SIZE);
+#endif
+
if (!startas)
startas = execname;
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]