If user has own crontab, results in accumulation of root CRON processes


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers If user has own crontab, results in accumulation of root CRON processes
# 8  
Old 02-09-2010
A point. During testing it is not necessary to run the process every minute. It is quite clear that the script is waiting for input which will never come.


Quote:
/home/woodnt/bin/test_cron > /dev/null 2>&1
What is the contents of the script?


If you run the cron without junking the output (> /dev/null 2>&1) what output is produced in mail for the user of the cron?


The sendmail command above is not correct at all. We can't decode what you intended. What do you want the mail program to do?

What Operating System are you running?
# 9  
Old 02-09-2010
Quote:
Originally Posted by methyl
A point. During testing it is not necessary to run the process every minute. It is quite clear that the script is waiting for input which will never come.




What is the contents of the script?


If you run the cron without junking the output (> /dev/null 2>&1) what output is produced in mail for the user of the cron?


The sendmail command above is not correct at all. We can't decode what you intended. What do you want the mail program to do?

What Operating System are you running?
I'm running Ubuntu 9.10 as noted above.

The test_cron program is just a simple test I wrote. Here is the code:

Code:
#! /bin/bash
#

#if ! type promptYesNo > /dev/null 2>&1 ; then . /home/woodnt/scripts/misc.sh ; fi

FILE=/tmp/cron.log
TIME=`date -d now "+%m-%d-%y@%H%M%S"`
if [ ! -f $FILE ] ; then
    touch $FILE
fi

echo "Hello at $TIME" >> $FILE

When I don't send stdout and stderr to the bit bucket. You get the listing I showed at first. Here is is again:

Code:
root     14693  0.0  0.0  91236  1660 ?        S    Feb05   0:00  \_ CRON
root     14694  0.0  0.0  91244  1160 ?        S    Feb05   0:00  |   \_ CRON
woodnt   14696  0.0  0.0  50152  2800 ?        S    Feb05   0:00  |       \_ /usr/sbin/sendmail -i -FCronDaemon -oem woodnt

Hung at the sendmail request. Here, sendmail is a sym-link to postfix which bsd-mailx installs as it's MTA as a dependency.

I unintentionally left the crontab running overnight rather than commenting it out as I meant too, hehe. I'm impatient and I wanted a couple of iterations to see if stopping the mailto would work.

I started this whole thing just to learn about crontabs and to develop a trust of it.

I would prefer its mailing stuff to me, but the send to bit-bucket was just to see if it were (yes, that is proper English as it is conditional clause Smilie) a sendmail issue. It seems it is not.

Don't have this problem running on other 9.10 boxes or a 9.04 box. I'd love to know what is peculiar about this system.

I don't want to reinstall. I'd rather figure it out to learn linux better and also I wanna fix it just on principle of WHY? Smilie

Narnie
# 10  
Old 02-10-2010
I get it. When cron itself wants to send mail the cron job hangs with a sendmail command stuck in the process list. The more cron jobs the more stuck jobs.

If you have another system which is working, look for differences. Suggest you approach the Operating System authors about known faults.
# 11  
Old 02-10-2010
Quote:
Originally Posted by methyl
I get it. When cron itself wants to send mail the cron job hangs with a sendmail command stuck in the process list. The more cron jobs the more stuck jobs.

If you have another system which is working, look for differences. Suggest you approach the Operating System authors about known faults.
Yep, but even when it is not mailing (setting MAILTO=""), it is hanging at a sh job.

I'm really not sure how to go about looking for the differences on this particular issue.

Has me stumped. Smilie

Narnie
# 12  
Old 02-10-2010
My advice is to cold install using a definitive rehearsed process which has produced good systems. It is advisible to do a thorough hardware check before loading the Operating System in case this is a duff computer.
# 13  
Old 02-10-2010
Quote:
Originally Posted by methyl
My advice is to cold install using a definitive rehearsed process which has produced good systems. It is advisible to do a thorough hardware check before loading the Operating System in case this is a duff computer.
Boy I hate to do that if I don't have to because I have done so much to the system.

Now that I'm thinking about it, it seems I had set up ssmtp to do mail from the command line via google (I guess I'm turning into too much of a CL junkie). Then when I noticed I wasn't getting mail from cron and the accumulated, then that is when I uninstalled ssmtp, then installed bsd-mailx+postfix.

I will upgrade to Ubuntu 10.4 LTS in a couple of months, so if this doesn't get figured out then, I'll likely wait to reinstall and just do a temp fix by making a cron job that runs every 30 mins or so to restart the cron service, which I have found will remove all the cron zombie processes.

I'd still like to know why and fix it, but perhaps it is a lost cause.

Narnie

ps, regardless, this has been a great learning processes Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Is CRON only for root user

Hi, i have question about cron. can we have user based cron file under /var/spool/cron or we should have only root file which can only be accessed by root user or admin and he should only be doing the task of scheduling. PKS (8 Replies)
Discussion started by: praveenkumar198
8 Replies

2. Shell Programming and Scripting

CRON JOB not running - for tape backup from root user

I am trying a cron on root user to backup to tape using TAR command here is the cron entry 11 08 * * 6 /erdhot1cron 2>&1 >> /test3/scripts/dba/erdhot1cron.log here is script inside - edhot1cron #!/bin/bash vsysdt=`date +%d%m%y` date tar -cvf /dev/st0... (4 Replies)
Discussion started by: vijaymec50
4 Replies

3. Solaris

Bad user root in crontab

Hi everyone, I got error which is "!bad user (root)" in crontab... I tried changing password, I checked etc/cron/cron.allow and cron.deny, And also I checked the permissions of my files, its(my crontab script) still not working.... Please help... (12 Replies)
Discussion started by: ijustneeda
12 Replies

4. UNIX for Dummies Questions & Answers

Sudo to delegate permission from non-root user to another non-root user

I've been through many threads before i decide to create a separate thread. I can't really find the solution to my (simple) problem. Here's what I'm trying to achieve: As "canar" user I want to run a command, let's say "/opt/ocaml/bin/ocaml" as "duck" user. The only to achieve this is to... (1 Reply)
Discussion started by: canar
1 Replies

5. UNIX for Dummies Questions & Answers

Editing crontab of non-root user from file

Hi All, Ref: "build crontab from a text file" in same forum. (I am not allowed to post URL's in the first post) We are reorganizing our UNIX Crontab file by first making changes in a word pad text file. The intent is to then copy it back to Crontab. Will this work? Copy and Paste does not... (6 Replies)
Discussion started by: nivedhitha
6 Replies

6. Shell Programming and Scripting

Cron job initiating ssh AND sudo (from user, not root)

I've been bashing my head on the desk for 2 days trying to get this to work, but I've had no luck. I'll try to be as clear as possible in my explanation without dragging out the details. I'm trying to set up a cron job for user "john" which runs a script. This script initiates an ssh connection to... (5 Replies)
Discussion started by: eh3civic
5 Replies

7. Solaris

"! bad user (root)" in cron log

I am getting the following error in the cron log: ! bad user (root) Wed Sep 22 14:30:00 2010 < root 8989 c Wed Sep 22 14:30:00 2010 rc=1 What does this mean? (5 Replies)
Discussion started by: jastanle84
5 Replies

8. AIX

Crontab cannot run by non-root user

Good morning everybody. I have just receiedv a complaint from our DBA saying that if he create a scripts to run some Oracle performance scripts using crontab and the scheduling part is ok but the job is failed when I checked on /var/adm/cron/log. I have tried his scripts using Oracle id directly... (4 Replies)
Discussion started by: kwliew999
4 Replies

9. UNIX for Dummies Questions & Answers

Possible to give non root user sudo to "crontab -l"

Does anyone know if this is possible? I want to give some users access to root's crontab but only with a read privilege. Is this possible to do or can only root or people with full root sudo view root's cron? (4 Replies)
Discussion started by: LordJezoX
4 Replies

10. Linux

How to receive results from processes spawned on external machines using SSH

I am trying to get the number of cpus on a farm of linux boxes (about 100 of them) by 'sshing' to each of them and checking their /proc/cpuinfo file. So I have a local script localscript.sh on each of those 100 machines which retrieves the number of cpus in it by using its /proc/cpuinfo file.... (1 Reply)
Discussion started by: waavman
1 Replies
Login or Register to Ask a Question