Boilerplate systemd Service
Because I always forget and have to cobble together multiple stack overflows to do what I want:
create /lib/systemd/system/[name].service
[Unit]
Description=
After=multi-user.target
[email protected]
[Service]
Type=simple
User=[optional]
Group=[optional]
ExecStart=/usr/bin/python3 /root/whatever.py
WorkingDirectory=/root
StandardInput=null
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=[name]
LimitNPROC=infinity
[Install]
WantedBy=multi-user.target
then create /etc/rsyslog.d/10-[name].conf
if $programname == '<your program identifier>' then /var/log/[name].log
& stop
systemctl enable [name].service
service rsyslog restart
service [name].service start
to update the .service: systemctl daemon-reload