This page will walk you threw installing the sks-keyserver systemd services on a Ubuntu 18.04 LTS, thou it will most likely work with any systemd server.
The systemd services provided on this page will auto start the sks daemon when the server is booted up, and will restart the daemon if it dies for some reason.
Note, this page assumes your sks daemon is located at /usr/local/bin/sks
and your key directory is /var/lib/sks
.
First confirm you have the debian-sks
user and group added to your system. If you do not, you may add them with the following command:
adduser --system --group --home /var/lib/sks --disabled-login debian-sks
Now, download the needed service files and add them to your /etc/systemd/system/
directory. Note, these config assume the sks daemon lives at /usr/local/bin/sks
if yours is in a diffrent spot, you will need to update both files to point to your install locaction.
The SKS DB Service
curl -Ls "https://gist.githubusercontent.com/mattrude/07edf38d965d6106b95094d8df4fe36d/raw/sks-db.service" \
-o /etc/systemd/system/sks-db.service
The SKS Recon Service
curl -Ls "https://gist.githubusercontent.com/mattrude/07edf38d965d6106b95094d8df4fe36d/raw/sks-recon.service" \
-o /etc/systemd/system/sks-recon.service
After you have the services installed, you may enable the services.
systemctl daemon-reload
systemctl enable sks-db.service
systemctl enable sks-recon.service
systemctl start sks-db sks-recon
systemctl restart sks-db sks-recon
systemctl stop sks-db sks-recon
systemctl status sks-db sks-recon
Here is the output:
● sks-db.service - SKS-Keyserver DB Instance
Loaded: loaded (/etc/systemd/system/sks-db.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2019-02-05 20:55:22 UTC; 1h 45min ago
Main PID: 8445 (sks)
Tasks: 1
Memory: 1016.3M
CPU: 15min 5.827s
CGroup: /system.slice/sks-db.service
└─8445 /usr/local/bin/sks db
● sks-recon.service - SKS-Keyserver Recon Instance
Loaded: loaded (/etc/systemd/system/sks-recon.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2019-02-05 20:55:21 UTC; 1h 45min ago
Main PID: 8442 (sks)
Tasks: 1
Memory: 131.7M
CPU: 19.833s
CGroup: /system.slice/sks-recon.service
└─8442 /usr/local/bin/sks recon