Package: ipmitool
Version: 1.8.19-9
Severity: normal
Tags: patch

Dear Maintainer,

the ipmievd daemon included in the ipmitool package may fail to clean up its
pidfile when failing to start, causing subsequent start-attempts to fail until
the pidfile is manually removed.

```
Oct 05 12:39:46 node23 systemd[1]: Starting ipmievd.service - IPMI event 
daemon...
Oct 05 12:39:46 node23 ipmievd[1056]: Get Device ID command failed: 0xc0 Node 
busy
Oct 05 12:39:46 node23 ipmievd[1056]: Get Device ID command failed: 0xc0 Node 
busy
Oct 05 12:39:46 node23 ipmievd[1106]: Reading sensors...
Oct 05 12:39:46 node23 ipmievd[1106]: Get Device ID command failed: 0xc0 Node 
busy
Oct 05 12:39:46 node23 ipmievd[1106]: Unable to open SDR for reading
Oct 05 12:39:46 node23 ipmievd[1106]: Get BMC Global Enables command failed: 
Node busy
Oct 05 12:39:46 node23 ipmievd[1106]: Could not enable event message buffer
Oct 05 12:39:46 node23 ipmievd[1106]: Error setting up Event Interface open
Oct 05 12:39:46 node23 systemd[1]: Started ipmievd.service - IPMI event daemon.
Oct 05 12:39:46 node23 systemd[1]: ipmievd.service: Main process exited, 
code=exited, status=1/FAILURE
Oct 05 12:39:46 node23 systemd[1]: ipmievd.service: Failed with result 
'exit-code'.

Oct 05 12:45:59 node23 systemd[1]: Starting ipmievd.service - IPMI event 
daemon...
Oct 05 12:45:59 node23 ipmievd[3563]: PID file '/run/ipmievd.pid0' already 
exists.
Oct 05 12:45:59 node23 ipmievd[3563]: Perhaps another instance is already 
running.
Oct 05 12:45:59 node23 systemd[1]: ipmievd.service: Control process exited, 
code=exited, status=1/FAILURE
Oct 05 12:45:59 node23 systemd[1]: ipmievd.service: Failed with result 
'exit-code'.
Oct 05 12:45:59 node23 systemd[1]: Failed to start ipmievd.service - IPMI event 
daemon.
```

For `Type=forking` service units like these, systemd.service(5) recommends to
specify the `PIDFile` option, which systemd will use to determine the main pid
of the service, and ensure the pidfile is removed when the service stops/fails.

The daemon dynamically creates the name of the pidfile. However the static
definition of the `ExecStart` option without a `-d` or `pidfile=` argument makes
the pidfile name practically staticly `/run/ipmievd.pid0`. The SysV script uses
`/var/run/ipmievd.pid0`, although it's unclear to me why the `/var/run` symlink
is used.

The fix for SysV would be a `rm -f $PIDFILE` in the `d_stop()` function, but
unlike the systemd service unit it reads `IPMIEVD_OPTIONS` from a file and
passes them as arguments to the daemon process, potentially causing the actual
pidfile to differ from the static value defined/used in the script.

Attached is a patch to add the `PIDFile` option to the systemd service unit.


-- System Information:
Debian Release: 13.7
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.111+deb13-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages ipmitool depends on:
ii  init-system-helpers  1.69~deb13u1
ii  libc6                2.41-12+deb13u4
ii  libfreeipmi17        1.6.15-1
ii  libreadline8t64      8.2-6
ii  libssl3t64           3.5.7-1~deb13u2

Versions of packages ipmitool recommends:
ii  openipmi  2.0.37-1

ipmitool suggests no packages.

-- no debconf information
--- a/debian/systemd/ipmitool.ipmievd.service   2026-09-30 00:43:19.920497627 
+0200
+++ b/debian/systemd/ipmitool.ipmievd.service   2026-09-30 00:02:43.420313133 
+0200
@@ -5,6 +5,7 @@
 [Service]
 Type=forking
 ExecStart=/usr/sbin/ipmievd open daemon
+PIDFile=/run/ipmievd.pid0

 [Install]
 WantedBy=multi-user.target

Reply via email to