Package: psmisc
Version: 23.6-1
Severity: normal

killall --older-than 30s restartx11vnc x11vnc vncserver x0tigervncserver 
websockify

doesn't kill any processes inside my container, whereas it always used
to work on a VM and on hardware.  Removing '--older-than 30s' kills
all such processes.  I strongly suspect the culprit is how
/proc/$pid/stat is interpreted:

--older-than case:

3921851 openat(AT_FDCWD, "/proc/3918880", O_RDONLY|O_DIRECTORY) = 3
3921851 openat(3, "stat", O_RDONLY)     = 4
3921851 fcntl(4, F_GETFL)               = 0x8000 (flags O_RDONLY|O_LARGEFILE)
3921851 newfstatat(4, "", {st_mode=S_IFREG|0444, st_size=0, ...}, 
AT_EMPTY_PATH) = 0
3921851 read(4, "3918880 (x11vnc) S 3918875 39184"..., 1024) = 336
3921851 close(4)                        = 0
3921851 openat(AT_FDCWD, "/proc/uptime", O_RDONLY) = 4
3921851 newfstatat(4, "", {st_mode=S_IFREG|0444, st_size=23, ...}, 
AT_EMPTY_PATH) = 0
3921851 read(4, "82599.37 82599.37\n", 4096) = 18
3921851 close(4)                        = 0
3921851 close(3)                        = 0

no such flag:

3960244 openat(AT_FDCWD, "/proc/3918880", O_RDONLY|O_DIRECTORY) = 3
3960244 openat(3, "stat", O_RDONLY)     = 4
3960244 fcntl(4, F_GETFL)               = 0x8000 (flags O_RDONLY|O_LARGEFILE)
3960244 newfstatat(4, "", {st_mode=S_IFREG|0444, st_size=0, ...}, 
AT_EMPTY_PATH) = 0
3960244 read(4, "3918880 (x11vnc) S 1 3918464 366"..., 1024) = 332
3960244 close(4)                        = 0
3960244 pidfd_send_signal(3, SIGTERM, NULL, 0) = 0
3960244 close(3)                        = 0


I'm guessing it's looking at field 22 starttime in /proc/$pid/stat?
starttime is seconds since boot.  Since the process exists in the
parent system as well, starttime will surely be seconds since host
boot?  But /proc/uptime is seconds since container boot.



-- System Information:
Debian Release: 12.5
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
'stable'), (5, 'testing'), (2, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.5.0-0.deb12.4-amd64 (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages psmisc depends on:
ii  libc6      2.36-9+deb12u4
ii  libtinfo6  6.4-4

psmisc recommends no packages.

psmisc suggests no packages.

-- no debconf information

Reply via email to