Package: cachefilesd
Version: 0.10.10-0.4
Severity: normal
Tags: patch
cachefilesd ships only a SysV init script (/etc/init.d/cachefilesd).
When systemd-sysv-generator wraps this script, the resulting unit has
Type=forking semantics inferred from the LSB headers, but the generator
cannot reliably track the daemon's PID after it forks. In practice
systemd reports the service as "active (exited)" once the init script
returns, and never notices if the daemon subsequently crashes.
This means:
- No automatic restart on crash (daemon silently disappears)
- systemctl status shows "active (exited)" for a dead process
- No stdout/stderr captured in the journal (daemon logs to syslog
only if configured, and the default is silent)
- A stale /var/run/cachefilesd.pid is left behind
cachefilesd supports -n (foreground / no-daemonize) mode, which makes
it trivial to manage under systemd with proper lifecycle tracking.
Suggested native unit file:
--- /etc/systemd/system/cachefilesd.service ---
[Unit]
Description=CacheFiles backend cache manager
After=local-fs.target
Before=remote-fs.target
[Service]
Type=simple
ExecStartPre=/sbin/modprobe cachefiles
ExecStart=/sbin/cachefilesd -n -f /etc/cachefilesd.conf
Restart=on-failure
RestartSec=5
TimeoutStopSec=30
StandardOutput=journal
StandardError=journal
SyslogIdentifier=cachefilesd
[Install]
WantedBy=multi-user.target
---
With this unit:
- systemd tracks the actual process (MainPID correct)
- Restart=on-failure recovers from crashes automatically
- Daemon output appears in journalctl -u cachefilesd
- No PID file needed
The init.d script can be retained for non-systemd systems, but the
package should ship and prefer the native unit when systemd is the
init system (via dh_installsystemd or equivalent).
Steps to reproduce:
1. Install cachefilesd, enable and start it
2. Kill the daemon: kill $(pidof cachefilesd)
3. Observe: systemctl status cachefilesd still shows "active (exited)"
4. The daemon is gone, no restart occurs, no log entry is produced