Stopping pwgrd (password daemon)

The password daemon (pwgrd) was created to manage massively large password file (more than 500 logins). Essentially, it performed caching activities of the /etc/passwd file so that commands like ls -l would excute quickly. But historically, it has had a number of problems with consuming excessive CPU time due to bugs in the code and unless absolutely necessary, it is recommended to be turned off in /etc/rc.config.d/pwgr:

PWGR=0

Then stop pwgrd with this command:

/sbin/init.d/pwgr stop

So far, so good. Unfortunately, libc, the primary Unix library used by virtually every program, will continue creating socket device files in /var/spool/sockets/pwgr forever. The pwgrd daemon would normally cleanup the old and unused socket files but since it is not running, the socket files continue to be created. After a few weeks or months, there may be thousands of these files, all named “client####“. While you can try: rm /var/spool/sockets/pwgr/*, you may receive an error message that the command line is too long. Or the removal could take several minutes.

The faster method is to first remove the pwrgd status file in /var/spool/pwgr/. Then remove the entire directory /var/spool/sockets/pwgr/, like this:

rm /var/spool/pwgr/status
rm -rf /var/spool/sockets/pwgr

To re-enable pwgrd on this system, follow these steps:

touch /var/spool/pwgr/status
chmod 644 /var/spool/pwgr/status
chown root:sys /var/spool/pwgr/status
mkdir /var/spool/sockets/pwgr
chmod 1777 /var/spool/sockets/pwgr
chown root:sys /var/spool/sockets/pwgr

Then edit /etc/rc.config.d/pwrg to change this line =1:

   PWGR=1

And restart pwgrd with:

/sbin/init.d/pwgr start

– See more at: http://serviceitdirect.com/blog/stopping-pwgrd-password-daemon#sthash.tz5bcA3h.dpuf


Tags: