1753545 Members
5700 Online
108795 Solutions
New Discussion юеВ

Re: strange crond

 
Jack Fan
Regular Advisor

strange crond

My server running with RedHat Linux advanced 4.0 release6 6.
I found the two crond process in my server.
new one is created by old one crond. Is it normal?

The crontab job seems running well with no problem even two crond process running.
7 REPLIES 7
Vitaly Karasik_1
Honored Contributor

Re: strange crond

It seems me normal.

You can investigate system crontab jobs by reviewing /etc/cron.*/ directories.
Matti_Kurkela
Honored Contributor

Re: strange crond

When crond starts a new process for running a cron job, it uses the standard Unix process creation procedure.

First the crond process duplicates itself using a fork(2)/vfork(2) system call.
Then the new copy will switch its identity to to the owner of the cron job and prepare the environment. After the environment is set up, the new copy will replace itself with a shell that runs the actual cron job, using one of the exec(3) family of functions.

Meanwhile, the parent crond process will log that the cron job has been started, and will wait for the SIGCHLD signal that indicates job completion, or start other cron jobs as necessary.

If you grabbed your process list at exactly the right moment, you may have caught the crond in the process of forking itself.

If the child crond remains listed as "crond" for a while, the environment set-up may be delayed for some reason:
- if NIS or LDAP is used, is the NIS/LDAP server responding?
- if the user's home directory is on NFS, is the NFS server responding?
- is the binary or script that the cron job is supposed to run on a NFS filesystem? Is it accessible?
- if the filesystems involved are not NFS, are your disks OK? A failing disk can sometimes cause a disk operation to retry forever, causing a process that requested it to hang.

MK
MK
Jack Fan
Regular Advisor

Re: strange crond

Matti,
Got your point, and give you points for your feedback.

I have checked back to my crontab configuration, it alwasy occurred on one job which will backup files to remote file systems.

What can I do next?
Matti_Kurkela
Honored Contributor

Re: strange crond

Try to login/su - to the account that has the cron job. Does it happen normally, or does it delay excessively/hang?

Examine the filesystem that contains the home directory of that user. Is it working OK?

Do you see any error messages in the system logs? (output of "dmesg", log files in /var/log)

MK
MK
Jack Fan
Regular Advisor

Re: strange crond

Matti,
No error from dmesg.
Further information for your reference.

1) This 2nd crond issue generated by root's cron job.

2) I use this root account start backup script to backup Oracle database.

3) The backup script will perform su oracle to start RMAN backup database.

Does this su oracle to casue problem?
Matti_Kurkela
Honored Contributor

Re: strange crond

The "two crond's" is a normal situation, but normally it is only temporary and happens so fast you are unlikely to notice it unless you specifically watch for it.

The database backup job is apparently running, but is it *finishing*? Or does it leave a script or some other process running in an infinite loop?

The cron job normally attempts to send the job output as email to the job's owner. Maybe the root's inbox (/var/mail/root) has grown huge from accumulated cron job outputs and needs some serious trimming?
*Can* your root account successfully send email to itself? Test with:

echo "Test message" | mail root
or
echo "Test message" | mailx root

What's the load level of your system?

If your system is extremely busy when the backup process is supposed to start, it might take a while for the child crond process to load & start the su command.

How exactly did you detect this "problem"? Have you actually seen it in the "ps" listing, or is this from alerts produced by some monitoring system?

If you can see it in the "ps" listing (and it does not go away before you can run another command), run "ps axf" to see the process listing in a tree form. If the child crond process has children of its own, examine them.

MK
MK
Jack Fan
Regular Advisor

Re: strange crond

Matti,

yes, this cron daemon process issue detected by OVO (OpenView Operations).

It says "more cron process exceed 2"