Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ###### Systemd unit example ######
- [Unit]
- Description=Server RZD
- [Service]
- User=minidlna
- #Type=forking
- WorkingDirectory=/home/pi/ServerRZD/v1
- #ExecStartPre=
- ExecStart=/home/pi/ServerRZD/v1/srzd
- #ExecStartPost=
- ExecReload=/usr/sbin/nginx -g 'daemon on; master_process on;' -s reload
- Restart=always
- RemainAfterExit=yes
- TimeoutSec=10
- #### LOGGING:
- #Environment=PYTHONUNBUFFERED=1
- StandardOutput=tty
- #StandardOutput=syslog # Output to syslog
- #StandardOutput=file:/home/user/log1.log
- #StandardError=append:/home/user/log2.log
- #StandardError=syslog # Output to syslog
- #SyslogIdentifier=<your program identifier>
- [Install]
- WantedBy=multi-user.target
- ####################################
- Minimal unit runs rc.local at restart:
- [Unit]
- Description=Runs /usr/local/bin/rc.local
- [Service]
- ExecStart=/usr/local/bin/rc.local
- [Install]
- WantedBy=multi-user.target
- ####################################
- # systemd resolve
- # Show DNS status:
- resolvectl status
- systemd-resolve --statistics
- # Clean DNS caches:
- systemd-resolve --flush-caches
- ####################################
- # Disable not need services:
- for i in avahi-daemon wpa_supplicant bluealsa.service bluetooth.service alsa-restore.service hciuart.service ModemManager.service triggerhappy.service graphical.target rdnssd.service incron.service aakore.service acp-update-controller.service acronis_mms.service acronis_schedule.service active-protection.service unattended-upgrades.service cloud-init.service
- do
- systemctl disable ${i}
- systemctl stop ${i}
- done
- ##### User's units: https://wiki.archlinux.org/index.php/Systemd_(%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)/User_(%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)
- # Current runlevel:
- systemctl get-default
- # Get PID of unit:
- systemctl show --property MainPID --value speakphone
- # View loaded targets:
- systemctl list-units --type target
- # View all targets:
- systemctl list-units --type target --all
- # View running units
- systemctl list-unit-files --state=disabled
- # Journald /etc/systemd/journald.conf
- SystemMaxUse=1G
- systemctl restart systemd-journald.service
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement