Showing posts with label cron. Show all posts
Showing posts with label cron. Show all posts

Thursday, February 28, 2008

housekeeping core files

since i've enabled the coreadm for all my solaris servers, i keep getting alerts on file systems full cause of fill up by those core files.



# coreadm
global core file pattern: /var/cores/%f.%n.%p.core
init core file pattern: core
global core dumps: enabled
per-process core dumps: enabled
global setid core dumps: enabled
per-process setid core dumps: enabled
global core dump logging: enabled




so i came out with this 1 liner. put in the crontab. problem solved ;)

# cd /var/cores; find . -type f -name \*core ! -name \*.gz -mtime +1 -exec gzip {} \;

find . - find files in the current directory
-type f - find only file type, not directory or link
-name \*core - find only *core filename
! -name \*.gz - skip the .gz files
-mtime +1 - files before today's date
-exec gzip {} - gzip the files

go here on how to enable the core dump: http://docs.sun.com/app/docs/doc/820-0434/6nc63qo4r?a=view

Wednesday, April 12, 2006

crond ORPHAN (no passwd entry) error message

one of the users complaining that his cron job is not running. upon checking at the cron log, i found these errors:
Apr 5 01:20:00 my_server_name crond[19123]: (username) RELOAD (cron/username)
Apr 5 01:20:00 my_server_name crond[19123]: ( tmp.7440) ORPHAN (no passwd entry)
Apr 5 01:20:00 my_server_name crond[19123]: (tmp.16094) ORPHAN (no passwd entry)
Apr 5 01:20:00 my_server_name crond[19123]: (tmp.16095) ORPHAN (no passwd entry)
Apr 5 01:28:00 my_server_name crond[19123]: (username) RELOAD (cron/username)
Apr 5 01:28:00 my_server_name crond[19123]: (tmp.7440) ORPHAN (no passwd entry)
Apr 5 01:28:00 my_server_name crond[19123]: (tmp.16094) ORPHAN (no passwd entry)
Apr 5 01:28:00 my_server_name crond[19123]: ( tmp.16095) ORPHAN (no passwd entry)

and somehow there are a lot of crond processes:
# ps aux|grep -i cron
root 18855 0.0 0.0 4100 1844 ? D 01:16 0:00 CROND
root 18856 99.9 0.0 4100 1844 ? R 01:16 2:07 CROND
root 18922 0.0 0.0 4100 1844 ? D 01:17 0:00 CROND
root 18923 99.9 0.0 4100 1844 ? R 01:17 1:08 CROND
root 19123 0.0 0.0 4104 1828 ? S 01:18 0:00 crond
root 19863 0.0 0.0 4104 1844 ? S 01:19 0:00 CROND
root 19917 0.0 0.0 4104 1844 ? S 01:20 0:00 CROND
Read more...
after some googling, i found out this error normally because of the user doesn't exist in /etc/passwd
but the user is exist in the /etc/passwd, so should be no problem then!
back to google & google & google again and the solution is - if your servers are integrated with LDAP or AD you better make sure you are using nscd service as well.
in my case we are using AD but the nscd process is not running, somehow dead! start the nscd service & the cron jobs are working fine now.
lesson learnt - make sure all the processes that you expect to be running, all are running well.
in case you not sure what nscd is, here is the man page:
# man nscd
nscd(8) nscd(8)

NAME
/usr/sbin/nscd - name service cache daemon

DESCRIPTION
Nscd is a daemon that provides a cache for the most common name service
requests. The default configuration file, /etc/nscd.conf, determines
the behavior of the cache daemon. See nscd.conf(5).

Nscd provides cacheing for the passwd(5), group(5), and hosts(5)
databases through standard libc interfaces, such as getpwnam(3),
getp-wuid(3), getgrnam(3), getgrgid(3), gethostbyname(3), and others.
Each cache has a separate TTL (time-to-live) for its data; modifying the
local database (/etc/passwd, and so forth) causes the cache to become
invalidated within fifteen seconds. Note that the shadow file is
specifically not cached. getspnam(3) calls remain uncached as a
result.