/var/log im tmpfs - automatisch Unterverzeichnisse anlegen

Ralph Meyer ralph at schosemail.de
Sun Feb 4 12:19:54 CET 2018


Hi,

ich hab da schonmal drauf geantwortet. Vielleicht kommt die Nachricht ja jetzt durch. 
Das gehört in die tmp.files.d von systend. Nur so als Anregung. 

Ralph
________________________________
Von: Florian Lohoff <f at zz.de>
Gesendet: Sonntag, 4. Februar 2018 12:15
An: Stefan U. Hegner
Cc: Linux Usergroup OWL
Betreff: Re: /var/log im tmpfs - automatisch Unterverzeichnisse anlegen

On Thu, Feb 01, 2018 at 10:24:44PM +0100, Stefan U. Hegner wrote:
> Moin Flo
> Aber kann ich das direkt in der
> 
>     /lib/systemd/system/nginx.service
> 
> unterbringen?

So hätte ich das gemacht

>     # Create log directory if not available
>     if [ -d /var/log/nginx ]; then
>             echo "nginx logdir already exists.";
>     else
>             mkdir /var/log/nginx;
>     fi;

mkdir -f /var/log/nginx

erzeugt es wenn es nicht da ist und failed nicht wenn es schon da ist.
Alternativ auch

[ ! -d /var/log/nginx ] || mkdir /var/log/nginx

>     ExecStartPre= /usr/sbin/nginx -t -q -g 'daemon on; master_process on;'
>     ExecStart= /usr/sbin/nginx -g 'daemon on; master_process on;'

IMHO kannst du ExecStartPre mehrfach angeben die dann nacheinander
ausgeführt werden.

Flo
-- 
Florian Lohoff                                                 f at zz.de
             UTF-8 Test: The 🐈 ran after a 🐁, but the 🐁 ran away
-- 
Linux mailing list Linux at lug-owl.de
subscribe/unsubscribe: http://lug-owl.de/mailman/listinfo/linux
Hinweise zur Nutzung: http://www.lug-owl.de/Mailingliste/hints.epo


More information about the Linux mailing list