nohup command > /dev/null 2>&1 &
- create /etc/systemd/system/foo.service
[Unit]
Description=Job that runs your user script
[Service]
ExecStart=/some/command
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
- Then run:
sudo systemctl daemon-reload
sudo systemctl enable foo.service