Code: Select all
nano /etc/systemd/system/ejemplo.serviceCode: Select all
[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/app.js
Restart=on-failure
[Install]
WantedBy=multi-user.targetCode: Select all
systemctl daemon-reloadCode: Select all
systemctl start ejemploCode: Select all
systemctl enable ejemplo
