On 2013/06/15 14:22, Ryan Freeman wrote: > I've been running this for YEARS the crappy way (src in ~/src/, built > manually etc). Time for a real port! > > from the DESCR: > uptimed keeps track of your uptime records, viewable with the included > uprecords program. > > I hope the rc file is correct enough, I don't believe would ever > be a reason for uptimed to reload, its either started or stopped. > > I added a note in a pkg-readme about the fact that it unfortunately > does not have a way to drop down to running as another user...
Can't it just use a subdirectory of /var/run for the pid file and set permissions appropriately for the directories it needs to write to? See e.g. smokeping's rc script to see how to create the /var/run subdir. You can use daemon_user to set the username to run as. /var/spool doesn't seem a great fit for the purpose of this file, might it be better to use /var/db/uptimed? from the plist, | @bin sbin/uptimed | @mode this @mode isn't doing anything | share/doc/pkg-readmes/${FULLPKGNAME} | @rcscript ${RCDIR}/uptimed the common place for rc scripts is right at the end of the file | @mode 750 | @sample /var/spool/uptimed/ this needs an @extra or @extraunexec to remove files inside this directory; this should go *before* the @sample line as they're processed in order. (this is for pkg_delete -c).