Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 332397 - sys-apps/openrc-0.6.1-r1 should create directories in /var/run for pidfiles
Summary: sys-apps/openrc-0.6.1-r1 should create directories in /var/run for pidfiles
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-12 08:29 UTC by Xake
Modified: 2010-08-12 14:03 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.