Skip to content

Commit

Permalink
systemd: use runstatedir
Browse files Browse the repository at this point in the history
On newer versions of systemd, there is an expectation that `/run` is
used instead of `/var/run`.  The current service file template can
result in the following error message in the service:

```
systemd[1]: /lib/systemd/system/usbmuxd.service:7: PIDFile= references a path below legacy directory /var/run/, updating /var/run/usbmuxd.pid → /run/usbmuxd.pid; please update the unit file accordingly.
```

Prefer the `@runstatedir@` over `@localstatedir/run@` pattern as
suggested by [1].

[1]: https://www.gnu.org/prep/standards/html_node/Directory-Variables.html

Signed-off-by: Patrick Williams <[email protected]>
  • Loading branch information
williamspatrick authored and nikias committed Sep 18, 2023
1 parent 56f013b commit 2707534
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion systemd/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
edit = \
$(SED) -r \
-e 's|@sbindir[@]|$(sbindir)|g' \
-e 's|@localstatedir[@]|$(localstatedir)|g' \
-e 's|@runstatedir[@]|$(runstatedir)|g' \
< $< > $@ || rm $@

if WANT_SYSTEMD
Expand Down
2 changes: 1 addition & 1 deletion systemd/usbmuxd.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Documentation=man:usbmuxd(8)

[Service]
ExecStart=@sbindir@/usbmuxd --user usbmux --systemd
PIDFile=@localstatedir@/run/usbmuxd.pid
PIDFile=@runstatedir@/usbmuxd.pid

0 comments on commit 2707534

Please sign in to comment.