You are not logged in.

#1 2005-03-08 18:06:42

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

trouble running crond as user

I cant seem to get crond to allow my user to run tasks, even if I run a user instance of it, i get nothing. My paths have the user rights and I know it runs ok because if I restart cron (/etc/rc.d/crond restart) while in user it runs fine. I cant find any cron.allow or cron.deny files to change permissions. I've run out of google and have no place else to go.

Offline

#2 2005-03-08 20:26:07

FUBAR
Member
From: Belgium
Registered: 2004-12-08
Posts: 1,029
Website

Re: trouble running crond as user

Do you want to add tasks to the cron daemon as a normal user? Try

crontab -e

.

Put in the lines you need and save and exit the file. You're done!


A bus station is where a bus stops.
A train station is where a train stops.
On my desk I have a workstation.

Offline

#3 2005-03-08 21:03:43

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: trouble running crond as user

yeah..well i created a file and entered the commands in it then did crontab name_of_file, then crontab -l to see that it entered it in which it did. So I know its got it, and it works if I restart the daemon after being logging in as my regular user but only if i do that.
If I start a user instance of cron and add the  file to crontab it just wont work. It must be a user rights issue...I read somewhere if it doesn't have cron.allow and cron.deny then it only works as root. But how do I change it? May be im neglecting something.... :?

Offline

#4 2005-03-08 22:05:37

smith
Member
From: Crescent City, CA
Registered: 2005-02-19
Posts: 77

Re: trouble running crond as user

Arch Linux uses dcron, which does not implement cron.allow/cron.deny.  You should check out the man page for crontab (man crontab).


I have nothing to say, and I am saying it.

Offline

#5 2005-03-09 00:53:58

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: trouble running crond as user

I read the manpage for crontab and it didn't help any or mention anything about dcron.
Other than issuing a simple sudo command in the autostart folder, I cant get this to work. I suppose I could set it up like this but it doesn't seem right...If anyone needs more info on this let me know  smile

Offline

#6 2005-03-09 01:07:38

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: trouble running crond as user

ah hell here it is:
1.)as user:

crond

2.)

crontab -e
5 19 * * 2 /home/tyler/Desktop/linux_scan /etc/cron.weekly

(without /etc/cron.weekly i can't even get it to work after restarting the daemon)
3.) created a simlink to /usr/sbin/crond
4.)reboot
5.)nothin'

Offline

#7 2005-03-09 02:04:13

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: trouble running crond as user

?
Maybe I am missing something. My cron works fine, for users as well as root.

I have crond in my rc.conf DAEMONS list, so cron starts at boot.
and I have edited a user cron with crontab -e..
it works fine.

you are aware that your cron job listed will run every 2nd day of the week at 7:05am right?
I don't know whether the day of the week starts on monday or sunday offhand, but you could try changing it to a "tue" for tuesday if that is what you want.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#8 2005-03-09 02:15:51

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: trouble running crond as user

yes I know it was set for earlier today, thats when I was testing it. The 2 represents Tuesday, 0 starting with sunday. I know that part is right because like I said if I restart the daemon as root it executes at that time. I just cant get it to go on its own. I do have crond in DAEMONS.

Offline

#9 2005-03-09 02:43:28

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: trouble running crond as user

i looked back at your earlier posts..why are you trying to get crond to run as a user again? It starts as root on my box with /etc/rc.d/crond

maybe if you clarified what you are trying to achieve. From my end cron works fine as installed from my original installation by cd (quite a few months ago now).


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#10 2005-03-09 02:47:51

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: trouble running crond as user

the reason I tried to start crond as user was because not doing so didn't give me anything. It made me think I should run an instance as user as the proper way to do it. Anyways not starting it as a user doesn't really seem to help at all....as long as i restart the daemon.

I have dcron 2.9-2

did you have to add /etc/cron.weekly at the end of your job?

Offline

#11 2005-03-09 04:26:29

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: trouble running crond as user

no. /etc/cron.weekly is another place to put crons. It is not associated with users. I believe that crons in the user crontab are executed AS the user in question.
Crontabs in /etc/cron.* are executed as root, and are generally reserved for system crons.

To have a cron run weekly, you could just create an executable script in /etc/cron.weekly, and it would run along with the other weekly crons (crontab -l as root will show you when that is..this is basically arch mirroring other cron functionality--how vixie cron does it?)....
anyway, to have it run as a user, just creat the crontab for your user...
crontab -e..
any errors by the cron will show up in /var/log/cron or something...and also are generally emailed to the root account.

I just assumed, erroneously apparently, that you were somehow using /etc/cron.weekly as part of your script..ie your script was using that as an argument..you do not need to reference it as part of a user cron, nor should you.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#12 2005-03-09 14:21:32

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: trouble running crond as user

ok, I may be getting somewhere now..in /var/log/crond I've got this error:

09-Mar-2005 09:18  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null

When ever I get this message I get nothing from cron. Looking in /usr/sbin I have no such executable. And I can't get the package for it. paman -Ss sendmail pops back postfix is used in place of it.

Offline

#13 2005-03-09 16:14:22

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: trouble running crond as user

so it is producing an error, and failing in trying to send mail to the local user..
I guess the default delivery method is sendmail. Maybe there is a configuration directive for defining the notification...


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#14 2005-03-09 16:43:01

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: trouble running crond as user

exactly but where? There are no cron.conf files or any of the sort anywhere like there is supposed to be. Maybe its a arch config file someplace....

Offline

#15 2005-03-09 17:35:01

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: trouble running crond as user

well, maybe it is hardcoded somewhere..
you could try installing a simple mail server..something like http://untroubled.org/nullmailer/
or follow one of the how-tos on the wiki...

seems a bit overkill for just cron errors though. The error should be showing up in /var/log/crond. You could turn up the logging level to see more errors...
you could try stopping the daemon (/etc/rc.d/crond stop), then starting it manually (as root)
crond -d 1
the above will start cron with debugging level 1, and run it in the foreground, so you can see the error messages.
Once you get things figured out, just kill that daemon, and start it using the rc.d script again.

Also, make sure your script that you are trying to run actually works properly. It could be that it is what is failing..


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#16 2005-03-09 19:28:32

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: trouble running crond as user

well I set the debug level to 1 like you suggested and the stupid thing runs. roll  roll It's like cron drops everything as soon as my user gets into kde. Any time I restart it while im in user(and in kde) just like I did with the debug, it will run fine.
..oh well I can always sudo a command in the autostart folder to get it to work...I'm tired of dealing with this anymore.
thanks for your help on everything cactus big_smile

Offline

Board footer

Powered by FluxBB