LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-23-2007, 07:37 PM   #1
Plastech
Member
 
Registered: Jul 2006
Posts: 63

Rep: Reputation: 15
Cron on debian won't actually do anything!!! Please help!


My cron setup on debian seems to be configured properly but won't actually run anything. Here are the diagnostics I have come up with on my own....

1) Running date shows that the clock is setup properly
2) Running "ps aux | grep cron" returns two results
Code:
root .......  /usr/sbin/cron
frame .......  grep cron
3) I put the following at the head of my cron
Code:
MAILTO=""
* * * * * echo "foobar"
And haven't gotten any output in the past 15 minutes....

Any ideas?

Thanks,
TotallyNewbtastic Plastech
 
Old 05-23-2007, 08:04 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Where would you expect the output to go?

Try
Code:
* * * * * echo "foobar" >> /tmp/running

Cheers,
Tink
 
Old 05-23-2007, 08:09 PM   #3
Plastech
Member
 
Registered: Jul 2006
Posts: 63

Original Poster
Rep: Reputation: 15
And that's why I'm retarded. Thanks.
 
Old 05-23-2007, 08:13 PM   #4
Plastech
Member
 
Registered: Jul 2006
Posts: 63

Original Poster
Rep: Reputation: 15
Hmm...now my problem seems to be that cron doesn't run the scripts as the user but as a sort of anonymous account. Is there a way around this?
 
Old 05-23-2007, 08:16 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
And that's why I'm retarded. Thanks.
Not retarded .... "not yet very experienced" :}


Cheers,
Tink
 
Old 05-23-2007, 08:17 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally Posted by Plastech
Hmm...now my problem seems to be that cron doesn't run the scripts as the user but as a sort of anonymous account. Is there a way around this?
How did you edit crontab?

As the system user you need for the frame, doing
crontab -e
?


Cheers,
Tink
 
Old 05-23-2007, 08:32 PM   #7
Plastech
Member
 
Registered: Jul 2006
Posts: 63

Original Poster
Rep: Reputation: 15
Yes, logged in as "frame" ran crontab -e. Cron then launches a shell script which ends with "startx" (which really just starts a feh slideshow thanks to .xsession settings). Trouble is, when the shell script is called with cron, I get:

Code:
xauth: creating new authority file /home/frame/.serverauth.4008

X: user not authorized to run the X server, aborting.
giving up.
xinit:  Connection refused (errno 111): unable to connect to X server
xinit:  No such process (errno 3):  Server error.
Couldnt get a file descriptor referring to the console
 
Old 05-23-2007, 08:42 PM   #8
Plastech
Member
 
Registered: Jul 2006
Posts: 63

Original Poster
Rep: Reputation: 15
Do you think I ought to start a new thread about this?

Okay I will....I'll post in the general forum. Thanks for solving my other problem, though.

Last edited by Plastech; 05-23-2007 at 08:48 PM.
 
Old 05-23-2007, 09:06 PM   #9
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally Posted by Plastech
Yes, logged in as "frame" ran crontab -e. Cron then launches a shell script which ends with "startx" (which really just starts a feh slideshow thanks to .xsession settings). Trouble is, when the shell script is called with cron, I get:

Code:
xauth: creating new authority file /home/frame/.serverauth.4008

X: user not authorized to run the X server, aborting.
giving up.
xinit:  Connection refused (errno 111): unable to connect to X server
xinit:  No such process (errno 3):  Server error.
Couldnt get a file descriptor referring to the console
I don't think an other thread is called for :}

That said: can the user run startx from the shell? And what does the
cron entry for this look like now?


Cheers,
Tink
 
Old 05-23-2007, 09:13 PM   #10
Plastech
Member
 
Registered: Jul 2006
Posts: 63

Original Poster
Rep: Reputation: 15
Well, I didn't fix the problem, but I sort of hacked it. I guess the startx command needed to go through the console, which apparently it doesn't in cron. I changed /etc/X11/Xwrapper.config to allow anyone (not just the console) to startx, and now it is working. Problem of course is that whole security business.....
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cron not working from crontab nor form /etc/cron/cron.d. What did SuSE change? JZL240I-U SUSE / openSUSE 11 01-04-2007 02:57 AM
Cronjob not firing off on debian systemwide cron rsvirani Debian 4 11-07-2006 07:59 AM
Can any one plz explain why/what for cron.d, cron.daily, cron.weekly etc are there. mavinashbabu Linux - Newbie 4 09-21-2006 02:50 PM
scheduling monthly job in cron from debian sarge 3.1 sridhar11 Debian 2 10-28-2005 10:03 AM
Cron/Anacron Not Working - Debian Sarge br00tal Debian 2 10-10-2005 07:41 PM


All times are GMT -5. The time now is 12:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration