/var/log im tmpfs - automatisch Unterverzeichnisse anlegen

Stefan U. Hegner stefan at hegner-online.de
Thu Feb 1 10:49:31 CET 2018


Moin in die Runde,

habe hier einen Raspberry-PI2 und dort /var/log in einem tmpfs.

Das möchte ich zusammen mit nginx nutzen, nur der erwartet das er das
Verzeichnis /var/log/nginx findet.

Leider scheint nginx was das "umbiegen" der Logfiles angeht etwas buggy
zu sein. Meine Idee war, einfach in der /etc/nginx/nginx.conf folgendes
zu definieren:

            access_log /var/log/nginx-access.log;
            error_log /var/log/nginx-error.log;

    und analog in der /etc/sites-enabled/local

            access_log      off;
            error_log       /var/log/nginx-local.error_log warn;

... aber so einfach macht er es mir leider nicht:

    Feb 01 09:25:49 raspy-mpd systemd[1]: Starting A high performance
    web server and a reverse proxy server...
    Feb 01 09:25:49 raspy-mpd nginx[911]: nginx: [alert] could not open
    error log file: open() "*/var/log/nginx/error.log*" failed (2: No
    such file or directory)
    Feb 01 09:25:49 raspy-mpd nginx[911]: 2018/02/01 09:25:49 [emerg]
    911#911: open() "/var/log/nginx/error.log" failed (2: No such file
    or directory)
    Feb 01 09:25:49 raspy-mpd nginx[911]: nginx: configuration file
    /etc/nginx/nginx.conf test failed
    Feb 01 09:25:49 raspy-mpd systemd[1]: nginx.service: Control process
    exited, code=exited status=1
    Feb 01 09:25:49 raspy-mpd systemd[1]: Failed to start A high
    performance web server and a reverse proxy server.
    Feb 01 09:25:49 raspy-mpd systemd[1]: nginx.service: Unit entered
    failed state.
    Feb 01 09:25:49 raspy-mpd systemd[1]: nginx.service: Failed with
    result 'exit-code'.

Ich finde nirgendwo in den nginx Dateien noch einen Verweis auf
/var/log/nginx/... aber ohne dem tut er leider nicht. - Liefere ich das
Verzeichnis zum Start von nginx ist alles schön ...

Frage: Wie / wo baue ich das am cleversten ein, dass nach dem mounten
des tmpfs /var/log über die /etc/fstab das Verzeichnis /var/log/nginx
angelegt wird?

Danke

Hegi.

-- 
Stefan U. Hegner
         <stefan at hegner-online.de>
              * * *
D-32584 Löhne --- good ole Germany
internet: http://www.hegner-web.de
              * * *
GPG-Key | 048D 7F64 0BEB 73B1 2725
F-Print | C05E 4F77 9674 EF11 55FE

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: OpenPGP digital signature
URL: <http://lug-owl.de/pipermail/linux/attachments/20180201/9adfca4d/attachment.sig>


More information about the Linux mailing list