Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsDiscussion Forum → Remote shut-down in Fedora Core
Remote shut-down in Fedora Core
2007-02-13, 2:21 PM #1
I ssh into my Linux box, which was booted under Fedora, and I want it to reboot into Kubuntu (the default GRUB selection). So, doo-dee-doo:

[<me>@localhost /]$ su
(Entered password)
[root@localhost /]# shutdown -r now
bash: shutdown: command not found
[root@localhost /]# man shutdown
(This works)
[root@localhost /]# shutdown now
bash: shutdown: command not found
[root@localhost /]# su shutdown -r now
su: invalid option -- r
Try `su --help' for more information.
[root@localhost /]# su shutdown now
shutdown: you must be root to do that!
[root@localhost /]# su shutdown -t now
su: invalid option -- t
Try `su --help' for more information.
[root@localhost /]# su shutdown
shutdown: you must be root to do that!

Any ideas? :confused:
the idiot is the person who follows the idiot and your not following me your insulting me your following the path of a idiot so that makes you the idiot - LC Tusken
2007-02-13, 3:12 PM #2
init 6

or try:

/sbin/shutdown -r now
2007-02-13, 4:01 PM #3
I'm a big noob, but can you use su like that? I thought su was just to login to root, and sudo should be used in cases like yours.

ie.
Code:
johndoe@klinger:~$ su
Password:
        
    root@klinger# shutdown -r now
verus
Code:
johndoe@klinger:~$ sudo shutdown -r now
Password:
        
    *shutdown stuff happens*

*shrug*

[edit]Missed that fact that you used su to login as root first. Still, I'd give sudo a shut, can't hurt.
2007-02-13, 4:46 PM #4
First locate the shutdown command. As mentioned previously, it's usually in /sbin/ which is generally only in root's path (not regular users, since they don't have permission to execute those commands). If you're not root, you usually can't execute it. So, you have two options:

Code:
$ su
...type root password...
# shutdown -r now


or if you have sudo and you're in the sudoers file:

Code:
$ sudo shutdown -r now
...type your password...
2007-02-13, 5:08 PM #5
Code:
$ reboot
And when the moment is right, I'm gonna fly a kite.
2007-02-13, 7:13 PM #6
Originally posted by Aglar:
I'm a big noob, but can you use su like that? I thought su was just to login to root, and sudo should be used in cases like yours.


I did su first, and established a session as root. Still wouldn't work - I used "su shutdown" in desparation.

Originally posted by gbk:
Code:
$ reboot


This rebooted the computer back into Fedora.
the idiot is the person who follows the idiot and your not following me your insulting me your following the path of a idiot so that makes you the idiot - LC Tusken
2007-02-13, 7:23 PM #7
Originally posted by Wolfy:
This rebooted the computer back into Fedora.


Why shouldn't it? You have to change the default OS that GRUB boots to before you reboot.
[This message has been edited. Deal with it.]
2007-02-13, 7:52 PM #8
GRUB, by default, boots into Kubuntu. Issuing the "reboot" command booted Fedora back into Fedora, the secondary choice.
the idiot is the person who follows the idiot and your not following me your insulting me your following the path of a idiot so that makes you the idiot - LC Tusken
2007-02-13, 8:22 PM #9
Originally posted by Wolfy:
GRUB, by default, boots into Kubuntu. Issuing the "reboot" command booted Fedora back into Fedora, the secondary choice.


Ah, I missed that one. Maybe when it reboots, it temporarily sets the default machine to Fedora. I'm pretty sure GRUB is capable of that.
[This message has been edited. Deal with it.]
2007-02-13, 8:29 PM #10
I haven't used Fedora in a while so I don't know if you are put in the sudoers file by default, but I would try sudo if you are.
2007-02-14, 7:33 AM #11
I've given up on trying Fedora (with the realization that it and Red Hat are absolute ****) and moved back to Kubuntu, but, if I needed to be a sudoer, wouldn't it simply tell me that I need to be root to do that, instead of telling me that no such command exists?
the idiot is the person who follows the idiot and your not following me your insulting me your following the path of a idiot so that makes you the idiot - LC Tusken
2007-02-15, 9:37 AM #12
When the command is not in the path of the user it can't find it. It's not uncommon, that /sbin and /usr/sbin are only in the path of root.
Sorry for the lousy German
2007-02-15, 10:14 AM #13
Good to know. Maybe, someday, Fedora or Red Hat will make a decent OS.
the idiot is the person who follows the idiot and your not following me your insulting me your following the path of a idiot so that makes you the idiot - LC Tusken
2007-02-15, 10:18 AM #14
It should be noted that if it doesn't work in su, it won't work in sudo, since sudo uses su.
2007-02-15, 4:52 PM #15
Originally posted by Wolfy:
Good to know. Maybe, someday, Fedora or Red Hat will make a decent OS.


Bwahahahaha keep dreaming.
2007-02-15, 6:19 PM #16
It should be noted that my webserver runs on Fedora and it's racked up about 260 days of uptime right now :p
2007-02-15, 6:33 PM #17
weve got to shut down the reactor!
2007-02-15, 6:33 PM #18
it's powered by secrets!
2007-02-16, 6:57 AM #19
Originally posted by Cool Matty:
It should be noted that my webserver runs on Fedora and it's racked up about 260 days of uptime right now :p


I didn't say it wasn't stable. I just said it wasn't a good OS. :p
the idiot is the person who follows the idiot and your not following me your insulting me your following the path of a idiot so that makes you the idiot - LC Tusken

↑ Up to the top!