configure_pdns 625 B

1234567891011121314151617181920
  1. #!/usr/bin/env perl
  2. use strict;
  3. use warnings;
  4. use File::Copy;
  5. use Config::Simple;
  6. # Fix broken out of the box systemd unit for pdns
  7. my $service_file = "/usr/lib/systemd/system/pdns.service";
  8. die "Can't find service file $service_file" unless -f $service_file;
  9. my $cfg = Config::Simple->new($service_file);
  10. #$cfg->param("Service.WorkingDirectory", "/var/spool/powerdns");
  11. my $invocation = "/usr/sbin/pdns_server --guardian=no --daemon=no --logging-facility=1 --log-timestamp=yes --write-pid=no --chroot";
  12. $cfg->param("Service.ExecStart", $invocation);
  13. File::Copy::copy($service_file, "$service_file.bak");
  14. $cfg->save();