Re: [DNG] Creating directory in /var/run on bootup

2019-02-12 Thread Tom via Dng


> On 6 Feb 2019, at 17:57, Steve Litt  wrote:
> 
> Or, you could use this as an opportunity to stick your toes in the
> water of runit or s6, by running runit or s6 from /etc/inittab's
> special respawn area, and then making a s6 or runit service that makes
> the directory, and then does a forever one minute loop-sleep that
> spawns your program. Maybe more work than Cron, but it's your easiest
> way into supervisor programs.
> 

I’m not likely to take this plunge on an existing production server, but I 
would love to learn more about it at some point.  I will try to review the 
presentation video on s6 from the upcoming d1conf (hopefully there will be a 
recorded session on s6?? :D).

I notice there is a s6 package inside Debian archives for buster and unstable, 
but no other packages.  Does this mean that s6 doesn’t need the extra packages 
like runit has with runit-sysv and runic-init?  Or does s6 not provide all the 
features that runit provides?

—Tom
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Creating directory in /var/run on bootup

2019-02-12 Thread Tom via Dng


> On 6 Feb 2019, at 03:03, Didier Kryn  wrote:
> 
> 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.
> 

Thanks for all the responses.  I decided to use /etc/rc.local because it also 
needs to set the owner:group permissions after creating the directory.

I wanted to avoid touching the /etc/cron.d/barman file because that is provided 
by the barman package itself.  Minimal customisation of package-provided files 
is preferable to me if possible, so there’s less to manage on package updates 
that may want to overwrite any custom changes.  It’s also preferable to have 
this running once on each bootup instead of running every minute with the 
cronjob.

—Tom
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Creating directory in /var/run on bootup

2019-02-05 Thread Steve Litt
On Tue, 5 Feb 2019 10:52:24 +1100
wirelessduck--- via Dng  wrote:

> I'm running the barman backup software for PostgreSQL and the
> documentation says I should configure the lockfile directory to be on
> a volatile partition like /var/run/barman.
> 
> Since this software runs every minute via cron instead of having a
> daemon process, there is no service script in /etc/init.d/ that I can
> use to create the /var/run/barman directory.
> 
> What is the recommended alternative way to create a sub-directory of
> /var/run on bootup for non-daemon software?

Or, you could use this as an opportunity to stick your toes in the
water of runit or s6, by running runit or s6 from /etc/inittab's
special respawn area, and then making a s6 or runit service that makes
the directory, and then does a forever one minute loop-sleep that
spawns your program. Maybe more work than Cron, but it's your easiest
way into supervisor programs.

SteveT

Steve Litt 
January 2019 featured book: Troubleshooting: Just the Facts
http://www.troubleshooters.com/tjust
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Creating directory in /var/run on bootup

2019-02-05 Thread Harald Arnesen via Dng
Rowland Penny via Dng [05/02/2019 21.59]:

>>   I think you meant to write:
>> 
>> if [ ! -d /var/run/barman ]; then mkdir -p /var/run/barman; fi
>> 
> 
> even better:
> 
> [[ -d /var/run/barman ]] || mkdir -p /var/run/barman

Or even simpler:

mkdir -p /var/run/barman

If the directory or any of its parents does not exist, it is created.
Otherwise, the command just returns without any output.
-- 
Hilsen Harald

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Creating directory in /var/run on bootup

2019-02-05 Thread Rowland Penny via Dng
On Tue, 5 Feb 2019 21:31:46 +0100
Alessandro Selli  wrote:

> On 05/02/19 at 11:34, k...@aspodata.se wrote:
> > 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
> >   
> 
> 
>   I think you meant to write:
> 
> if [ ! -d /var/run/barman ]; then mkdir -p /var/run/barman; fi
> 

even better:

[[ -d /var/run/barman ]] || mkdir -p /var/run/barman

Rowland

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Creating directory in /var/run on bootup

2019-02-05 Thread Alessandro Selli
On 05/02/19 at 11:34, k...@aspodata.se wrote:
> 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
>   


  I think you meant to write:

if [ ! -d /var/run/barman ]; then mkdir -p /var/run/barman; fi


[...]


> . 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


  I would prefer such a solution,  as it would take away the check for
the presence of /var/run/barman every darn minute.

/etc/rc.local would be a place I'd think to put the directory creation,
too, as it's unlikely that a minute passes between cron startup and it's
execution.  But putting an ad hoc script is the best thing.



-- 
Alessandro Selli 
VOIP SIP: dhatarat...@ekiga.net
Chiave firma e cifratura PGP/GPG signing and encoding key:
  BA651E4050DDFC31E17384BABCE7BD1A1B0DF2AE




signature.asc
Description: OpenPGP digital signature
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Creating directory in /var/run on bootup

2019-02-05 Thread Didier Kryn

Le 05/02/2019 à 11:34, k...@aspodata.se 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
   

. in the crontab have a boot entry:

   @reboot 

Re: [DNG] Creating directory in /var/run on bootup

2019-02-05 Thread karl
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
  

. in the crontab have a boot entry:

  @reboot 

[DNG] Creating directory in /var/run on bootup

2019-02-04 Thread wirelessduck--- via Dng
I'm running the barman backup software for PostgreSQL and the
documentation says I should configure the lockfile directory to be on
a volatile partition like /var/run/barman.

Since this software runs every minute via cron instead of having a
daemon process, there is no service script in /etc/init.d/ that I can
use to create the /var/run/barman directory.

What is the recommended alternative way to create a sub-directory of
/var/run on bootup for non-daemon software?

--Tom
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng