Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 12-12-2011, 05:57 AM   #1
Registered: Apr 2009
Posts: 222

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


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:
00 12 * * * zenity --info --text "hello" --display=:0.0
/var/log/syslog shows errors of the form:
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?

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

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
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, 07:57 PM   #3
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:
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, 10:33 PM   #4
Senior Member
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
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:

Old 12-12-2011, 10:43 PM   #5
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:
xhost local:mike
and the following line works fine in crontab, that is, a pop-up appears:
00 12 * * * zenity --info --text "some message"  --display=:0.0


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

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

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