You are not logged in.

#1 2010-05-22 21:48:05

monsieur moche
Member
From: France
Registered: 2009-10-14
Posts: 50

Cron issue : exit status 1 from user XXX

Hi Archers,

I have to take medicines at a set time.
I configured Cron to send me visual notifications (by using Gnome's notify-send command):

florian@flobox:~$ sudo cat /var/spool/cron/florian 
Password: 
0 21 * * * notify-send -t 0 "Médicaments" # JOB_ID_1
0 9 * * * notify-send -t 0 "Médicaments" # JOB_ID_2
0 12 * * * notify-send -t 0 "Médicaments" # JOB_ID_3

I can't see any notification at these times.

However, crond is started (since it's in the rc.conf's deamon list):

florian@flobox:~$ ps -A | grep cron
 2063 ?        00:00:00 crond

The logs signal an error:

florian@flobox:~$ sudo tail /var/log/crond.log
Password: 
May 22 15:34:47 flobox crond[2063]: /usr/sbin/crond 4.4 dillon's cron daemon, started with loglevel info
May 22 15:35:01 flobox crond[2063]: FILE /var/spool/cron/root USER root PID 2479 job sys-hourly
May 22 17:35:01 flobox crond[2063]: FILE /var/spool/cron/root USER root PID 7436 job sys-hourly
May 22 19:35:01 flobox crond[2063]: FILE /var/spool/cron/root USER root PID 11989 job sys-hourly
May 22 21:00:01 flobox crond[2063]: FILE /var/spool/cron/florian USER florian PID 15132 notify-send -t 0 "Médicaments" # JOB_ID_1
May 22 21:00:01 flobox crond[2063]: exit status 1 from user florian notify-send -t 0 "Médicaments" # JOB_ID_1
May 22 21:00:01 flobox crond[15134]: mailing cron output for user florian notify-send -t 0 "Médicaments" # JOB_ID_1
May 22 21:00:01 flobox crond[15134]: unable to exec /usr/sbin/sendmail: cron output for user florian notify-send -t 0 "Médicaments" # JOB_ID_1 to /dev/null
May 22 21:35:01 flobox crond[2063]: FILE /var/spool/cron/root USER root PID 16468 job sys-hourly

Strangely, if I restart crond manually…:

florian@flobox:~$ sudo /etc/rc.d/crond restart
Password: 
:: Stopping Cron Daemon                                                  [DONE] 
:: Starting Cron Daemon                                                  [DONE]

… jobs do are fired:

May 22 23:36:26 flobox crond[21150]: /usr/sbin/crond 4.4 dillon's cron daemon, started with loglevel info
May 22 23:37:01 flobox crond[21150]: FILE /var/spool/cron/florian USER florian PID 21182 notify-send -t 0 "test" # JOB_ID_4

Here is the rc.conf's deamon list:

DAEMONS=(syslog-ng !network !netfs crond dbus hal fam @wicd gdm)

It's probably a common mistake, but I couldn't find anything on the Internet.
What did I wrong?

Offline

#2 2010-05-25 21:39:02

monsieur moche
Member
From: France
Registered: 2009-10-14
Posts: 50

Re: Cron issue : exit status 1 from user XXX

Any idea?

Offline

#3 2010-06-14 20:42:02

queljin
Member
Registered: 2010-06-14
Posts: 4

Re: Cron issue : exit status 1 from user XXX

monsieur moche wrote:

Hi Archers,

I have to take medicines at a set time.
I configured Cron to send me visual notifications (by using Gnome's notify-send command):

florian@flobox:~$ sudo cat /var/spool/cron/florian 
Password: 
0 21 * * * notify-send -t 0 "Médicaments" # JOB_ID_1
0 9 * * * notify-send -t 0 "Médicaments" # JOB_ID_2
0 12 * * * notify-send -t 0 "Médicaments" # JOB_ID_3

I can't see any notification at these times.

However, crond is started (since it's in the rc.conf's deamon list):

florian@flobox:~$ ps -A | grep cron
 2063 ?        00:00:00 crond

The logs signal an error:

florian@flobox:~$ sudo tail /var/log/crond.log
Password: 
May 22 15:34:47 flobox crond[2063]: /usr/sbin/crond 4.4 dillon's cron daemon, started with loglevel info
May 22 15:35:01 flobox crond[2063]: FILE /var/spool/cron/root USER root PID 2479 job sys-hourly
May 22 17:35:01 flobox crond[2063]: FILE /var/spool/cron/root USER root PID 7436 job sys-hourly
May 22 19:35:01 flobox crond[2063]: FILE /var/spool/cron/root USER root PID 11989 job sys-hourly
May 22 21:00:01 flobox crond[2063]: FILE /var/spool/cron/florian USER florian PID 15132 notify-send -t 0 "Médicaments" # JOB_ID_1
May 22 21:00:01 flobox crond[2063]: exit status 1 from user florian notify-send -t 0 "Médicaments" # JOB_ID_1
May 22 21:00:01 flobox crond[15134]: mailing cron output for user florian notify-send -t 0 "Médicaments" # JOB_ID_1
May 22 21:00:01 flobox crond[15134]: unable to exec /usr/sbin/sendmail: cron output for user florian notify-send -t 0 "Médicaments" # JOB_ID_1 to /dev/null
May 22 21:35:01 flobox crond[2063]: FILE /var/spool/cron/root USER root PID 16468 job sys-hourly

Strangely, if I restart crond manually…:

florian@flobox:~$ sudo /etc/rc.d/crond restart
Password: 
:: Stopping Cron Daemon                                                  [DONE] 
:: Starting Cron Daemon                                                  [DONE]

… jobs do are fired:

May 22 23:36:26 flobox crond[21150]: /usr/sbin/crond 4.4 dillon's cron daemon, started with loglevel info
May 22 23:37:01 flobox crond[21150]: FILE /var/spool/cron/florian USER florian PID 21182 notify-send -t 0 "test" # JOB_ID_4

Here is the rc.conf's deamon list:

DAEMONS=(syslog-ng !network !netfs crond dbus hal fam @wicd gdm)

It's probably a common mistake, but I couldn't find anything on the Internet.
What did I wrong?

Have you solved this issue? I've the same problem, still couldn't figure out what I did wrong. Probably a simple issue.

Here's my rc.conf daemon list;

DAEMONS=(syslog-ng !network dbus hal netfs crond @alsa @wicd)

Offline

#4 2010-06-15 21:25:36

queljin
Member
Registered: 2010-06-14
Posts: 4

Re: Cron issue : exit status 1 from user XXX

I just found the problem. I was trying to run "xfcedesktop --reload" in crontab to change my desktop wallpaper every 5 mins. For graphical applications, you need to tell the app which display it should use (obviously, why I didn't figure that out sooner is beyond me tongue).

So changing from;


*/5 * * * * /usr/bin/xfdesktop --reload > /dev/null 2>&1

to;

*/1 * * * * DISPLAY=:0 /usr/bin/xfdesktop --reload > /dev/null 2>&1

did the trick for me. "DISPLAY=:0" is the default display. If you like the program to run on other display, change the number corresponding the other display. Like "DISPLAY=:1" or so on.

Offline

Board footer

Powered by FluxBB