Mailing List Archive

cron problems
I am having a problem with vixie-cron. I have my user listed in the
cron.allow file and have them in the cron group, but cron is not
executing tasks for them. For example, I have the following entry in
my crontab for testing purposes, but it is not getting executed:
5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/bin/logger "CRON_TEST"

Any help would be greatly appreciated.

--
Ed

--
gentoo-user@gentoo.org mailing list
Re: cron problems [ In reply to ]
quoth the Edward Guldemond:
> I am having a problem with vixie-cron. I have my user listed in the
> cron.allow file and have them in the cron group, but cron is not
> executing tasks for them. For example, I have the following entry in
> my crontab for testing purposes, but it is not getting executed:
> 5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/bin/logger "CRON_TEST"
>
> Any help would be greatly appreciated.

Simplest things first...did you SIGHUP or restart the cron daemon?

-d
--
Part of the problem since 1976
http://badcomputer.no-ip.com
Get my public key from
http://keyserver.linux.it/pks/lookup?op=index&search=bulliver
"...the number of UNIX installations has grown to 10, with more expected..."
- Dennis Ritchie and Ken Thompson, June 1972
Re: cron problems [ In reply to ]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Edward Guldemond wrote:
| I am having a problem with vixie-cron. I have my user listed in the
| cron.allow file and have them in the cron group, but cron is not
| executing tasks for them. For example, I have the following entry in
| my crontab for testing purposes, but it is not getting executed:
| 5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/bin/logger "CRON_TEST"
|
| Any help would be greatly appreciated.
|

It's kind of hard to help with out more information.

You don't specify where you've entered that cron job into... the system crontab
and user crontabs are parsed differently ; system crontabs require a user name
(which the command will be run as) before the command. If this is your case,
then it's not running because obviously /usr/bin/logger is not a valid user name.

Did you try restarting the daemon (or make sure it was running in the first place)?

Have you checked the logs?

Try getting rid of the cron.allow file all together and make sure you have an
empty (comments are ok) cron.deny file as well as the user in the cron group
(which you said you've done already). This is how I've always done it.

Btw, unrelated to your problem, instead of listing all those numbers to run the
job every 5 min, try:

*/5 * * * *

There's other cool vixie crontab syntax ; see crontab(5) manual page for more info.

HTH
- --
Latin is a language,
As dead as can be.
First it killed the Romans,
And now it's killing me.

Aaron Walker - Gentoo Developer [ Gentoo/BSD / forensics / cron ]
ka0ttic@gentoo.org http://dev.gentoo.org/~ka0ttic/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBak/AC3poscuANHARAodJAJ99AGLZkDaG3hJTlcWPypWSdbsk7QCg6guo
xZ3satV5OhNJC/wJ8ree+CU=
=Fh2I
-----END PGP SIGNATURE-----

--
gentoo-user@gentoo.org mailing list
Re: cron problems [ In reply to ]
On Mon, 11 Oct 2004 05:17:52 -0400, Aaron Walker <ka0ttic@gentoo.org> wrote:
> You don't specify where you've entered that cron job into... the system crontab
> and user crontabs are parsed differently ; system crontabs require a user name
> (which the command will be run as) before the command. If this is your case,
> then it's not running because obviously /usr/bin/logger is not a valid user name.

That cronjob is in my user crontab. The system crontab works fine.

> Did you try restarting the daemon (or make sure it was running in the first place)?

It is running. It runs the system crontab just fine, and outputs
messages to the logs when they are run.

> Have you checked the logs?

See above.

> Try getting rid of the cron.allow file all together and make sure you have an
> empty (comments are ok) cron.deny file as well as the user in the cron group
> (which you said you've done already). This is how I've always done it.

I had neither a cron.allow file nor a cron.deny file after installing
vixie-cron, so I made a cron.allow file. The user is in the cron
group. I'll try removing the cron.allow file, then I'll restart cron
and see what happens.

> Btw, unrelated to your problem, instead of listing all those numbers to run the
> job every 5 min, try:
>
> */5 * * * *

I know. I was frustrated when writing that so forgot that little trick.

> There's other cool vixie crontab syntax ; see crontab(5) manual page for more info.

Yes, I want to use @reboot to start my ssh-agent w/o any keys so every
shell and terminal inherits the settings. That's why I want to get my
user's cron working! :-)

> HTH

Thank you for your time.

--
Ed

--
gentoo-user@gentoo.org mailing list
Re: cron problems [ In reply to ]
On Mon, 11 Oct 2004 13:21:56 -0400, Edward Guldemond
<edward.guldemond@gmail.com> wrote:
> > Try getting rid of the cron.allow file all together and make sure you have an
> > empty (comments are ok) cron.deny file as well as the user in the cron group
> > (which you said you've done already). This is how I've always done it.
>
> I had neither a cron.allow file nor a cron.deny file after installing
> vixie-cron, so I made a cron.allow file. The user is in the cron
> group. I'll try removing the cron.allow file, then I'll restart cron
> and see what happens.

Hate replying to myself, but this didn't solve the problem. After
removing cron.allow and restarting cron, I did a "touch cron.deny",
restarted cron, and still no joy. Am I missing something obvious?

--
Ed

--
gentoo-user@gentoo.org mailing list
Re: cron problems [ In reply to ]
On Monday 11 October 2004 12:21 pm, Edward Guldemond wrote:

> > Have you checked the logs?
>
> See above.

No, we shouldn't be seeing above. You should be checking the logs.. Vixie, in
my experience, has given very good out putting on why its not doing
something..

Also, get rid of the cron.allow/deny stuff.. Thats probably adding to the
problem.

Jeff
Re: cron problems [ In reply to ]
On Mon, 11 Oct 2004 13:55:06 -0500, Jeff Smelser <tradergt@smelser.org> wrote:
> On Monday 11 October 2004 12:21 pm, Edward Guldemond wrote:
>
> > > Have you checked the logs?
> >
> > See above.
>
> No, we shouldn't be seeing above. You should be checking the logs.. Vixie, in
> my experience, has given very good out putting on why its not doing
> something..

I mentioned above that line that I looked through the logs, so, yes, I
have checked the log, and here's what I have: (this is
/var/log/messages)

Oct 11 14:50:00 satchmo CRON[2528]: (root) CMD (test -x /usr/sbin/run-crons && /
usr/sbin/run-crons )
Oct 11 15:00:00 satchmo CRON[2596]: (root) CMD (test -x /usr/sbin/run-crons && /
usr/sbin/run-crons )
Oct 11 15:00:00 satchmo CRON[2597]: (root) CMD (rm -f /var/spool/cron/lastrun/cr
on.hourly)
Oct 11 15:10:00 satchmo CRON[2636]: (root) CMD (test -x /usr/sbin/run-crons && /
usr/sbin/run-crons )
Oct 11 15:20:00 satchmo CRON[2676]: (root) CMD (test -x /usr/sbin/run-crons && /
usr/sbin/run-crons )
Oct 11 15:30:00 satchmo CRON[2758]: (root) CMD (test -x /usr/sbin/run-crons && /
usr/sbin/run-crons )
Oct 11 15:40:00 satchmo CRON[2776]: (root) CMD (test -x /usr/sbin/run-crons && /
usr/sbin/run-crons )
Oct 11 15:50:00 satchmo CRON[2792]: (root) CMD (test -x /usr/sbin/run-crons && /
usr/sbin/run-crons )
Oct 11 16:00:00 satchmo CRON[2865]: (root) CMD (test -x /usr/sbin/run-crons && /
usr/sbin/run-crons )
Oct 11 16:00:00 satchmo CRON[2866]: (root) CMD (rm -f /var/spool/cron/lastrun/cr
on.hourly)

Does that help?

--
Ed

--
gentoo-user@gentoo.org mailing list
Re: cron problems [ In reply to ]
On Monday 11 October 2004 03:08 pm, Edward Guldemond wrote:
> I mentioned above that line that I looked through the logs, so, yes, I
> have checked the log, and here's what I have: (this is
> /var/log/messages)
>
> Oct 11 14:50:00 satchmo CRON[2528]: (root) CMD (test -x /usr/sbin/run-crons
> && / usr/sbin/run-crons )
> Oct 11 15:00:00 satchmo CRON[2596]: (root) CMD (test -x /usr/sbin/run-crons
> && / usr/sbin/run-crons )
> Oct 11 15:00:00 satchmo CRON[2597]: (root) CMD (rm -f
> /var/spool/cron/lastrun/cr on.hourly)
> Oct 11 15:10:00 satchmo CRON[2636]: (root) CMD (test -x /usr/sbin/run-crons
> && / usr/sbin/run-crons )
> Oct 11 15:20:00 satchmo CRON[2676]: (root) CMD (test -x /usr/sbin/run-crons
> && / usr/sbin/run-crons )
> Oct 11 15:30:00 satchmo CRON[2758]: (root) CMD (test -x /usr/sbin/run-crons
> && / usr/sbin/run-crons )
> Oct 11 15:40:00 satchmo CRON[2776]: (root) CMD (test -x /usr/sbin/run-crons
> && / usr/sbin/run-crons )
> Oct 11 15:50:00 satchmo CRON[2792]: (root) CMD (test -x /usr/sbin/run-crons
> && / usr/sbin/run-crons )
> Oct 11 16:00:00 satchmo CRON[2865]: (root) CMD (test -x /usr/sbin/run-crons
> && / usr/sbin/run-crons )
> Oct 11 16:00:00 satchmo CRON[2866]: (root) CMD (rm -f
> /var/spool/cron/lastrun/cr on.hourly)
>
> Does that help?

Yes,, this is very telling.. Cron isn't seeing it at all.. Which means a) it
has not been loaded into cron correctly, so how are you doing it?, b) it
doesn't think you have rights to.. going back to that user being in the cron
group.

Jeff
Re: cron problems [ In reply to ]
On Mon, 11 Oct 2004 15:25:23 -0500, Jeff Smelser <tradergt@smelser.org> wrote:
>
> Yes,, this is very telling.. Cron isn't seeing it at all.. Which means a) it
> has not been loaded into cron correctly, so how are you doing it?, b) it
> doesn't think you have rights to.. going back to that user being in the cron
> group.

The crontab has been loaded using the following:
ed@satchmo ed $ crontab -e

Checking my edits produces:
ed@satchmo ed $ crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.1770 installed on Mon Oct 11 13:20:49 2004)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
*/5 * * * * /usr/bin/logger CRON_TEST

The user is in the cron group:
ed@satchmo ed $ groups ed
tty wheel cron audio games users portage

I understand that cron isn't seeing the my crontab, but I'm wondering
why it's not...
--
Ed

--
gentoo-user@gentoo.org mailing list
Re: cron problems [ In reply to ]
On Monday 11 October 2004 03:30 pm, Edward Guldemond wrote:
> The crontab has been loaded using the following:
> ed@satchmo ed $ crontab -e
>
> Checking my edits produces:
> ed@satchmo ed $ crontab -l
> # DO NOT EDIT THIS FILE - edit the master and reinstall.
> # (/tmp/crontab.1770 installed on Mon Oct 11 13:20:49 2004)
> # (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
> */5 * * * * /usr/bin/logger CRON_TEST
>
> The user is in the cron group:
> ed@satchmo ed $ groups ed
> tty wheel cron audio games users portage
>
> I understand that cron isn't seeing the my crontab, but I'm wondering
> why it's not...

You should see this, when you edit a crontab:

gateway root # crontab -e
crontab: installing new crontab

gateway root # tail /var/log/cron.log
Oct 11 15:40:21 gateway crontab[22136]: (root) BEGIN EDIT (root)
Oct 11 15:40:33 gateway crontab[22136]: (root) REPLACE (root)
Oct 11 15:40:33 gateway crontab[22136]: (root) END EDIT (root)

Do you see something similar?

Jeff
Re: cron problems [ In reply to ]
On Mon, 11 Oct 2004 13:55:06 -0500 Jeff Smelser <tradergt@smelser.org>
wrote:
| Also, get rid of the cron.allow/deny stuff.. Thats probably adding to
| the problem.

Bad! Bad! Bad! No cookie!

As of vixie-4, no cron.deny == all users denied.

--
Ciaran McCreesh : Gentoo Developer (Vim, Fluxbox, Sparc, Mips)
Mail : ciaranm at gentoo.org
Web : http://dev.gentoo.org/~ciaranm
Re: cron problems [ In reply to ]
On Mon, 11 Oct 2004 15:41:36 -0500, Jeff Smelser <tradergt@smelser.org> wrote:
> You should see this, when you edit a crontab:
>
> gateway root # crontab -e
> crontab: installing new crontab
>
> gateway root # tail /var/log/cron.log
> Oct 11 15:40:21 gateway crontab[22136]: (root) BEGIN EDIT (root)
> Oct 11 15:40:33 gateway crontab[22136]: (root) REPLACE (root)
> Oct 11 15:40:33 gateway crontab[22136]: (root) END EDIT (root)
>
> Do you see something similar?

Yes, I do, but I don't have a cron.log. All of those messages from
the previous messages came from /var/log/messages.
--
Ed

--
gentoo-user@gentoo.org mailing list
Re: cron problems [ In reply to ]
On Mon, 11 Oct 2004 22:55:31 +0100, Ciaran McCreesh <ciaranm@gentoo.org> wrote:
>
> Bad! Bad! Bad! No cookie!
>
> As of vixie-4, no cron.deny == all users denied.

That was the problem! Thank you very much! It's alive!!!! :-)

--
Ed

--
gentoo-user@gentoo.org mailing list
Re: cron problems [ In reply to ]
On Monday 11 October 2004 04:55 pm, Ciaran McCreesh wrote:
>
> Bad! Bad! Bad! No cookie!
>
> As of vixie-4, no cron.deny == all users denied.

That part of ~x86 or something?

--
=======================================================================
Jabber: tradergt@(smelser.org|jabber.org)
Quote: "Let's say the docs present a simplified view of reality... :-)"
--Larry Wall
=======================================================================
Re: cron problems [ In reply to ]
On Mon, 11 Oct 2004 21:12:23 -0500 Jeff Smelser <tradergt@smelser.org>
wrote:
| On Monday 11 October 2004 04:55 pm, Ciaran McCreesh wrote:
| >
| > Bad! Bad! Bad! No cookie!
| >
| > As of vixie-4, no cron.deny == all users denied.
|
| That part of ~x86 or something?

| a a a h i m m p p pa s s x xb xb
| l m r p a a i p p pc 3 p 8 8s 8s
| p d m p 6 c p c c co 9 a 6 6d 6d
| h 6 a 4 o s 6 -s 0 r - -
| a 4 s 4 m c o f
------------------+---------------------------------------------
3.0.1-r1 | + + + + + + + +
3.0.1-r3 | + ~ ~ + + + + +
3.0.1-r4 | + + + ~ + + + + +
3.0.1-r5 | ~ ~ ~ ~ ~ + ~ ~ ~
4.1-r1 | ~ ~ ~ ~ ~ ~ ~ ~ ~
4.1-r2 | ~ ~ ~ ~ ~ ~ ~ ~ ~

--
Ciaran McCreesh : Gentoo Developer (Vim, Fluxbox, Sparc, Mips)
Mail : ciaranm at gentoo.org
Web : http://dev.gentoo.org/~ciaranm
Re: cron problems [ In reply to ]
On Tuesday 12 October 2004 01:32 pm, Ciaran McCreesh wrote:
> | a a a h i m m p p pa s s x xb xb
> | l m r p a a i p p pc 3 p 8 8s 8s
> | p d m p 6 c p c c co 9 a 6 6d 6d
> | h 6 a 4 o s 6 -s 0 r - -
> | a 4 s 4 m c o f
>
> ------------------+---------------------------------------------
> 3.0.1-r1 | + + + + + + + +
> 3.0.1-r3 | + ~ ~ + + + + +
> 3.0.1-r4 | + + + ~ + + + + +
> 3.0.1-r5 | ~ ~ ~ ~ ~ + ~ ~ ~
> 4.1-r1 | ~ ~ ~ ~ ~ ~ ~ ~ ~
> 4.1-r2 | ~ ~ ~ ~ ~ ~ ~ ~ ~

Well, I guess he neglected to tell me he was using ~x86.. Mine works great
with out it.. ;)

Jeff
Re: cron problems [ In reply to ]
On Tue, 12 Oct 2004 13:41:34 -0500 Jeff Smelser <tradergt@smelser.org>
wrote:
| On Tuesday 12 October 2004 01:32 pm, Ciaran McCreesh wrote:
| > | a a a h i m m p p pa s s x xb xb
| > | l m r p a a i p p pc 3 p 8 8s 8s
| > | p d m p 6 c p c c co 9 a 6 6d 6d
| > | h 6 a 4 o s 6 -s 0 r - -
| > | a 4 s 4 m c o f
| >
| > ------------------+---------------------------------------------
| > 3.0.1-r1 | + + + + + + + +
| > 3.0.1-r3 | + ~ ~ + + + + +
| > 3.0.1-r4 | + + + ~ + + + + +
| > 3.0.1-r5 | ~ ~ ~ ~ ~ + ~ ~ ~
| > 4.1-r1 | ~ ~ ~ ~ ~ ~ ~ ~ ~
| > 4.1-r2 | ~ ~ ~ ~ ~ ~ ~ ~ ~
|
| Well, I guess he neglected to tell me he was using ~x86.. Mine works
| great with out it.. ;)

That change is why we now sneakily install a blank cron.deny along with
the vixie-cron ebuilds. Unless you tinker manually (generally no need to
do that since we have the cron group) it'll Just Work(TM).

--
Ciaran McCreesh : Gentoo Developer (Vim, Fluxbox, Sparc, Mips)
Mail : ciaranm at gentoo.org
Web : http://dev.gentoo.org/~ciaranm
Re: cron problems [ In reply to ]
On Tuesday 12 October 2004 05:38 pm, Ciaran McCreesh wrote:

> That change is why we now sneakily install a blank cron.deny along with
> the vixie-cron ebuilds. Unless you tinker manually (generally no need to
> do that since we have the cron group) it'll Just Work(TM).

Hmm, well then i wonder why it didnt work here.. The world may never know.. ;)

Jeff
--
=======================================================================
Jabber: tradergt@(smelser.org|jabber.org)
Quote: Some who get credit for being Conservative are merely stupid.
=======================================================================
Re: cron problems [ In reply to ]
On Tue, 12 Oct 2004 13:41:34 -0500, Jeff Smelser <tradergt@smelser.org> wrote:
> Well, I guess he neglected to tell me he was using ~x86.. Mine works great
> with out it.. ;)

That's because I'm _not_ using ~x86. :-)

ed@satchmo ed $ emerge --pretend vixie-cron

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild R ] sys-apps/vixie-cron-3.0.1-r4

--
Ed

--
gentoo-user@gentoo.org mailing list