Solved

cron job to "self restart server"

Posted on 2009-05-04
9
912 Views
Last Modified: 2013-12-16
Greetings experts,

I am not familiar with Linux, and think this is a pretty easy question for someone who is familiar.

I have this cron job running: /sbin/shutdown -r now
59 23 1 * *

I get this email notification error:
shutdown: you must be root to do that!

How do I resolve this?
0
Comment
Question by:pzozulka
  • 4
  • 4
9 Comments
 
LVL 45

Accepted Solution

by:
Kdo earned 250 total points
Comment Utility
Hi prozulka,

The job must re run as root.  Either enter the job into cron as the root user, or use sudo to have the job become root.


Good Luck,
Kent
0
 
LVL 16

Assisted Solution

by:ai_ja_nai
ai_ja_nai earned 250 total points
Comment Utility
or use setuid, as root, to allow normal users to perform that command
0
 
LVL 8

Author Comment

by:pzozulka
Comment Utility
It makes sense to log in as root and do this, but I am setting up the job in PLESK. Do I have any control over any of these suggestions from PLESK?
0
 
LVL 16

Expert Comment

by:ai_ja_nai
Comment Utility
If you have enabled root access you can login to your Plesk ControlPanel using the username root and the password you created
http://kb.mediatemple.net/questions/923/Using+root+login+with+Plesk
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 8

Author Comment

by:pzozulka
Comment Utility
I only have the default ADMIN password that comes with the dedicated Virtual Machine at GoDaddy. When I use "/sbin/shutdown -r now" am I emplying to shutdown the entire server itself, maybe that is why its not allowing me to do that?

I'm trying to restart only the virtual machine that we have. I guess I don't have root password, only the Admin default login.
0
 
LVL 16

Expert Comment

by:ai_ja_nai
Comment Utility
Isn't PLESK a virtualized host? You should be jailed inside a VM, so that you can mess around as much as you want.. or am I wrong?
0
 
LVL 8

Author Comment

by:pzozulka
Comment Utility
It is indeed. It is a virtual control panel. Also, the owner of that cron job has full permissions setup in Plesk.
0
 
LVL 16

Expert Comment

by:ai_ja_nai
Comment Utility
I don't understand. Within a vm you should have the freedom of rebooting it, am I wrong?
0
 
LVL 8

Author Comment

by:pzozulka
Comment Utility
Yeah I should be. I guess I don't have the permissions to on that account. Is there a line I could insert after the CRON similar as the Windows RUN AS?
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Currently, there is not an RPM package available under the RHEL/Fedora/CentOS distributions that gives you a quick and easy way to allow PHP to interface with Oracle. As a result, I have included a set of instructions on how to do this with minimal …
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now