PowerDNS / pdns

PowerDNS Authoritative, PowerDNS Recursor, dnsdist
https://www.powerdns.com/
GNU General Public License v2.0
3.63k stars 904 forks source link

multiple instances of DNSDist always logs the process name as DNSDist #10651

Closed ClaudioRifo closed 2 years ago

ClaudioRifo commented 3 years ago

Short description

when running multiple instances of DNSDist it always logs the process name as DNSDist (it does not use the dnsdist@foo or dnsdist-foo like PowerDNS does)

Environment

Steps to reproduce

  1. create multiple instances like stated on the documentation: https://dnsdist.org/advanced/multiple-instance.html
  2. check syslog for services start/stop, you will see only dnsdist as process name

Expected behaviour

I would expect the same behavior as PowerDNS. See process names x instance (like pdns_server-instance1).

Actual behaviour

you will see only dnsdist as process name

klaus-nicat commented 3 years ago

I patched /lib/systemd/system/dnsdist@.service with:

 RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
 LimitNOFILE=16384
 TasksMax=8192
+SyslogIdentifier=dnsdist_%i

 [Install]
 WantedBy=multi-user.target
klaus-nicat commented 3 years ago

Maybe it would be better to use dash instead of underscore. Dash is also used for PowerDNS.

Habbie commented 3 years ago

I patched /lib/systemd/system/dnsdist@.service with:

Looks like we already have that for auth, but not for rec. I'll tag both rec and dnsdist on this ticket so we can check.

Habbie commented 3 years ago

Note: do not patch files in /lib. Put overrides in /etc instead, so your modifications do not break on upgrades.

ClaudioRifo commented 2 years ago

Ok, complete instructions on workaround (while this gets released):

Execute x each service:

systemctl edit @.**@.> systemctl edit @.**@.> systemctl edit @.**@.>

this will open a text editor where you need to include:

[Service] SyslogIdentifier=dnsdist_%i

And it will create one override file x service like:

@./override.conf @./override.conf @.***/override.conf

Restart each service and now each service should have its own identifier.

BONUS: If you also need to separate the logs into different files create a file for rsyslog /etc/rsyslog.d/dnsdist.conf With content:

:programname , isequal, "dnsdist serv1" /var/log/dnsdist serv1.log :programname , isequal, "dnsdist serv2" /var/log/dnsdist serv2.log :programname , isequal, "dnsdist serv3" /var/log/dnsdist serv3.log :programname , isequal, "dnsdist" /var/log/dnsdist.log & stop

And restart rsyslog. (line 4 in the file is in case you use dnsdist default service and also +3 additional services)

From: Peter van Dijk @.> Sent: Friday, September 10, 2021 5:05 AM To: PowerDNS/pdns @.> Cc: Claudio P. Rifo Wahl @.>; Author @.> Subject: Re: [PowerDNS/pdns] multiple instances of DNSDist always logs the process name as DNSDist (#10651)

Note: do not patch files in /lib. Put overrides in /etc instead, so your modifications do not break on upgrades.

- You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FPowerDNS%2Fpdns%2Fissues%2F10651%23issuecomment-916714049&data=04%7C01%7C%7C73f2a834dcb9484c391108d97431a9c8%7C7e8a397d24b846e9b69e718a1d527f50%7C0%7C0%7C637668578972494735%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=dJn%2B1jwBbPC8cLlaLnzn3lj4eX0d8zeUr21fyvh5bkY%3D&reserved=0, or unsubscribehttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAFUQY45EEF5WMMYC2GIVUYDUBG3ZVANCNFSM5CKZWXRA&data=04%7C01%7C%7C73f2a834dcb9484c391108d97431a9c8%7C7e8a397d24b846e9b69e718a1d527f50%7C0%7C0%7C637668578972494735%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=1mFkEcuHoJTHcjTDyjRwaATjoUshQyZkWGiWSJEXtLI%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7C%7C73f2a834dcb9484c391108d97431a9c8%7C7e8a397d24b846e9b69e718a1d527f50%7C0%7C0%7C637668578972504723%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=CohJbO6AXmc1vj6ITWl0qUDc9xHzGM6G3UtiyHbmkh0%3D&reserved=0 or Androidhttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7C%7C73f2a834dcb9484c391108d97431a9c8%7C7e8a397d24b846e9b69e718a1d527f50%7C0%7C0%7C637668578972514726%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=P82mQe0OeUM5FTUII%2Fh%2BB%2BKqMPJ1EtyhLklXQLk6pV0%3D&reserved=0.