-
Notifications
You must be signed in to change notification settings - Fork 6
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.service
systemctl start golang.service
systemctl status golang.service
systemctl stop golang.service
-
dpkg -l systemd
will give you name, version, and architecture description. -
systemctl --version
Print a short version string