You are not logged in.

#1 2006-12-01 23:08:51

arew264
Member
From: Friendswood, Texas, US
Registered: 2006-07-01
Posts: 394
Website

Schedule a Shutdown?

I have been trying to schedule a shutdown, but it has not been working. I was testing it by adding to the crontab:
00 * * * * /sbin/shutdown -h -P

Which should have started a shutdown on the next o'clock.

It didn't.
My guess is that theres a config file somewhere that tells who can and who cannot run shutdown. Any ideas what it might be?

EDIT: DOH! Forgot to put on a time... Will try again...

Still didn't work. The new line was:
10 * * * * /sbin/shutdown -h -P -t secs now

Tried the command outside of cron, and it works. I was usind date to check the time, and 17:10 came and passed and still no shutdown. Any idea what's wrong?

Offline

#2 2006-12-01 23:22:16

harlekin
Member
From: Germany
Registered: 2006-07-13
Posts: 408

Re: Schedule a Shutdown?

If the crontab is not executed as root, you may be right that you have to define users that are allowed to shut the machine down.

I heard something about a /etc/shutdown.allow file. Maybe you should check man shutdown or something. (:


Hail to the thief!

Offline

#3 2006-12-01 23:34:56

arew264
Member
From: Friendswood, Texas, US
Registered: 2006-07-01
Posts: 394
Website

Re: Schedule a Shutdown?

Well, I just can ps -Af | grep cron, and it appears as though /usr/sbin/crond is run as root. I can't really see what could be wrong now...

Offline

#4 2006-12-01 23:36:53

brazzmonkey
Member
From: between keyboard and chair
Registered: 2006-03-16
Posts: 818

Re: Schedule a Shutdown?

if it's a one-shot use, you can try to use the at command. try "man at"
or use kshutdown...


what goes up must come down

Offline

#5 2006-12-01 23:37:56

arew264
Member
From: Friendswood, Texas, US
Registered: 2006-07-01
Posts: 394
Website

Re: Schedule a Shutdown?

This is a scheduled shutdown that i will want every weeknight, so a one time thing won't work

Hrmmm, must be an error in my task syntax. Set it to
* * * * * /sbin/shutdown -h -P -t secs now

And my box shutdown 10 seconds later.
LoL.
I'll have to take a look at this...
If I wanted my box to shut down at 11:30 every weeknight...
30 23 * * 2,3,4,5,6 /sbin/shutdown -h -P -t secs now

That would do it?

EDIT: I seem to be encountering some difficulties that my box shuts down 30 secs after it starts... Working to repair...

Offline

#6 2006-12-01 23:44:04

arew264
Member
From: Friendswood, Texas, US
Registered: 2006-07-01
Posts: 394
Website

Re: Schedule a Shutdown?

UGH. I really screwed myself over this time. Any idea how I can get around that cron job?

EDIT: got it! just logged in and really quickly ran a killall crond. Edited the crontab and rebooted cron.

Offline

#7 2006-12-02 00:01:19

arew264
Member
From: Friendswood, Texas, US
Registered: 2006-07-01
Posts: 394
Website

Re: Schedule a Shutdown?

That cron job format works like a charm. Thanks!

Offline

Board footer

Powered by FluxBB