[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Fwd: Bug#344758: init.d script should create /var/run/dirmngr



The submitter of #344758 wrote:
> The script should create /var/run/dirmngr to allow users to map their
> /var/run to a temporary filesystem like tmpfs. Thanks.

Peter Eisentraut wrote:
> What do you think about this request?  It seems reasonable, but I think if 
> this should be supported, there ought to be a general policy (formal or 
> informal) on it because I think many other init scripts will suffer from 
> similar problems.


A program that needs to put files into a subdirectory of /var/run/ should
create the required subdirectory itself at run time.  This can be done by
an initscript or by the program itself if it runs as root.  Remember ownership
and permissions.

    [ ! -d /var/run/foo ] && mkdir --mode=755 /var/run/foo && chown foouser:foogroup /var/run/foo

Do this no sooner than /etc/rcS.d/S47 and no later than when the dir is needed.  :)

As pointed out by Peter Samuelson, this dir should be removed by the postrm on
purge.  I would advise not including /var/run/foo in the package since it is
superfluous and its presence could hide a bug in your directory-creation code.
-- 
Thomas Hood



Reply to: