This section describes the creation of a systemd service for the GoKeyless server and the steps required to start, enable, and verify the service. Configuring GoKeyless as a system service ensures it runs consistently and starts automatically during system boot.
-
Create
systemdservice for GoKeyless.
sudo nano /usr/lib/systemd/system/gokeyless.service
Add the following configuration:
[Unit]
Description=gokeyless daemon
After=network.target
[Service]
Type=simple
User=gokeyless
Group=gokeyless
WorkingDirectory=/etc/keyless
ExecStart=/usr/bin/gokeyless
[Install]
WantedBy=multi-user.target
-
Reload
systemdconfiguration.
sudo systemctl daemon-reexec
sudo systemctl daemon-reload
-
Enable and start the GoKeyless service.
sudo systemctl enable gokeyless
sudo systemctl start gokeyless
-
Verify service status.
sudo systemctl status gokeyless
Monitoring GoKeyless daemon status