Simplify nginx systemd unit and add RuntimeDirectory option to php

This commit is contained in:
Daniel Winzen
2019-10-17 19:03:45 +02:00
parent b7be96b11f
commit 9c04243f33
8 changed files with 12 additions and 5 deletions

View File

@ -1,3 +1,4 @@
daemon on;
user www-data; user www-data;
worker_processes auto; worker_processes auto;
pid /run/nginx.pid; pid /run/nginx.pid;

View File

@ -9,11 +9,10 @@ LimitNOFILE=100000
TimeoutStartSec=600 TimeoutStartSec=600
TimeoutStopSec=5 TimeoutStopSec=5
KillMode=mixed KillMode=mixed
ExecStop=-/sbin/start-stop-daemon --quiet --stop --pidfile /run/nginx.pid ExecStop=/usr/sbin/nginx -s stop
ExecStartPre=/usr/bin/install -Z -m 02755 -o www-data -g www-data -d /run/nginx ExecStartPre=/usr/sbin/nginx -t -q
ExecStartPre=/usr/sbin/nginx -t -q -g 'daemon on; master_process on;' ExecStart=/usr/sbin/nginx
ExecStart=/usr/sbin/nginx -g 'daemon on; master_process on;' ExecReload=/usr/sbin/nginx -s reload
ExecReload=/usr/sbin/nginx -g 'daemon on; master_process on;' -s reload
ProtectSystem=strict ProtectSystem=strict
PrivateTmp=true PrivateTmp=true
NoNewPrivileges=true NoNewPrivileges=true
@ -28,6 +27,7 @@ ReadWritePaths=-/var/lib/nginx/
ReadWritePaths=-/var/www/var/run/ ReadWritePaths=-/var/www/var/run/
ReadWritePaths=-/run/ ReadWritePaths=-/run/
InaccessiblePaths=-/root/ InaccessiblePaths=-/root/
RuntimeDirectory=nginx
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@ -29,6 +29,7 @@ InaccessiblePaths=-/root/
CPUQuota=100% CPUQuota=100%
MemoryHigh=25% MemoryHigh=25%
MemoryMax=35% MemoryMax=35%
RuntimeDirectory=php
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@ -31,6 +31,7 @@ InaccessiblePaths=-/root/
CPUQuota=100% CPUQuota=100%
MemoryHigh=25% MemoryHigh=25%
MemoryMax=35% MemoryMax=35%
RuntimeDirectory=php
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@ -29,6 +29,7 @@ InaccessiblePaths=-/root/
CPUQuota=100% CPUQuota=100%
MemoryHigh=25% MemoryHigh=25%
MemoryMax=35% MemoryMax=35%
RuntimeDirectory=php
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@ -31,6 +31,7 @@ InaccessiblePaths=-/root/
CPUQuota=100% CPUQuota=100%
MemoryHigh=25% MemoryHigh=25%
MemoryMax=35% MemoryMax=35%
RuntimeDirectory=php
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@ -29,6 +29,7 @@ InaccessiblePaths=-/root/
CPUQuota=100% CPUQuota=100%
MemoryHigh=25% MemoryHigh=25%
MemoryMax=35% MemoryMax=35%
RuntimeDirectory=php
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@ -31,6 +31,7 @@ InaccessiblePaths=-/root/
CPUQuota=100% CPUQuota=100%
MemoryHigh=25% MemoryHigh=25%
MemoryMax=35% MemoryMax=35%
RuntimeDirectory=php
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target