trafficserver unit will not start with /var/run/trafficserver default runtimedir
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
trafficserver (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
With no modification, attempting to start the service through systemd produces a fatal error.
journalctl -xeu trafficserver.
> traffic_cop[5972]: unable to locate local state directory '/var/run/
Attempting to resolve this issue through custom systemd unit with RuntimeDirectory option results in another fatal error due to insufficient permissions (a symptom of configuration, not the root cause).
/etc/systemd/
> [Service]
> RuntimeDirector
journalctl -xeu trafficserver.
> traffic_
The resolution is to be able to create this directory with the expected write permission for trafficserver, or more preferrably override it in the environment defaults for the unit in /etc/defaults/
It's perhaps better to use tmpfiles.d for this, but I like being able to clean up the process directory on exit (especially in /run), so I've come up with a systemd solution.
This can either go in the /lib/systemd/
Additionally, this solution requires that you have the 'install' program on your system.
The actual paths will most likely depend on your system.
/etc/systemd/
> [Service]
> ExecStartPre=
> ExecStop=/bin/rm -r /run/trafficserver
I'm providing this as my resolution to this issue. I haven't seen this fix anywhere else short of creating a boot-time tmpfile.d directory or manually creating a permanent directory. Hopefully this helps!
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: trafficserver 7.1.2+ds-3
ProcVersionSign
Uname: Linux 4.15.0-184-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.28
Architecture: amd64
Date: Mon Jun 13 11:53:29 2022
InstallationDate: Installed on 2022-03-10 (94 days ago)
InstallationMedia: Ubuntu-Server 18.04.6 LTS "Bionic Beaver" - Release amd64 (20210915)
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/zsh
SourcePackage: trafficserver
UpgradeStatus: No upgrade log present (probably fresh install)
modified.
modified.
modified.
modified.
modified.
mtime.conffile.
mtime.conffile.
mtime.conffile.
mtime.conffile.
mtime.conffile.
Updated Proposed solution, changed ExecStopPost to ExecStop in order to avoid systemctl restart causing directory removal.