Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
reboot when not loged in as root
Name: d3 Date: January 5, 2003 at 22:55:06 Pacific OS: unix CPU/Ram: G4 800
Comment:
How can I force a system reboot every night (logged in as admin NOT root)?
I tried making a script:
su mypassword reboot
and calling crontab to every night.. but it still prompts me for a password?
Name: David Perry Date: January 6, 2003 at 02:52:48 Pacific
Reply:
Put the job in the crontab for root.
0 4 0 0 0 shutdown -y -i 6
Does your machine need to be rebooted every night? Sounds like something is wrong. Reboots are for system upgrades. Most unix boxes are happy with uptime measured in years.
0
Response Number 2
Name: d3 Date: January 6, 2003 at 15:01:30 Pacific
Reply:
But the cron job isn't fireing if i'm not logged in as root? I need to know how to call shutdown from a normal user because now all i get is presmission denied errors.
0
Response Number 3
Name: David Perry Date: January 6, 2003 at 16:14:47 Pacific
Reply:
Cron does not depend on a user to be logged in. Have you tried it? Are there not already scheduled tasks that run as root?
Having said that, if you create a script owned by root with the set uid bit set, the script will execute as root, no matter who actually starts it. << DANGER - BAD IDEA
#!/bin/sh shutdown -i 6 -y
0
Response Number 4
Name: d3 Date: January 7, 2003 at 16:06:38 Pacific
Reply:
yep your right, all i was missing was
/sbin/shutdown
it wasn't getting called unless i but the sbin in front
0
Response Number 5
Name: David Perry Date: January 7, 2003 at 20:07:43 Pacific
Reply:
This is why many people either declare the PATH variable for cron scripts or use full path names to executables. Cron run in a severely limited shell.
You can add the verbose tracing to a script by putting 'set -x' near the top. That would show you what it is trying to do.
Summary: Hi I have Redhat Linux 6.0 and when I try to connect to the net with kppp in a non root user is says as I go into kppp that pppd is not installed properly and then when i try to dial is says can't ope...
Summary: While installing the TOP application , I found that my /sbin directory was wiped out ,meaning that I had lost my sh shell , because of that i am no longer able to log in as root, the moment i try i ge...
Summary: when i log in as root on 2.5.1 and execute the /usr/openwin/bin/openwin command, my system locks up....in other words, openwin will not work..... ...