You are not logged in.

#1 2010-09-05 12:50:23

theta
Member
From: India
Registered: 2010-01-16
Posts: 174

crond doesn't work

My crond daemon doesn't work on startup.
I need to issue a

/etc/rc.d/crond restart

to make the scheduled tasks run.
My daemons array is:

DAEMONS=(syslog-ng hal dbus network crond cpufreq !laptop-mode wicd alsa bluetooth vnstat)

should the order be changed?

Regards,
Apoorv

Offline

#2 2010-09-05 14:07:35

lagagnon
Member
From: an Island in the Pacific...
Registered: 2009-12-10
Posts: 1,087
Website

Re: crond doesn't work

If your system is not on 24/7 crond will of course only work at the exact time that the cron jobs are stated to run. Perhaps you should install and run "anacron" as well, to ensure the jobs get run. Would that be your problem?


Philosophy is looking for a black cat in a dark room. Metaphysics is looking for a black cat in a dark room that isn't there. Religion is looking for a black cat in a dark room that isn't there and shouting "I found it!". Science is looking for a black cat in a dark room with a flashlight.

Offline

#3 2010-09-05 14:09:00

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: crond doesn't work

dcron has anacron features...

Offline

#4 2010-09-05 14:48:18

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Offline

#5 2010-09-05 15:32:57

theta
Member
From: India
Registered: 2010-01-16
Posts: 174

Re: crond doesn't work

I couldn't get both anacron or cronwhip.
I think you misunderstood me. I don't want to run missed jobs. I just want to run jobs after bootup procedure.
Something that is specified by @reboot in cron. This isn't happening on my arch installation. It seems that none of the cron jobs are running at all unless I restart the daemon manually after bootup.

Regards,
Apoorv

Offline

#6 2010-09-05 20:39:01

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: crond doesn't work

In light of a few annoying crond bugs i recently switched to fcron. tastes great, less filling. Oh, and it provides this particular behavior. Installation was simple enough -- only had to breeze over the man page to port my crontabs to fcron's format.

Before anyone asks, the bugs in question with dcron have already been posted on the bug tracker. no response from the developer (an Arch user) and no activity in the dcron git repo since early this year (February-ish). It also doesn't play well with systemd, but that's not really dcron's fault.

Offline

#7 2010-09-06 08:07:47

theta
Member
From: India
Registered: 2010-01-16
Posts: 174

Re: crond doesn't work

Unfortunately I am having the same problem with fcron. Whatever I give in the startup doesn't start. I nedd to carry out the same manual restart of the fcron daemon to make it work.
Regards,
Apoorv

Offline

#8 2010-09-06 08:43:58

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: crond doesn't work

/etc/conf.d/crond has something like:

CROND_ARGS="-S -l info"

Adjust the log level then look in your log file for the reason.

Offline

#9 2010-09-06 10:13:38

theta
Member
From: India
Registered: 2010-01-16
Posts: 174

Re: crond doesn't work

Here's the log for crond:

Sep  6 15:25:36 boolean-pc crond: /usr/sbin/crond 4.4 dillon's cron daemon, started with loglevel info
Sep  6 15:26:01 boolean-pc crond: FILE /var/spool/cron/root USER root PID 9136 job sys-hourly
Sep  6 15:28:01 boolean-pc crond: reading /var/spool/cron/cron.update
Sep  6 15:28:01 boolean-pc crond: failed parsing crontab for user theta: unknown job 2m
Sep  6 15:29:05 boolean-pc crond: /usr/sbin/crond 4.4 dillon's cron daemon, started with loglevel info
Sep  6 15:29:05 boolean-pc crond: failed parsing crontab for user theta: unknown job 2m
Sep  6 15:30:01 boolean-pc crond: FILE /var/spool/cron/theta USER theta PID 5000 job vu
Sep  6 15:30:14 boolean-pc crond: mailing cron output for user theta job vu
Sep  6 15:30:14 boolean-pc crond: unable to exec /usr/sbin/sendmail: cron output for user theta job vu to /dev/null
Sep  6 15:32:01 boolean-pc crond: FILE /var/spool/cron/theta USER theta PID 5490 /usr/bin/vuze
Sep  6 15:32:04 boolean-pc crond: mailing cron output for user theta /usr/bin/vuze
Sep  6 15:32:04 boolean-pc crond: unable to exec /usr/sbin/sendmail: cron output for user theta /usr/bin/vuze to /dev/null

And heres my crontab: (i changed it just for testing)

0 * * * * ~/Wallpapers/change-background-folder.py
22 23-6 * * * /usr/bin/vuze
32      15      *       *       *       /usr/bin/vuze
@reboot ID=vu AFTER=2m  /usr/bin/vuze

Is the syntax wrong?
Regards,
Apoorv

Offline

#10 2010-09-06 12:45:14

Stebalien
Member
Registered: 2010-04-27
Posts: 1,237
Website

Re: crond doesn't work

AFTER is used to run a job after another job is run. If you want to delay vuze, i recommend using

/bin/sleep 2m && /usr/bin/vuze

Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com

Offline

#11 2010-09-06 15:43:44

theta
Member
From: India
Registered: 2010-01-16
Posts: 174

Re: crond doesn't work

Stebalien wrote:

AFTER is used to run a job after another job is run. If you want to delay vuze, i recommend using

/bin/sleep 2m && /usr/bin/vuze

I tried this but still no use. The log file output is attached below. The exit status of each job is 1. I suppose that there was some error to while executing them. Could this be related to permissions? As soon as I restart the daemon manually, vuze pops up after 3 secs. So there's nothing wrong with the crontab. Its something to do with the crond daemon running automatically. And as of now I have placed crond as last in the DAEMONS array in /etc/rc.conf (Although I have tried all other combinations.

Sep  6 20:00:48 boolean-pc crond: /usr/sbin/crond 4.4 dillon's cron daemon, started with loglevel info
Sep  6 20:01:01 boolean-pc crond: FILE /var/spool/cron/theta USER theta PID 6850 job vu
Sep  6 20:01:01 boolean-pc crond: FILE /var/spool/cron/theta USER theta PID 6851 job vu
Sep  6 20:01:01 boolean-pc crond: mailing cron output for user theta job vu
Sep  6 20:01:01 boolean-pc crond: unable to exec /usr/sbin/sendmail: cron output for user theta job vu to /dev/null
Sep  6 20:02:04 boolean-pc crond: mailing cron output for user theta job vu
Sep  6 20:02:04 boolean-pc crond: unable to exec /usr/sbin/sendmail: cron output for user theta job vu to /dev/null
Sep  6 20:44:01 boolean-pc crond: /usr/sbin/crond 4.4 dillon's cron daemon, started with loglevel info
Sep  6 20:45:01 boolean-pc crond: FILE /var/spool/cron/theta USER theta PID 4994 job vu
Sep  6 20:45:01 boolean-pc crond: FILE /var/spool/cron/theta USER theta PID 4995 job vu
Sep  6 20:45:01 boolean-pc crond: FILE /var/spool/cron/root USER root PID 4996 job sys-hourly
Sep  6 20:45:01 boolean-pc crond: exit status 1 from user theta job vu
Sep  6 20:45:01 boolean-pc crond: mailing cron output for user theta job vu
Sep  6 20:45:01 boolean-pc crond: unable to exec /usr/sbin/sendmail: cron output for user theta job vu to /dev/null
Sep  6 20:45:42 boolean-pc crond: mailing cron output for user theta job vu
Sep  6 20:45:42 boolean-pc crond: unable to exec /usr/sbin/sendmail: cron output for user theta job vu to /dev/null
Sep  6 21:00:01 boolean-pc crond: FILE /var/spool/cron/theta USER theta PID 6658 ~/Wallpapers/change-background-folder.py
Sep  6 21:00:01 boolean-pc crond: exit status 1 from user theta ~/Wallpapers/change-background-folder.py
Sep  6 21:00:01 boolean-pc crond: mailing cron output for user theta ~/Wallpapers/change-background-folder.py
Sep  6 21:00:01 boolean-pc crond: unable to exec /usr/sbin/sendmail: cron output for user theta ~/Wallpapers/change-background-folder.py to /dev/null

Offline

#12 2010-09-07 13:08:56

Stebalien
Member
Registered: 2010-04-27
Posts: 1,237
Website

Re: crond doesn't work

VUZE probably needs to know which X display to use. It may also need access to the dbus-daemon.
First try:

/bin/sleep && DISPLAY=:0.0 /usr/bin/vuze

And if that doesn't work, try:

/bin/sleep && DISPLAY=:0.0 /usr/bin/dbus-launch /usr/bin/vuze

BTW, why are you using cron for this anyway. You should just put vuze in one of your login scripts.


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com

Offline

#13 2010-09-15 04:28:38

theta
Member
From: India
Registered: 2010-01-16
Posts: 174

Re: crond doesn't work

Stebalien wrote:

VUZE probably needs to know which X display to use. It may also need access to the dbus-daemon.
First try:

/bin/sleep && DISPLAY=:0.0 /usr/bin/vuze

And if that doesn't work, try:

/bin/sleep && DISPLAY=:0.0 /usr/bin/dbus-launch /usr/bin/vuze

BTW, why are you using cron for this anyway. You should just put vuze in one of your login scripts.

Yeah, you are right that I should use the login scripts to start vuze. My primary aim was to start vuze at certain time during the night and schedule some music playback at 3 different times during the day. But unfortunately, unless I give a manual restart to the cron daemon

 sudo /etc/rc.d/crond restart

after bootup, none of the scheduled tasks run. One of them also includes  a wallpaper changer script. I just landed up experimenting to start vuze after startup.

Offline

Board footer

Powered by FluxBB