Go Back   openSUSE Forums > Archives > SF Archives > ARCHIVES - Programming & Scripting
Forums FAQ Members List Search Today's Posts Mark Forums Read


ARCHIVES - Programming & Scripting A place to discuss website design, programming, shell scripts, etc

 
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 22-May-2008, 08:39
pbrunnen
Guest
 
Posts: n/a
Arrow

Hello everyone,

I am running openSuSE v10.2, cron-4.1-68, and an application that I use creates a user crontab file (/var/spool/cron/tabs). The problem is that the crontab is not running anymore.

I added a date command piped to a file every 30 min. to see if cron is running my scripts, which it is not.

I prod cron by both 'crontab -u [username] -e' adding a blank line to the top forcing a save and a 'rccron restart'. It may run for a while but then give up, or not run at all.

When I add entries into the /etc/crontab file directly, there are no issues at all and everything runs smooth... but then I am constantly making manual changes to etc/crontab when my application changes its user crontab.

There must be a reason for this... I can't find anything in the logs either that suggest a syntax issue or such. Any suggestions??

Thanks ever so much!
-Cheers, Peter.
  #2 (permalink)  
Old 22-May-2008, 08:43
ken_yap
Guest
 
Posts: n/a
Default

Remember that the syntax of user crontabs differs from root crontabs.

/etc/crontab and crontabs in /etc/cron.d look like this:

0 0 * * * root command arg1 arg2 ...

User crontabs created by crontab -e look like this:

0 0 * * * command arg1 arg2

Basically users have no option to run as anybody except themselves, whereas root crontabs can switch users.
  #3 (permalink)  
Old 22-May-2008, 09:00
pbrunnen
Guest
 
Posts: n/a
Default

ken_yap,

Thanks for the response...

Yes, that is the format that I am using. Here is my date command for checking:
* * * * * date >/data/zimbra_cront.lst

For instance, my date file shows that the crons last ran yesterday around 11:34pm. I did an rccron restart this morning and its running again, but I don't know when it will stop.

Thanks.

-Cheers, Peter.
  #4 (permalink)  
Old 22-May-2008, 09:33
ken_yap
Guest
 
Posts: n/a
Default

Before you restart the cron service, check if /usr/sbin/cron is running. If it is, do a strace on the process id to see what it's doing, why it's stuck.
  #5 (permalink)  
Old 22-May-2008, 13:42
pbrunnen
Guest
 
Posts: n/a
Post

Will do...

Right now its not hanging (seeing as I am watching it like a hawk)... but I will try and catch it in the act (or lack of act)...

Thanks. -Cheers, Peter.
  #6 (permalink)  
Old 23-May-2008, 17:24
pbrunnen
Guest
 
Posts: n/a
Default

Well, it died again last night... my file contains 'Fri May 23 00:14:01 EDT 2008'

The process was dead. Again, nothing noticeable in the logs... arg.
I will look to see what runs at that time.

-Cheers, Peter.
  #7 (permalink)  
Old 23-May-2008, 17:34
ken_yap
Guest
 
Posts: n/a
Default

Attach a strace to the running cron to see what why it dies.
  #8 (permalink)  
Old 26-May-2008, 16:27
pbrunnen
Guest
 
Posts: n/a
Exclamation

Omg... :blink:
ken_yap... Thank you ever so much and so sorry for wasting your time. I feel like hitting myself with a stupid bottle. It was my (very stupid) bad.

I was digging in the wrong hole. I ran strace like you mentioned, several times I might add, because I could not figure why cron was getting a kill signal. Well, my stupidity... to work around an application bug I was restarting syslog-ng in another crontab... or so I thought. For the syslog restart line I had entered cron... so I basically had a line that killed cron. I just am in awe of this...

Me thinks a vacation is in order... ohi.

Thanks ever again for your help.
-Cheers, Peter.
  #9 (permalink)  
Old 26-May-2008, 17:13
ken_yap
Guest
 
Posts: n/a
Default

Don't worry about it. We all do this sort of thing sometime. It's human.
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2