Hamburger
goHosting

Activate Systemd for Go executeables

systemd service

Systemd is a magic service that keeps your Go site running by monitoring that the site is running. If needed systemd restarts the service. You have to point to which Go executable that should be monitored. Each site has its own service and should be placed in

/etc/systemd/system/site.service

Each "site.service" should look something like this:

[Unit]
Description=gowebdev

[Service]
Type=simple
User=root
Restart=always
RestartSec=5s
WorkingDirectory=/var/www/gowebdev
ExecStart=/var/www/gowebdev/main

[Install]
WantedBy=multi-user.target

When the service is created, you muste reload systemd.

systemctl daemon-reload

Once enabled, you can start, stop and restart this service

service go4webdev restart (replace with your own "service name")

You can create a "button" (Custom Command) in Webmin that fires this command without typing:

Custom Command