DynamicUser and python don't mix, apply by hand instead
authorTollef Fog Heen <tfheen@err.no>
Sat, 30 Sep 2017 19:44:15 +0000 (21:44 +0200)
committerTollef Fog Heen <tfheen@err.no>
Sat, 30 Sep 2017 19:44:15 +0000 (21:44 +0200)
It seems like importing site fails for python with a dynamic user, so
set the same settings and run as nobody instead.

modules/roles/templates/mirror-health.service.erb

index 6158951..badcd33 100644 (file)
@@ -9,7 +9,11 @@ Description=Mirror health checking <%= @healthcheck_service %>
 [Service]
 ExecStart=/usr/local/sbin/mirror-health
 RuntimeDirectory=dsa-mirror-health-<%= @healthcheck_service %>
-DynamicUser=true
+ProtectSystem=full
+ProtectHome=read-only
+PrivateTmp=true
+User=nobody
+Group=nogroup
 
 Environment="MIRROR_CHECK_SERVICE=<%= @check_service %>"
 Environment="MIRROR_CHECK_URL=<%= @url %>"