Package: psmisc
Version: 23.5-2
Severity: important
Tags: upstream
Dear Maintainer,
*** Reporter, please consider answering these questions, where appropriate ***
* What led up to the situation?
* What exactly did you do (or not do) that was effective (or
ineffective)?
* What was the outcome of this action?
* What outcome did you expect instead?
*** End of the template - remove these template lines ***
killall hasn't been working on my old server (uptime 318 days) for
a while now, so I tracked it down. The problem is that the code
nowadays dirctly does a syscall of pidfd_send_signal, which is not
available in the older kernel (4.15.17) on the server.
The solution is to Not Do That Then. Calling a libc function would take
care of old kernel blemishes.
I just commented out the code, it falls through to kill from libc
so that's OK:
static int
my_send_signal(
const int pidfd,
const pid_t pid,
const int sig)
{
-#ifdef __NR_pidfd_send_signal
- if (pid > 0) /* Not PGID */
- return syscall(__NR_pidfd_send_signal, pidfd, sig, NULL, 0);
-#endif
+//#ifdef __NR_pidfd_send_signal
+// if (pid > 0) /* Not PGID */
+// return syscall(__NR_pidfd_send_signal, pidfd, sig, NULL, 0);
+//#endif
return kill(pid, sig);
}
Obviously that patch is not right, but I didn't care. The right
thing to do is NOT depend on defined __NR_pidfd_send_signal which tells
us that the kernel header installation knows about that syscall, but
says nothing about whether the platform kernel does or not. Probably
just try the syscall and if you get ENOSYS then try the kill instead.
Like this:
#ifdef __NR_pidfd_send_signal
if (pid > 0) /* Not PGID */ {
int ret = syscall(__NR_pidfd_send_signal, pidfd, sig, NULL, 0);
if (ret >= 0 || errno != ENOSYS)
return ret;
// fallthru if erred with no such syscall in kernel
}
#endif
return kill(pid, sig);
-- System Information:
Debian Release: bookworm/sid
Architecture: i386 (i686)
Kernel: Linux 4.15.17-roxy (PREEMPT)
Kernel taint flags: TAINT_CPU_OUT_OF_SPEC
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C),
LANGUAGE=en_GB:en
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
Versions of packages psmisc depends on:
ii libc6 2.33-8
ii libtinfo6 6.3+20220423-2
psmisc recommends no packages.
psmisc suggests no packages.
-- no debconf information