failed to start name service cache daemon

Hello guys,
I have this problem:
When booting up, I get this error:
“Failed to start Name Service Cache Daemon”
it tells me to run journalctl -xn to see additional info, which prints this:

Oct 26 22:27:59 bogPC systemd[1]: Cannot add dependency job for unit cups.socket, ignoring: Unit cups.socket failed to load: No su
Oct 26 22:27:59 bogPC nscd[2655]: 2655 /var/run/nscd/nscd.pid: Permission denied
Oct 26 22:27:59 bogPC nscd[2654]: child exited with status 1.
Oct 26 22:27:59 bogPC systemd[1]: Failed to start Name Service Cache Daemon.
-- Subject: Unit nscd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit nscd.service has failed.
-- 
-- The result is failed.

Should I be worried about this or can I ignore it? It happens every time.

Hi,

try the following commands from a root terminal: “systemctl status nscd.service”
“systemctl list-units | grep nscd”
“systemctl list-unit-files | grep nscd”

“list-unit-files” should indicate: “nscd.service enabled”
“list-units” should indicate:“nscd.service loaded active running Name Service Cache Daemon”

Cheers

Hello, thanks for the reply, I tried those commands but list-units says it failed to load:

bogPC:/home/bog # systemctl status nscd.service
nscd.service - Name Service Cache Daemon
   Loaded: loaded (/usr/lib/systemd/system/nscd.service; enabled)
   Active: failed (Result: start-limit) since Wed 2015-10-28 11:34:58 EET; 3min 45s ago
  Process: 997 ExecStart=/usr/sbin/nscd (code=exited, status=0/SUCCESS)


Oct 28 11:34:58 bogPC systemd[1]: nscd.service start request repeated too quickly, refusing to start.
Oct 28 11:34:58 bogPC systemd[1]: Failed to start Name Service Cache Daemon.
bogPC:/home/bog # systemctl list-units | grep nscd
nscd.service                                                                                   loaded failed     failed       Name Service Cache Daemon
bogPC:/home/bog # systemctl list-unit-files | grep nscd
nscd.service                               enabled 



Nothing new here, as far as i can see.

Hello again.
Please check the following directory permissions (a normal user terminal prompt should be enough):

  • /var

[INDENT=2]> l -d /var
drwxr-xr-x 15 root root 4096 19. Aug 18:03 /var/
>
[/INDENT]

  • /var/run

[INDENT=2]> l -d /var/run
drwxr-xr-x 34 root root 1060 28. Okt 13:14 /var/run/
>
[/INDENT]

  • /var/run/nscd

[INDENT=2]> l -d /var/run/nscd
drwxr-xr-x 2 root root 160 28. Okt 07:39 /var/run/nscd/
>[/INDENT]

Then, please check the permissions of the files in /var/run/nscd/:[INDENT=2]> l /var/run/nscd/
insgesamt 852
drwxr-xr-x 2 root root 160 28. Okt 07:39 ./
drwxr-xr-x 34 root root 1060 28. Okt 13:14 …/
-rw------- 1 root root 217032 28. Okt 08:34 group
-rw------- 1 root root 217032 28. Okt 07:39 netgroup
-rw-r–r-- 1 root root 4 28. Okt 07:39 nscd.pid
-rw------- 1 root root 217032 28. Okt 07:39 passwd
-rw------- 1 root root 217032 28. Okt 07:39 services
srw-rw-rw- 1 root root 0 28. Okt 07:39 socket=
>[/INDENT]

If nscd.pid is present, you should be able to view the contents with ‘cat’ and then ‘ps’ the indicated PID.

Please note, that nothing in /var/run/ should be older than the time of the last boot. :wink:

Cheers

All right, I’ve identified some problems then.
The permissions seem to be OK:

bog@bogPC:~> l -d /var
drwxr-xr-x 16 root root 4096 Oct  6 01:24 /var/


bog@bogPC:~> l -d /var/run
lrwxrwxrwx 1 root root 24 Apr 10  2014 /var/run -> /var/lib/ntp/var/run/ntp/

bog@bogPC:~> l -d /var/lib/ntp/var/run/ntp/
drwxr-xr-x 15 ntp root 4096 Oct 28 16:20 /var/lib/ntp/var/run/ntp//


bog@bogPC:~> l -d /var/run/nscd
drwxr-xr-x 2 root root 4096 Oct  5 22:09 /var/run/nscd/


bog@bogPC:~> ls -l /var/run/nscd/
total 848
-rw------- 1 root root 217032 Oct  5 22:09 group
-rw------- 1 root root 217032 Oct  5 22:09 netgroup
-rw------- 1 root root 217032 Oct  5 22:09 passwd
-rw------- 1 root root 217032 Oct  5 22:09 services




but as you can see the date is OCT/5 which is 3 weeks ago, I would say about the time when I upgraded from 12.3 to 13.2
There is no **nscd.pid **file in there either.
Also there’s a lot of other stuff in /var/run that is quite old:

bog@bogPC:~> ls -l /var/run/
total 112
srw-rw-rw- 1 root     root         0 Oct 28 16:20 acpid.socket
-rw-r--r-- 1 root     root         4 Oct 28 16:20 auditd.pid
---------- 1 root     root         0 Apr 10  2014 cron.reboot
drwxr-xr-x 3 root     lp        4096 Sep 28 18:55 cups
drwxr-xr-x 3 root     root      4096 Sep 28 18:55 dbus
-rw-r--r-- 1 root     root         5 Oct 28 17:11 dhclient-eth0.pid
lrwxrwxrwx 1 root     root        17 Oct 28 16:20 displaymanager.pid -> /var/run/lxdm.pid
drwxr-xr-x 2 firebird firebird  4096 Apr 12  2015 firebird
drwxr-xr-x 2 root     root      4096 Oct  5 23:44 fontpackages
drwxr-xr-x 2 root     root      4096 Oct 28 16:20 lxdm
-rw-r--r-- 1 root     root         3 Oct 28 16:20 lxdm.pid
drwxr-xr-x 5 root     root      4096 Oct 28 16:20 netconfig
drwxr-xr-x 2 root     root      4096 Oct  5 22:09 nscd
lrwxrwxrwx 1 root     root        24 Oct  5 22:58 ntp -> /var/lib/ntp/var/run/ntp
-rw-r--r-- 1 root     root         3 Oct 28 16:20 ntpd.pid
drwxr-xr-x 2 root     root      4096 Oct 28 16:20 pcscd
-rw-r--r-- 1 root     root     18075 Oct 28 10:24 pm-suspend
drwxr-xr-x 5 root     root      4096 Apr 11  2014 pm-utils
-rw-r--r-- 1 root     root         4 Dec 28  2014 powerd.pid
drwxr-xr-x 2 root     root      4096 Oct 26 20:20 regenerate-initrd
-rw-r--r-- 1 root     root         4 Oct 28 16:20 rsyslogd.pid
drwxr-xr-x 2 root     root      4096 Oct  6 01:51 samba
drwxr-xr-x 3 root     root      4096 Oct  5 23:38 SuSEfirewall2
drwxr-xr-x 2 svn      svn       4096 Oct  6 01:44 svnserve
-rw-r--r-- 1 root     root         3 Oct 28 16:20 teamviewerd.pid
-rw-r--r-- 1 root     root         5 Oct 28 11:58 yast.pid
-rw-r--r-- 1 root     root         5 Oct 28 11:58 zypp.pid

Another thing that might be worth noted: I have a separate partition for /var, although I think this should have nothing to do with the problem, it’s been like this for years.

bog@bogPC:~> mount | grep var
/dev/sda2 on /var type ext4 (rw,noatime,data=ordered)
tmpfs on /var/lock type tmpfs (rw,nosuid,nodev,relatime,mode=755)
none on /var/lib/ntp/proc type proc (ro,nosuid,nodev,relatime)

Hi,
the mounted local filesystems of my desktop machine are as follows:


> findmnt -t ext4,xfs,sysfs,proc,tmpfs
TARGET                SOURCE    FSTYPE OPTIONS
/                     /dev/sda1 ext4   rw,noatime,data=ordered
├─/sys                sysfs     sysfs  rw,nosuid,nodev,noexec,relatime
│ └─/sys/fs/cgroup    tmpfs     tmpfs  rw,nosuid,nodev,noexec,mode=755
├─/proc               proc      proc   rw,nosuid,nodev,noexec,relatime
├─/dev/shm            tmpfs     tmpfs  rw,nosuid,nodev
├─/run                tmpfs     tmpfs  rw,nosuid,nodev,mode=755
├─/home01             /dev/sdb2 xfs    rw,relatime,attr2,inode64,noquota
├─/var                /dev/sdb1 ext4   rw,noatime,data=ordered
│ ├─/var/run          tmpfs     tmpfs  rw,nosuid,nodev,mode=755
│ └─/var/lib/ntp/proc none      proc   ro,nosuid,nodev,relatime
├─/srv                /dev/sdc2 ext4   rw,noatime,data=ordered
├─/home               /dev/sdc3 xfs    rw,relatime,attr2,inode64,noquota
└─/tmp                /dev/sdc1 ext4   rw,noatime,data=ordered
>

I suspect that you may have an issue with the /var/run link, especially as it’s pointing to something which may be used by NTP:


> l /var/lib/ntp/
insgesamt 24
drwxr-xr-x   7 root root 4096 19. Aug 22:12 ./
drwxr-xr-x  53 root root 4096 10. Okt 00:00 ../
drwxr-xr-x   2 root root 4096 20. Apr 2015  dev/
drwxr-xr-x   2 ntp  ntp  4096 28. Okt 15:39 drift/
drwxr-xr-x   2 root root 4096 12. Okt 10:26 etc/
dr-xr-xr-x 272 root root    0 28. Okt 07:38 proc/
drwxr-xr-x   5 root root 4096 19. Aug 22:12 var/
> l /var/lib/ntp/var/
insgesamt 20
drwxr-xr-x 5 root root 4096 19. Aug 22:12 ./
drwxr-xr-x 7 root root 4096 19. Aug 22:12 ../
drwxr-xr-x 2 root root 4096 19. Aug 17:04 lib/
drwxr-xr-x 2 root root 4096 19. Aug 22:12 log/
drwxr-xr-x 3 root root 4096 20. Apr 2015  run/
> l /var/lib/ntp/var/run/
insgesamt 12
drwxr-xr-x 3 root root 4096 20. Apr 2015  ./
drwxr-xr-x 5 root root 4096 19. Aug 22:12 ../
drwxr-xr-x 2 ntp  root 4096 10. Okt 18:40 ntp/
> l /var/lib/ntp/var/run/ntp/
insgesamt 8
drwxr-xr-x 2 ntp  root 4096 10. Okt 18:40 ./
drwxr-xr-x 3 root root 4096 20. Apr 2015  ../
>

I suspect that you need to (as root) ‘init’ to (systemd) “system rescue mode” (used to be “single user mode”): “# init 1” or “# telinit 1” or “# systemctl rescue”.
Make sure that the ntpd.service has shut down.
Then, in this mode you should should at least unlink /var/run after moving everything there somewhere else.
Then move everything that should be in /var/run back to that “no longer linked somewhere else” directory.
Then move everything that should be in /var/lib/ntp also back there from “somewhere else”.
Example /var/run:


> l /var/run/
insgesamt 48
drwxr-xr-x 34 root  root    1060 28. Okt 13:14 ./
drwxr-xr-x 15 root  root    4096 19. Aug 18:03 ../
-rw-r--r--  1 root  root       4 28. Okt 07:39 auditd.pid
prw-------  1 root  root       0 28. Okt 07:39 autofs.fifo-mnt-MyBookWorld|
----------  1 root  root       5 28. Okt 07:39 autofs-running
-rw-r--r--  1 root  root       5 28. Okt 07:39 automount.pid
drwxr-xr-x  2 avahi avahi     80 28. Okt 07:39 avahi-daemon/
----------  1 root  root       0 28. Okt 07:39 cron.reboot
drwxr-xr-x  3 root  lp        80 28. Okt 07:39 cups/
drwxr-xr-x  2 root  root      60 28. Okt 07:39 dbus/
lrwxrwxrwx  1 root  root      16 28. Okt 07:39 displaymanager.pid -> /var/run/kdm.pid
prw-------  1 root  root       0 28. Okt 07:39 dmeventd-client|
-rw-r--r--  1 root  root       4 28. Okt 07:39 dmeventd.pid
prw-------  1 root  root       0 28. Okt 07:39 dmeventd-server|
drwxr-xr-x  2 root  root      40 28. Okt 07:39 fsck/
-rw-r--r--  1 root  root       5 28. Okt 07:39 httpd.pid
drwxr-xr-x  3 root  root      80 28. Okt 07:39 initramfs/
-rw-r--r--  1 root  root       5 28. Okt 07:39 kdm.pid
drwxr-xr-x  2 root  root      60 28. Okt 12:56 libstorage/
drwxrwxr-x  5 root  lock     120 28. Okt 07:39 lock/
drwxr-xr-x  2 root  root      40 28. Okt 07:39 log/
drwx------  3 root  root      80 28. Okt 07:39 lvm/
-rw-r--r--  1 root  root       4 28. Okt 07:39 lvmetad.pid
drwxr-xr-x  2 root  root      80 28. Okt 07:39 mcelog/
drwxr-xr-x  2 root  root      60 28. Okt 07:39 mount/
drwxr-xr-x  4 root  root      80 28. Okt 07:39 netconfig/
drwxr-xr-x  2 root  root      80 28. Okt 07:39 nfs/
drwxr-xr-x  2 root  root     160 28. Okt 07:39 nscd/
drwxr-xr-x  2 root  root      80 28. Okt 07:39 ntp/
-rw-r--r--  1 root  root       0 28. Okt 07:39 numlock-on
drwxr-x---  2 root  root      40 28. Okt 07:39 openvpn/
drwxr-xr-x  2 root  root      60 28. Okt 07:39 pcscd/
drwxr-xr-x  2 root  root      40 28. Okt 07:39 plymouth/
-r--r--r--  1 root  root       0 28. Okt 07:39 rpcbind.lock
srw-rw-rw-  1 root  root       0 28. Okt 07:39 rpcbind.sock=
-rw-r--r--  1 statd nogroup    5 28. Okt 07:39 rpc.statd.pid
drwxr-xr-x  4 root  root     120 28. Okt 07:39 samba/
drwxr-xr-x  2 root  root      40 28. Okt 07:39 screens/
-rw-------  1 root  root       5 28. Okt 07:39 sm-notify.pid
drwxr-xr-x  3 root  root      60 28. Okt 07:39 SuSEfirewall2/
drwxr-xr-x  2 svn   svn       40 28. Okt 07:39 svnserve/
drwxr-xr-x 13 root  root     300 28. Okt 07:39 systemd/
drwxr-xr-x  2 root  root      60 28. Okt 07:39 tmpfiles.d/
drwxr-xr-x  2 root  root      40 28. Okt 07:39 tuned/
drwxr-xr-x  9 root  root     200 28. Okt 12:56 udev/
drwx------  2 root  root      40 28. Okt 08:34 udisks2/
drwxrwxrwt  2 root  root      40 28. Okt 07:39 uscreens/
drwxr-xr-x  3 root  root      60 28. Okt 17:00 user/
-rw-rw-r--  1 root  utmp    3456 28. Okt 16:41 utmp
drwxr-xr-x  2 root  root      40 28. Okt 07:39 vpnc/
drwxr-xr-x  3 root  root     180 28. Okt 07:46 wicked/
drwxr-xr-x  4 root  root      80 28. Okt 07:39 xdmctl/
-rw-r--r--  1 root  root       5 28. Okt 08:40 zypp.pid
>

Cheers

Great, I did like you said and now everything is OK.
All stuff in /var/run is up to date now as well.
Thanks a lot!

bog@bogPC:~> l /var/run/
total 28
drwxr-xr-x 30 root  root   820 Oct 28 18:42 ./
drwxr-xr-x 17 root  root  4096 Oct 28 18:39 ../
srw-rw-rw-  1 root  root     0 Oct 28 18:42 acpid.socket=
-rw-r--r--  1 root  root     4 Oct 28 18:42 auditd.pid
drwxr-xr-x  2 avahi avahi   60 Oct 28 18:42 avahi-daemon/
drwxr-xr-x  2 root  root    80 Oct 28 18:42 ConsoleKit/
----------  1 root  root     0 Oct 28 18:42 cron.reboot
drwxr-xr-x  3 root  lp      80 Oct 28 18:42 cups/
drwxr-xr-x  3 root  root    80 Oct 28 18:42 dbus/
-rw-r--r--  1 root  root     5 Oct 28 18:42 dhclient-eth0.pid
lrwxrwxrwx  1 root  root    17 Oct 28 18:42 displaymanager.pid -> /var/run/lxdm.pid
drwxr-xr-x  2 root  root    40 Oct 28 18:42 fsck/
drwxr-xr-x  2 root  root    60 Oct 28 18:42 initramfs/
drwxrwxr-x  5 root  lock   120 Oct 28 18:42 lock/
drwxr-xr-x  3 root  root    60 Oct 28 18:42 log/
drwx------  3 root  root    60 Oct 28 18:42 lvm/
drwxr-xr-x  2 root  root    80 Oct 28 18:42 lxdm/
-rw-r--r--  1 root  root     3 Oct 28 18:42 lxdm.pid
drwxr-xr-x  2 root  root    80 Oct 28 18:42 mcelog/
drwxr-xr-x  2 root  root    60 Oct 28 18:42 mount/
drwxr-xr-x  2 root  root    60 Oct 28 18:42 netconfig/
drwxr-xr-x  2 root  root    80 Oct 28 18:42 NetworkManager/
drwxr-xr-x  2 root  root   160 Oct 28 18:42 nscd/
lrwxrwxrwx  1 root  root    24 Oct 28 18:42 ntp -> /var/lib/ntp/var/run/ntp/
-rw-r--r--  1 root  root     0 Oct 28 18:42 numlock-on
drwxr-xr-x  2 root  root    60 Oct 28 18:42 pcscd/
drwxr-xr-x  2 root  root    40 Oct 28 18:42 plymouth/
drwxr-xr-x  2 root  root    60 Oct 28 18:42 rsyslog/
-rw-r--r--  1 root  root     4 Oct 28 18:42 rsyslogd.pid
drwxr-xr-x  2 root  root    40 Oct 28 18:42 samba/
drwxr-xr-x  2 root  root    40 Oct 28 18:42 screens/
drwxr-xr-x  3 root  root    60 Oct 28 18:42 SuSEfirewall2/
drwxr-xr-x 14 root  root   320 Oct 28 18:42 systemd/
-rw-r--r--  1 root  root     3 Oct 28 18:42 teamviewerd.pid
drwxr-xr-x  2 root  root    60 Oct 28 18:42 tmpfiles.d/
drwxr-xr-x  2 root  root    40 Oct 28 18:42 tuned/
drwxr-xr-x  9 root  root   200 Oct 28 18:42 udev/
drwx------  2 root  root    40 Oct 28 18:42 udisks2/
drwxrwxrwt  2 root  root    40 Oct 28 18:42 uscreens/
drwxr-xr-x  3 root  root    60 Oct 28 18:42 user/
-rw-rw-r--  1 root  utmp  1152 Oct 28 18:42 utmp



Hello again,

you may need to check everything below /var/lib/ntp/var/run/ntp/ – there my be some “not needed here” stuff lying around . . . >:)

Another thing to check is the systemd nscd status and the PID value in /var/run/nscd/nscd.pid – a ‘ps’ on that PID value should indicate the command “/usr/sbin/nscd”.

And, just noticed now, /var/run/ntp is linked to /var/lib/ntp/var/run/ntp/ – also not a 13.2 thing . . .

> l /var/run/ntp/
insgesamt 8
drwxr-xr-x 2 root root 80 28. Okt 07:39 ./
drwxr-xr-x 34 root root 1060 28. Okt 13:14 …/
-rw-r–r-- 1 root root 4 28. Okt 07:39 ntpd.pid
-rw-r–r-- 1 root root 773 28. Okt 07:39 servers-netconfig
>

Cheers

Thanks for the help, I checked /var/lib/ntp/var/run/ntp/ and it containted only ntp.pid which was OK (PID existed).
But I followed your hint and removed the link and made an empty directory /var/run/ntp which now contains the ntp.pid file. It makes more sense like this.
The nscd.pid also contains a valid PID.

Cheers!