-
Notifications
You must be signed in to change notification settings - Fork 4
Persisting Go using systemd
Zelenko edited this page Mar 26, 2018
·
2 revisions
Start your go app when the server starts. In other word daemonize your golang program.
cd /etc/systemd/system/
nano golang.service
[Unit]
Description=Go Server
[Service]
ExecStart=/var/www/web
WorkingDirectory=/var/www/
User=root
Group=root
Restart=always
[Install]
WantedBy=multi-user.target
systemctl enable golang.servicesystemctl start golang.servicesystemctl status golang.servicesystemctl stop golang.service
-
dpkg -l systemdwill give you name, version, and architecture description. -
systemctl --versionPrint a short version string