Skip to content

Commit

Permalink
Systemd requires the directories to be created before
Browse files Browse the repository at this point in the history
This reverts commit b2c1c1c.
  • Loading branch information
therobot committed Jun 22, 2017
1 parent 879c576 commit 79f3792
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
11 changes: 11 additions & 0 deletions resources/pdns_recursor_config.rb
Expand Up @@ -69,6 +69,17 @@
action :create
end

directory new_resource.socket_dir do
owner new_resource.run_user
group new_resource.run_group
# When using service_manager the 'socket-dir' has to be writable for the 'set-gid'
# in order to start the service:
# Issue: https://github.com/PowerDNS/pdns/issues/4826
mode '0775'
recursive true
action :create
end

template "#{new_resource.config_dir}/recursor-#{new_resource.instance_name}.conf" do
source new_resource.source
cookbook new_resource.cookbook
Expand Down
6 changes: 3 additions & 3 deletions templates/default/recursor.init.debian.erb
Expand Up @@ -32,9 +32,9 @@ CONFIG_DIR=<%= @config_dir %>
# or fall back to the default /var/run if not specified there.
PIDDIR=$(awk -F= '/^socket-dir=/ {print $2}' $CONFIG_FILE)
if [ -z "$PIDDIR" ]; then PIDDIR=/var/run; fi
# The binary "pdns_recursor" handles its own pidfile according the following
# schema: pdns_recursor-<VIRTUAL_INSTANCE_NAME>
PIDFILE="${PIDDIR}/pdns_recursor-${INSTANCE_NAME}.pid"
# The binary "pdns_recursor" handles its own pidfile according the following
# schema: pdns_recursor-<VIRTUAL_INSTANCE_NAME>
PIDFILE="${PIDDIR}/pdns_recursor-${INSTANCE_NAME}.pid"

# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0
Expand Down

0 comments on commit 79f3792

Please sign in to comment.