Merge pull request #299 from dkg/systemd

Provide guidance for integration with systemd
This commit is contained in:
wtoorop 2017-05-01 10:34:26 +02:00 committed by GitHub
commit e9183386f1
3 changed files with 30 additions and 0 deletions

16
systemd/README.md Normal file
View File

@ -0,0 +1,16 @@
Stubby integration with systemd
===============================
For GNU/Linux operating systems which use systemd as a process
manager, you might want to run stubby as a system service.
This directory provides recommended systemd unit files.
This setup assumes that there is a system-level user named "stubby"
which is in group "stubby", and try to limit the privileges of the
running daemon to that user as closely as possible.
Normally, a downstream distributor will install them as:
/usr/lib/tmpfiles.d/stubby.conf
/lib/systemd/system/stubby.service

2
systemd/stubby.conf Normal file
View File

@ -0,0 +1,2 @@
# tmpfiles.d (5) for use with stubby.service
d /run/stubby 0750 root stubby - -

12
systemd/stubby.service Normal file
View File

@ -0,0 +1,12 @@
[Unit]
Description=stubby DNS resolver
[Service]
WorkingDirectory=/run/stubby
ExecStart=/usr/bin/stubby
AmbientCapabilities=CAP_NET_BIND_SERVICE
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
User=stubby
[Install]
WantedBy=multi-user.target