Cannot start dnsadmin due to PID file issue.

bobc02

Member
May 29, 2019
11
2
3
Sammamish, WA
cPanel Access Level
Root Administrator
I'm using cPanel 88.0 (build 9).

The status of dnsadmin is DOWN. I am trying to start it, but getting PID file error. Here's results of a status check:

Code:
[[email protected] scripts]# systemctl status dnsadmin
* dnsadmin.service - cPanel DNS admin service
   Loaded: loaded (/etc/systemd/system/dnsadmin.service; enabled; vendor preset: disabled)
   Active: failed (Result: protocol) since Fri 2020-06-12 18:18:34 UTC; 15s ago
  Process: 19634 ExecStart=/usr/local/cpanel/scripts/restartsrv_dnsadmin --no-verbose --notconfigured-ok --systemd-service=dnsadmin (code=exited, status=0/SUCCESS)

Jun 12 18:18:34 myserver.com systemd[1]: Starting cPanel DNS admin service...
Jun 12 18:18:34 myserver.com systemd[1]: Can't open PID file /var/run/dnsadmin.pid (yet?) after start: Too many levels of symbolic links
Jun 12 18:18:34 myserver.com systemd[1]: Failed to set a watch for dnsadmin.service's PID file /var/run/dnsadmin.pid: Too many open files
Jun 12 18:18:34 myserver.com systemd[1]: Failed to start cPanel DNS admin service.
Jun 12 18:18:34 myserver.com systemd[1]: Unit dnsadmin.service entered failed state.
Jun 12 18:18:34 myserver.com systemd[1]: dnsadmin.service failed.
I don't understand the "Too many levels of symbolic links", and "Too many open files", and how to correct the errors.

This seems to have started after an auto-update "PowerDNS Configuration updated", which immediately generated error "cPanel & WHM update failure in upcp script".

Any ideas on how to fix?

Thanks.
 

andrew.n

Well-Known Member
Jun 9, 2020
328
70
28
EU
cPanel Access Level
Root Administrator
Looks like you are on OpenVZ virtualisation. This is cPanel advise for this problem:


The resolution could be either reaching out to your host to upgrade the kernel on OpenVZ server or as a workaround for example:

  1. Edit the service configuration file:
    # systemctl edit --full spamassassin.service
  2. Set the PIDfile parameter from /var/run/<service-name>.pid to /run/<service-name>.pid as follows:
    # systemctl cat spamassassin.service
    [Unit]
    Description=Spamassassin daemon
    After=syslog.target network.target

    [Service]
    Type=forking
    PIDFile=/run/spamd.pid
    EnvironmentFile=-/etc/sysconfig/spamassassin
    ExecStartPre=-/sbin/portrelease spamd
    ExecStart=/usr/bin/spamd --pidfile /run/spamd.pid $SPAMDOPTIONS
    StandardOutput=syslog
    StandardError=syslog
    Restart=always

    [Install]
    WantedBy=multi-user.target
  3. Reload Systemctl:
    # systemctl daemon-reload
  4. Start the service:
    # systemctl start spamassassin.service
 

bobc02

Member
May 29, 2019
11
2
3
Sammamish, WA
cPanel Access Level
Root Administrator
Thanks for the explanation and links!

I verified that OpenVZ was the issue, and contacted my provider who said that they are aware, and are planning to move all accounts to a new environment.

I have tried the workaround, but I am getting "Too many open files" when I do the reload.

Here's the file after changes:
Code:
[Unit]
Description=cPanel DNS admin service
After=cpanel.service
# dnsonly server

[Service]
Type=forking
# PIDFile=/var/run/dnsadmin.pid
PIDFile=/run/dnsadmin.pid
ExecStart=/usr/local/cpanel/scripts/restartsrv_dnsadmin --no-verbose --notconfigured-ok  --systemd-service=dnsadmin
ExecStop=/usr/local/cpanel/scripts/restartsrv_dnsadmin --stop --notconfigured-ok  --systemd-service=dnsadmin

[Install]
WantedBy=multi-user.target
And here are the actions I took:
Code:
[[email protected] scripts]# systemctl edit --full dnsadmin.service
[[email protected] scripts]# systemctl daemon-reload
[[email protected] scripts]# systemctl start dnsadmin.service
Error: Too many open files
Job for dnsadmin.service failed. See "systemctl status dnsadmin.service" and "journalctl -xe" for details.
Thanks.
Bob
 

RoseHosting

Member
PartnerNOC
Jan 3, 2003
20
2
153
Thanks for the explanation and links!

I verified that OpenVZ was the issue, and contacted my provider who said that they are aware, and are planning to move all accounts to a new environment.

I have tried the workaround, but I am getting "Too many open files" when I do the reload.

Here's the file after changes:
Code:
[Unit]
Description=cPanel DNS admin service
After=cpanel.service
# dnsonly server

[Service]
Type=forking
# PIDFile=/var/run/dnsadmin.pid
PIDFile=/run/dnsadmin.pid
ExecStart=/usr/local/cpanel/scripts/restartsrv_dnsadmin --no-verbose --notconfigured-ok  --systemd-service=dnsadmin
ExecStop=/usr/local/cpanel/scripts/restartsrv_dnsadmin --stop --notconfigured-ok  --systemd-service=dnsadmin

[Install]
WantedBy=multi-user.target
And here are the actions I took:
Code:
[[email protected] scripts]# systemctl edit --full dnsadmin.service
[[email protected] scripts]# systemctl daemon-reload
[[email protected] scripts]# systemctl start dnsadmin.service
Error: Too many open files
Job for dnsadmin.service failed. See "systemctl status dnsadmin.service" and "journalctl -xe" for details.
Thanks.
Bob

You can append these lines to /etc/security/limits.conf file to increase the limit.

Code:
*       soft    nofile  35000
*       hard    nofile  65000
 

andrew.n

Well-Known Member
Jun 9, 2020
328
70
28
EU
cPanel Access Level
Root Administrator
Glad to hear! Enjoy the weekend :)
 

planetjoin

Well-Known Member
Oct 14, 2003
68
3
158
cPanel Access Level
Root Administrator
You can append these lines to /etc/security/limits.conf file to increase the limit.

Code:
*       soft    nofile  35000
*       hard    nofile  65000
hello

I´ve tried all this and still get :
# systemctl start dnsadmin.service
Error: Too many open files
Job for dnsadmin.service failed. See "systemctl status dnsadmin.service" and "journalctl -xe" for details.

I´m using DNSONLY whm in virtuozzo enviroment and it now working properly.
First i got named errors with TCP_FASTOPEN :


Code:
Jul 11 11:24:26 ns2 named[19416]: automatic empty zone: view internal: 8.B.D.0.1.0.0.2.IP6.ARPA
Jul 11 11:24:26 ns2 named[19416]: automatic empty zone: view internal: EMPTY.AS112.ARPA
Jul 11 11:24:26 ns2 named[19416]: automatic empty zone: view internal: HOME.ARPA
Jul 11 11:24:26 ns2 named[19416]: none:104: 'max-cache-size 90%' - setting to 921MB (out of 1024MB)
Jul 11 11:24:26 ns2 named[19416]: set up managed keys zone for view external, file 'external.mkeys'
Jul 11 11:24:26 ns2 named[19416]: none:104: 'max-cache-size 90%' - setting to 921MB (out of 1024MB)
Jul 11 11:24:26 ns2 named[19416]: ../../../../lib/isc/unix/socket.c:5682: unexpected error:
Jul 11 11:24:26 ns2 named[19416]: setsockopt(23, TCP_FASTOPEN) failed with Protocol not available
Jul 11 11:24:26 ns2 named[19416]: command channel listening on 127.0.0.1#953
Jul 11 11:24:26 ns2 systemd[1]: Started Berkeley Internet Name Domain (DNS).
AND NOW.. dnsadmin can´t start.

Jul 11 11:40:19 ns2 systemd[1]: Starting cPanel DNS admin service...
Jul 11 11:40:19 ns2 systemd[1]: Can't open PID file /var/run/dnsadmin.pid (yet?) after start: Too many levels of symbolic links
Jul 11 11:40:19 ns2 systemd[1]: Failed to set a watch for dnsadmin.service's PID file /var/run/dnsadmin.pid: Too many open files
Jul 11 11:40:19 ns2 systemd[1]: Failed to start cPanel DNS admin service.
Jul 11 11:40:19 ns2 systemd[1]: Unit dnsadmin.service entered failed state.
Jul 11 11:40:19 ns2 systemd[1]: dnsadmin.service failed.

/var/run/dnsadmin.pid is not exists...



Any clue?

Thanks
Fabian
 

andrew.n

Well-Known Member
Jun 9, 2020
328
70
28
EU
cPanel Access Level
Root Administrator
Open a support ticket with your provider and ask them to upgrade the kernel on the host your VPS resides.
 

planetjoin

Well-Known Member
Oct 14, 2003
68
3
158
cPanel Access Level
Root Administrator
Open a support ticket with your provider and ask them to upgrade the kernel on the host your VPS resides.
Thanks for your reply.

Finally , i fixed dnsadmin, but i still having issues with TCP_FASTOPEN. That is because this vps is a container with virtuozzo. The next week we will move it to a KVM vps to update kernels myself ;)

Regards
Fabian
 
  • Like
Reactions: andrew.n