Re: Origin of /var/run contents
- Date: Tue, 27 Feb 2018 12:13:20 -0500
- From: Gene Heskett <gheskett@xxxxxxxxxxx>
- Subject: Re: Origin of /var/run contents
On Tuesday 27 February 2018 06:45:36 Sven Hartge wrote:
> Dave Sherohman <dave@xxxxxxxxxxxxx> wrote:
> > I've just made my first foray into creating systemd service files,
> > and, although I got them to work with manual startup, they failed
> > miserably on reboot. A short investigation revealed that this is
> > because /var/run is not persistent across reboots. (It's a link to
> > /run, which is a tmpfs mount.)
> > The service file runs a shell script which starts the actual daemon
> > (a starman server). The script runs as an unprivileged user, since
> > we don't want starman running as root. However, /run is only
> > writable by root, so starman can't create its pidfile.
> You need a config file in /etc/tmpfiles.d to setup a directory with
> the correct permissions below /run. (Or, if the software is packaged,
> in /usr/lib/tmpfiles.d/).
Just curious Sven. Why was this not supplied as a manpage or something,
as far back as wheezy?
I could fix the perms on /var, and restart everything that failed, and it
would be fine until the next reboot, which reset the perms so /var was
only writable as root. Didn't anyone think of the stuff that runs as a
user? Fetchmail/procmail/nut and heyu are all killed by that, so I
edited the configs to put their logfiles in ~/me/log. Works a treat
after also fixing logrotate to access them there. My thoughts on the
geniuses that decreed that aren't generally printable.
Cheers, Gene Heskett
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>