|
|
|
|
|
by MuffinFlavored
1045 days ago
|
|
> Systemd on the other hand has most of the things I need, but I found it cumbersome to use Could you please expand on this? From what I understand, to use systemd to deploy a microservice is basically one file: # /etc/systemd/system/myservice.service
[Unit]
Description=My Microservice
After=network.target
[Service]
ExecStart=/path/to/myservice
Restart=always
User=myuser
Group=mygroup
Environment=VARIABLE=value
WorkingDirectory=/path/to/service/directory
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=myservice
[Install]
WantedBy=multi-user.target
Then, to "use" it: # reload systemd
sudo systemctl daemon-reload
# start service
sudo systemctl start myservice
# enable service at boot
sudo systemctl enable myservice
# check status
sudo systemctl status myservice
# check logs
journalctl -u myservice
What more advanced stuff were you trying to do that you ran into that made systemd seem cumbersome? |
|
Finally why limit oneself to systemd? pm2 runs on Mac and windows, I aim to do the same. Same set of commands to create services everywhere, with details abstracted away (easier said than done, need to look into their APIs).