LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 12-12-2011, 04:57 AM   #1
mike11
Member
 
Registered: Apr 2009
Posts: 222

Rep: Reputation: 17
cron errors: failed with exit status 1


Hello,

I've recently installed the latest debian stable, and now my cron file isn't working (it was working fine before the installation). It contains lines which invoke zenity to produce popup messages, for example:
Code:
00 12 * * * zenity --info --text "hello" --display=:0.0
/var/log/syslog shows errors of the form:
Code:
Dec 12 19:47:01 mike /USR/SBIN/CRON[13583]: (CRON) error (grandchild #13552 failed with exit status 1)
zenity works fine from the CLI.

Any ideas?

TIA,
Mike
 
Old 12-12-2011, 05:55 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Just my

1. Are you sure the cron message is related to your job? I see no direct relationship between the posted crontab and the log. Be sure by checking the timestamp of the log and your actual crontab.

2. Is display :0.0 running/assigned at the time of the job execution?

3. I'd check also the scripts in /etc/cron.d, /etc/cron.hourly, /etc/cron.daily etc. to see if one of them is faulty due to the recent upgrade. For example, someone reported that /etc/cron.d/update-motd no longer works, since its functionality has been integrated into pam_motd module.
 
Old 12-12-2011, 06:57 PM   #3
mike11
Member
 
Registered: Apr 2009
Posts: 222

Original Poster
Rep: Reputation: 17
Thanks for replying.

It's definitely my cron jobs which invoke zenity, as /var/log/syslog shows:
Code:
Dec 13 09:55:01 mike /USR/SBIN/CRON[2837]: (mike) CMD (zenity --info --text "a" --display=:0.0)
Dec 13 09:55:01 mike /USR/SBIN/CRON[2836]: (CRON) error (grandchild #2837 failed with exit status 1)
Dec 13 09:55:01 mike /USR/SBIN/CRON[2836]: (mike) END (zenity --info --text "a" --display=:0.0)
 
Old 12-12-2011, 09:33 PM   #4
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
In the past, 99% of my cron job problems were caused because I always forgot to include full paths to commands in the cron specification.

Your cron job references "zenity" without a path. The command won't be found unless you've taken additional steps in your cron job file to define PATH.

If memory serves, cron executes its jobs in non-interactive shells. In non-interactive shells, not all the "normal" startup files are read. Among those omitted startup files are usually the ones where people define/modify PATH.

Unless you are 100%, absolutely positive that the PATH environment variable is not the issue, then just add the full path to zenity for giggles. On my system, it's located at:

/usr/bin/zenity
 
Old 12-12-2011, 09:43 PM   #5
mike11
Member
 
Registered: Apr 2009
Posts: 222

Original Poster
Rep: Reputation: 17
Thanks for replying.

The problem was due to zenity being unable to access the xserver, which was never an issue before the recent debian stable version.

Adding this line to .bashrc solved the problem:
Code:
xhost local:mike
and the following line works fine in crontab, that is, a pop-up appears:
Code:
00 12 * * * zenity --info --text "some message"  --display=:0.0
 
  


Reply



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
error: command 'gcc' failed with exit status 1 yuri16 Linux - Software 1 04-21-2009 01:27 AM
Exit status vedanu Programming 4 06-23-2007 05:13 PM
Duplicate librsvg2 packages - removal causes scriplet failed - exit status 1 trekk Fedora 2 11-08-2006 06:42 PM
pppd errors out with exit status 17 payyakkil Linux - Networking 1 06-06-2005 01:39 AM
exit status naflan Programming 2 10-22-2004 12:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:52 AM.

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
Open Source Consulting | Domain Registration