LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-05-2004, 01:29 AM   #1
Worstje
Member
 
Registered: Mar 2004
Distribution: Slackware-current
Posts: 93

Rep: Reputation: 15
Crond is stubborn...


Hello all,

Ever since installing crond I have had the problem that unless I restart it manually as root, it is not cronding anything . After killing and starting it manually everything works though... Had to restart the other day and well... it's pretty annoying when your alarm doesn't go off anymore (yup Slackware has 1001 uses ).. I restart crond exactly the same way as it appears in ps.

Anyone got any clue as to the cause of this problem?

Thanks
 
Old 07-05-2004, 04:54 AM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
How do you add a cron for your user ?
 
Old 07-06-2004, 04:36 PM   #3
bender647
Member
 
Registered: May 2003
Location: Boston
Distribution: Slackware
Posts: 39

Rep: Reputation: 23
Same symptoms here

I have three perfectly working slack servers, save for this exact same problem.
Crond runs at startup, it even writes to the log saying it did the run-parts hourly.
Problem is, the scripts in cron.hourly were not run.

There's no problem with the scripts, if I run them manually they work.

Kill crond and restart as root and it runs perfectly forever (well, 60 days
uptime last count).

I tried the kill cron/restart trick in rc.local, but that doesn't work either.

Still debugging this one!
 
Old 09-09-2004, 05:24 PM   #4
Worstje
Member
 
Registered: Mar 2004
Distribution: Slackware-current
Posts: 93

Original Poster
Rep: Reputation: 15
@ all:

Sorry I ended up with my school taking all my time and some personal issues. That and my holidays prevented my from getting back to this after all this time. My apologies

@ keefaz:

user@box $ crontab -e
and
root@box $ crontab -e user

have both been tried. None of them work until I manually restart crond.

@ bender647:

Have you managed to find a solution yet? I myself am still stumped..
 
Old 09-10-2004, 04:31 AM   #5
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
I find it curious, I ran slackware 9.1, now 10.0 and has never problem with cron. I add cron for user like you (crontab -e).

could you post your crontab -l for this user ?
 
Old 09-11-2004, 05:43 PM   #6
Worstje
Member
 
Registered: Mar 2004
Distribution: Slackware-current
Posts: 93

Original Poster
Rep: Reputation: 15
Well I tried it with a few users, but my original testcase is following:

Code:
coresausage ~ # crontab -l stereo
# Every mon-fri at 7am, wake up call!

#0 7 * * mon-fri /usr/local/bin/alsaplayer /music/force\ and\ styles\ -\ field\ of\ dreams.mp3 1> /dev/null
0 6 * * mon-fri /music/scripts/easyplay 100 -q /music/force\ and\ styles\ -\ field\ of\ dreams.mp3 1> /dev/null
Nothing is wrong with the script, it works fine started manually. Or after I have restarted crond after booting my box 'ofcourse'.
 
Old 09-12-2004, 02:36 AM   #7
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
Maybe a tip (or not)

As you indicated the days in plain text, it may be a problem with your locale ?

Did you try 1-6 instead of mon-fri ?

Also from man 5 crontab, it say that name interval does not work, it should be number so : 1-6
 
Old 09-12-2004, 05:06 AM   #8
Worstje
Member
 
Registered: Mar 2004
Distribution: Slackware-current
Posts: 93

Original Poster
Rep: Reputation: 15
Thanks, I'll try it now

And even though I am dutch, I prefer english anyway So probably not a locale problem..
 
Old 09-12-2004, 05:32 AM   #9
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
hem, I did a mistake for monday to friday, it should be 1-5
 
Old 09-12-2004, 06:09 AM   #10
Worstje
Member
 
Registered: Mar 2004
Distribution: Slackware-current
Posts: 93

Original Poster
Rep: Reputation: 15
I noticed lol... but doesn't matter .

After my last post, I have edited my crontab for this user to look like this:

Code:
coresausage worstje # crontab -l stereo
# Every mon-fri at 7am, wake up call!

#0 7 * * mon-fri /usr/local/bin/alsaplayer /music/force\ and\ styles\ -\ field\ of\ dreams.mp3 1> /dev/null
0 * * * * /music/scripts/easyplay 100 -q /music/force\ and\ styles\ -\ field\ of\ dreams.mp3 1> /dev/null
and next I rebooted. Ever since I have waited. Still am but I am kind of convinced that it's not going to play anymore now (13:09). And running it manually still works fine.
 
Old 09-12-2004, 06:46 AM   #11
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
0 * * * * : means 13:00 - 14:00 - 15:00 ...

you want to test cron ? try this :
on a terminal type :
tty

say current tty is /dev/pts/135

crontab -e
* * * * * date > /dev/pts/135

save and look at your terminal
 
Old 09-12-2004, 07:55 AM   #12
Worstje
Member
 
Registered: Mar 2004
Distribution: Slackware-current
Posts: 93

Original Poster
Rep: Reputation: 15
Hmm weird.. I just used your tactic to test, and it seems crond is indeed doing its job like it should... But somehow, my script doesn't want to play the music, while it does when I am logged in as a certain user... Contents of easyplay script are following:

Code:
#!/bin/sh
#
# Parameter 1 is volume in percent,
# parameters 2+ are given to alsaplayer.
#
# Primarily to keep crontabs clean when using them.
# Will afterwards restore master volume to what it was
# set to before starting the script.
#

OVOLUME=$(amixer sget Master | egrep -m 1 -o "\[[0-9]{1,3}%\]" | egrep -o "[0-9]{1,3}")

amixer sset Master $1% &>/dev/null

shift;

alsaplayer "$@"

amixer sset Master $OVOLUME% &>/dev/null
Is something wrong with this code? If so, why does it just work when calling it from the CLI, and not from crond?

EDIT: And why does it suddenly work when I restart crond manually?

I appreciate all the help..

Last edited by Worstje; 09-12-2004 at 08:04 AM.
 
Old 09-12-2004, 08:04 AM   #13
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
first I would check mail to see if errors are logged :
mail

second, I would try :
Code:
*/3 * * * * /music/scripts/easyplay 100 -q '/music/force and styles - field of dreams.mp3' 1> /dev/null
so script will be run every 3mn and the mp3 name is quoted, but I suggest you to make a copy of this file with no spaces in it.
 
Old 09-12-2004, 08:16 AM   #14
Worstje
Member
 
Registered: Mar 2004
Distribution: Slackware-current
Posts: 93

Original Poster
Rep: Reputation: 15
I don't have mail for root or the stereo user.

Second, your script is not working either... for as far I can tell anyway.. Running it manually in the CLI works ofcourse... For as far I know my stereo user has all the permissions to play music...

I really appreciate your quick replies You don't see that often.. Thanks again!
 
Old 09-12-2004, 08:20 AM   #15
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
Don't have mail ? Not a problem, we can log error in file
say at /home/stereo/logfile

But please try to cpy the mp3 without spaces in its name as the problem may come from that.

Code:
*/3 * * * * /music/scripts/easyplay 100 -q '/music/force and styles - field of dreams.mp3' >> /home/stereo/logfile 2>&1
 
  


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
stubborn NFS problem Bill Geddes Linux - Networking 0 09-29-2005 02:58 PM
gdesklets are stubborn!! Askholia Linux - Software 2 05-02-2005 10:15 AM
stubborn chown jeroend Linux - Newbie 1 05-02-2004 02:52 PM
stubborn zeroconf BasK Mandriva 14 01-14-2004 04:26 PM
Mozilla being stubborn Dodgy Linux - Software 3 04-27-2003 04:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:36 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