Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 332397

Summary: sys-apps/openrc-0.6.1-r1 should create directories in /var/run for pidfiles
Product: Gentoo Linux Reporter: Xake <kanelxake>
Component: [OLD] baselayoutAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED INVALID    
Severity: enhancement CC: eras
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Xake 2010-08-12 08:29:02 UTC
I have for various reasons /var/run mounted as tmpfs and when I today tried to figure out why vnstatd did not start it turned out to be because of a pidfile problem.

As it seems the ebuild for vnstatd creates /var/run/vnstatd and chown it to vnstat:vnstat. Then start-stop-daemon starts vnstatd creating and placing a vnstatd.pid in that directory with chuid vnstat:vnstat.
This works fine as long as /var/run is an permanent filesystem.
However if /var/run is mounted tmpfs the directory gets wiped evey reboot resulting in /var/run/vnstatd being non-existing on the next reboot.

I propose that if start-stop-daemon is started with the following:

start-stop-daemon --pidfile /var/run/<directory>/<pidfile>.pid --chuid <user>:<group>

then start-stop-daemon should create the path "/var/run/<directory>" and chown it to "<user>:<group>" if it does not already exist.
Comment 1 Eray Aslan gentoo-dev 2010-08-12 13:41:19 UTC
This is usually the job for the init script. It should either make sure that the directory under /var/run exists or it should write the PID file under /var/run directly.
Comment 2 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-08-12 14:03:53 UTC
It is completely legal for /var/run to be cleared upon system boot.

http://www.pathname.com/fhs/pub/fhs-2.3.html#VARRUNRUNTIMEVARIABLEDATA

For that, I am closing this bug, you can (and should) file a bug report for vnstatd. As Eray stated, vnstatd should create its own directory or just use /var/run/ directly. Thanks.