systemd-run --description="ls as a systemd.service" --unit="ls.service" ls -la /usr/lib/systemd
journalctl -u "ls.service"
[Unit]
Description=Rsync Socket
Conflicts=rsyncd.service
[Socket]
ListenStream=873
Accept=true
[Install]
WantedBy=sockets.target
[Unit]
Description=A file transfer program to keep remote files in sync
After=network.target
[Service]
ExecStart=/usr/bin/rsync --daemon --no-detach
RestartSec=1
[Install]
WantedBy=multi-user.target
[Unit]
Description=hello_env.js - making your environment variables rad
Documentation=https://example.com
After=network.target
[Service]
Environment=NODE_PORT=3001
Type=simple
User=ubuntu
ExecStart=/usr/bin/node /home/ubuntu/hello_env.js
Restart=on-failure
[Install]
WantedBy=multi-user.target
(better)
[Unit]
Description=hello_env.js - making your environment variables rad
Documentation=https://example.com
After=network.target
[Service]
Environment=NODE_PORT=3001
Type=simple
User=ubuntu
ExecStart=/usr/bin/node /srv/node/ubuntu/hello_env.js
Restart=on-failure
[Install]
WantedBy=multi-user.target