This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| linux:systemd [2022/02/14 11:00] – [RC-local Service] Jan Forman | linux:systemd [2022/02/14 13:14] (current) – [RC-local Service] Jan Forman | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== How to systemd ====== | ||
| + | |||
| + | Set systemd log level to error. I don't like my log flooded by nonsense. | ||
| + | |||
| + | / | ||
| + | < | ||
| + | (emerg, alert, crit, err, warning, notice, info, debug) | ||
| + | |||
| + | Limit systemd journal by editing | ||
| + | / | ||
| + | < | ||
| + | |||
| + | ===== Commands ===== | ||
| + | < | ||
| + | < | ||
| + | |||
| + | ===== nginx systemd sample script ===== | ||
| + | Save this file as / | ||
| + | < | ||
| + | [Unit] | ||
| + | Description=The NGINX HTTP and reverse proxy server | ||
| + | After=syslog.target network.target remote-fs.target nss-lookup.target | ||
| + | |||
| + | [Service] | ||
| + | Type=forking | ||
| + | PIDFile=/ | ||
| + | ExecStartPre=/ | ||
| + | ExecStart=/ | ||
| + | ExecReload=/ | ||
| + | ExecStop=/ | ||
| + | PrivateTmp=true | ||
| + | LimitNOFILE=60000 | ||
| + | |||
| + | [Install] | ||
| + | WantedBy=multi-user.target | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== RC-local Service ===== | ||
| + | touch / | ||
| + | systemctl enable rc-local | ||
| + | < | ||
| + | [Unit] | ||
| + | | ||
| + | | ||
| + | |||
| + | [Service] | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | |||
| + | [Install] | ||
| + | | ||
| + | </ | ||
| + | |||
| + | ===== Check service security ===== | ||
| + | < | ||