:: Re: [DNG] Creating directory in /va…
Top Page
Delete this message
Reply to this message
Author: Didier Kryn
Date:  
To: dng
Subject: Re: [DNG] Creating directory in /var/run on bootup
Le 05/02/2019 à 11:34, karl@??? a écrit :
> Tom:
> ...
>> What is the recommended alternative way to create a sub-directory of
>> /var/run on bootup for non-daemon software?
> Don't know about "recommended", but you can
>
> . prepend your cron script like (or have a wrapper):
>
>    if [ ! -d / ]; then mkdir -p /var/run/barman; fi
>    <rest of cron script>

>
> . in the crontab have a boot entry:
>
>    @reboot <script like above to setup /var/run/barman>



    The first solution seems the best to me because it concentrates all
the customization in one place, but, for completeness, an alternative to
the second solution is to add the line 'mkdir /var/run/barman' in
/etc/rc.local .

    Maybe you should also set the owner, group and permissions of this
directory in the same time.


>
> . check which init.d script which sets up /var/run and which starts
>    cron, and add a script that starts somewhere between thoose two that
>    sets up /var/run/barman

>


    AFAIK, /var/run is created during the initramfs phase. Even if it
wasn't the case, this solution is a hack in a system file, therefore
much more intrusive than the others.

        Didier