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
# 1  
Old 02-06-2010
If user has own crontab, results in accumulation of root CRON processes

Hello,

I seem to be having a problem with accumulation of root CRON jobs occuring when I have a user's cron job(s) running.

Here is an example of a user's crontab file:

Code:
*/1    *    *    *    *    echo "hello" > /dev/null

Code:
ps aux|grep CRON
root     14333  0.0  0.0  91236  2172 ?        S    21:44   0:00 CRON
root     14334  0.0  0.0  91244  1284 ?        S    21:44   0:00 CRON
root     14366  0.0  0.0  91236  2172 ?        S    21:45   0:00 CRON
root     14367  0.0  0.0  91244  1284 ?        S    21:45   0:00 CRON
root     14375  0.0  0.0  91236  2172 ?        S    21:46   0:00 CRON
root     14377  0.0  0.0  91244  1284 ?        S    21:46   0:00 CRON
root     14386  0.0  0.0  91236  2172 ?        S    21:47   0:00 CRON
root     14387  0.0  0.0  91244  1284 ?        S    21:47   0:00 CRON
root     14396  0.0  0.0  91236  2172 ?        S    21:48   0:00 CRON
root     14397  0.0  0.0  91244  1284 ?        S    21:48   0:00 CRON
root     14423  0.0  0.0  91236  2172 ?        S    21:49   0:00 CRON
root     14424  0.0  0.0  91244  1284 ?        S    21:49   0:00 CRON
root     14471  0.0  0.0  91236  2172 ?        S    21:50   0:00 CRON
root     14472  0.0  0.0  91244  1284 ?        S    21:50   0:00 CRON
root     14482  0.0  0.0  91236  2172 ?        S    21:51   0:00 CRON
root     14483  0.0  0.0  91244  1284 ?        S    21:51   0:00 CRON
root     14693  0.0  0.0  91236  2172 ?        S    22:04   0:00 CRON
root     14694  0.0  0.0  91244  1284 ?        S    22:04   0:00 CRON
root     14727  0.0  0.0  91236  2172 ?        S    22:07   0:00 CRON
root     14728  0.0  0.0  91240  1252 ?        S    22:07   0:00 CRON
root     14736  0.0  0.0  91236  2172 ?        S    22:08   0:00 CRON
root     14737  0.0  0.0  91240  1252 ?        S    22:08   0:00 CRON
root     14746  0.0  0.0  91236  2172 ?        S    22:09   0:00 CRON
root     14747  0.0  0.0  91240  1252 ?        S    22:09   0:00 CRON
root     15129  0.0  0.0  91236  2172 ?        S    22:10   0:00 CRON
root     15130  0.0  0.0  91240  1252 ?        S    22:10   0:00 CRON
root     15166  0.0  0.0  91236  2172 ?        S    22:11   0:00 CRON
root     15167  0.0  0.0  91240  1252 ?        S    22:11   0:00 CRON
root     15178  0.0  0.0  91236  2172 ?        S    22:12   0:00 CRON
root     15179  0.0  0.0  91240  1252 ?        S    22:12   0:00 CRON
root     15267  0.0  0.0  91236  2172 ?        S    22:13   0:00 CRON
root     15268  0.0  0.0  91240  1252 ?        S    22:13   0:00 CRON
root     15276  0.0  0.0  91236  2172 ?        S    22:14   0:00 CRON
root     15277  0.0  0.0  91240  1252 ?        S    22:14   0:00 CRON

Each of the CRONs have to do with running the user's crontab file as evidenced by from the /var/log/syslog:

Code:
Feb  5 22:14:01 toshiba-laptop CRON[15278]: (woodnt) CMD (echo "hello" > /dev/null)

When I delete the offending crontab, of course, all the root CRON jobs accumulating but don't go away without being killed.

I can find nothing to make them go away short of a script killing the processes by IDs.

Any idea how/why this is happening and how to stop it?

Yours,
Narnie

---------- Post updated at 10:27 PM ---------- Previous update was at 10:21 PM ----------

BTW,

It seems root nor the user are getting emails on the crontab jobs being run.

Yours,
Narnie

Last edited by Narnie; 02-07-2010 at 05:59 PM.. Reason: added clarification
# 2  
Old 02-06-2010
I wonder if it is something to do with the use of:
Code:
*/1

where all you need for the minutes value is:
Code:
*

in order to run the job every minute?
# 3  
Old 02-06-2010
According to the info I read, ubuntu is set up for running cron at log level 1, which will send an email that the process was run or when there is an error.

I have run it on another computer without any problems, too.

I'm running 9.10

I have deleted the mailx program to see if it is hanging on the sendmail.
It tries to send the mail, but then there is no process and it seems to hang there.

This is a ps auxf with bsd-mailx (which depends postfix):

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

This is with mailx/postfix unintalled:

Code:
root     31543  0.0  0.0  91236  2196 ?        S    17:47   0:00  \_ CRON
root     31544  0.0  0.0  91240  1272 ?        S    17:47   0:00      \_ CRON
woodnt   31545  0.0  0.0      0     0 ?        Zs   17:47   0:00          \_

Hence my belief that it has to do with mailing and cron jobs.

I've tried to run this in a terminal:

Code:
/usr/sbin/sendmail -i -Fwoodnt -oem woodnt

but never got a prompt back without Ctrl-C

Any other ideas from anyone?

Narnie
# 4  
Old 02-07-2010
Quote:
Originally Posted by TonyFullerMalv
I wonder if it is something to do with the use of:
Code:
*/1

where all you need for the minutes value is:
Code:
*

in order to run the job every minute?
I agree. The crontab syntax "*/1" should be changed to "*".
# 5  
Old 02-08-2010
Quote:
I've tried to run this in a terminal:

Code:
/usr/sbin/sendmail -i -Fwoodnt -oem woodnt

but never got a prompt back without Ctrl-C

Any other ideas from anyone?
Well no wonder cron is getting stuck then...

I tend to use mailx rather than sendmail directly when scripting, e.g. to send a mail message:
Code:
$ mailx -s "Subject heading" user@domain.com < message_file.txt

What are you trying to achieve with sendmail, and what Unix are you using, I do not see a -i option for sendmail on the manpage I am looking at?
# 6  
Old 02-08-2010
Quote:
Originally Posted by TonyFullerMalv
Well no wonder cron is getting stuck then...

I tend to use mailx rather than sendmail directly when scripting, e.g. to send a mail message:
Code:
$ mailx -s "Subject heading" user@domain.com < message_file.txt

What are you trying to achieve with sendmail, and what Unix are you using, I do not see a -i option for sendmail on the manpage I am looking at?
I've come to realize that the sendmail package isn't installed.

It is just a symbolic link to postfix set up by installing bsd-mailx.

I have changed my crontab to

Code:
MAILTO=""
#m      h       dom     mon     dow     command
*       *       *       *       *       /home/woodnt/bin/test_cron > /dev/null 2>&1

Check out this ps output after doing that:

Code:
root      1446  0.0  0.0  18708   996 ?        Ss   18:48   0:00 cron
root      3631  0.0  0.0  91236  2188 ?        S    18:56   0:00  \_ CRON
root      3632  0.0  0.0  91240  1264 ?        S    18:56   0:00  |   \_ CRON
woodnt    3633  0.0  0.0      0     0 ?        Zs   18:56   0:00  |       \_ [sh] <defunct>
root      3720  0.0  0.0  91236  2188 ?        S    18:57   0:00  \_ CRON
root      3721  0.0  0.0  91240  1264 ?        S    18:57   0:00  |   \_ CRON
woodnt    3722  0.0  0.0      0     0 ?        Zs   18:57   0:00  |       \_ [sh] <defunct>
root      3752  0.0  0.0  91236  2188 ?        S    18:58   0:00  \_ CRON
root      3753  0.0  0.0  91240  1264 ?        S    18:58   0:00  |   \_ CRON
woodnt    3754  0.0  0.0      0     0 ?        Zs   18:58   0:00  |       \_ [sh] <defunct>
root      3784  0.0  0.0  91236  2188 ?        S    18:59   0:00  \_ CRON
root      3785  0.0  0.0  91240  1264 ?        S    18:59   0:00  |   \_ CRON
woodnt    3786  0.0  0.0      0     0 ?        Zs   18:59   0:00  |       \_ [sh] <defunct>
root      4155  0.0  0.0  91236  2188 ?        S    19:11   0:00  \_ CRON
root      4156  0.0  0.0  91240  1264 ?        S    19:11   0:00  |   \_ CRON
woodnt    4157  0.0  0.0      0     0 ?        Zs   19:11   0:00  |       \_ [sh] <defunct>
root      4181  0.0  0.0  91236  2188 ?        S    19:12   0:00  \_ CRON
root      4182  0.0  0.0  91240  1264 ?        S    19:12   0:00  |   \_ CRON
woodnt    4183  0.0  0.0      0     0 ?        Zs   19:12   0:00  |       \_ [sh] <defunct>
root      4209  0.0  0.0  91236  2188 ?        S    19:13   0:00  \_ CRON
root      4210  0.0  0.0  91240  1264 ?        S    19:13   0:00  |   \_ CRON
woodnt    4211  0.0  0.0      0     0 ?        Zs   19:13   0:00  |       \_ [sh] <defunct>
root      4891  0.0  0.0  91236  2188 ?        S    19:14   0:00  \_ CRON
root      4892  0.0  0.0  91240  1264 ?        S    19:14   0:00  |   \_ CRON
woodnt    4893  0.0  0.0      0     0 ?        Zs   19:14   0:00  |       \_ [sh] <defunct>
root      5469  0.0  0.0  91236  2188 ?        S    19:15   0:00  \_ CRON

# 7  
Old 02-09-2010
You still have not answered the question "What are you trying to achieve with postfix?"
and a new one:
What does the script contain?
 
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