Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I would like to ask a question that even it is VERY simple, it is not in any book.How do you turn off your computer correctly if you are not the superuser??? (Obviously you dont only press the on/off button :) )
why the question? Suppose I have linux installed in a notebook, and I am not the superuser, then how do I turn it off.
I got a version of Red Hat linux in which this is entirelly possible but in other linuxes I have worked with, this is not explained.
Also, what if the computer is hanged (I know the legened says that Linux computers never have the "blue screen of death" syndrome- but it happens!) if I turn it off and on again, what are the possible consecuences ...
Thanks

Do a "man sudo" for the sudo manual page.
Your system should NEVER hang if you're using a stable-enough kernel. You can have an uptime of 2-3 years if you want to (but the kernel becomes outdated and currently theres no stable way to switch to another kernel without re-booting).
If you're using a journaling filesystem (ext3, reiserfs, xfs), you won't need to do a fsck even after pushing the poweroff button. Usually the data which has been written to disk is not lost.

You can also try one of the following commands:
$ halt
or
$ shutdown -h nowIf the user doesn't have permission to do so and it is a stand-alone PC used by yourself (ie not a mission critical server or administered by someone else) you could use suid to allow the halt command to runn as root when executed as a user:
# chmod +s /path/to/halt
Obviously if halt is residing in /sbin or /usr/sbin etc it will not be in a normal users path, so create a link:
# ln -s /usr/sbin/halt /usr/local/bin

Audiophile wrote:
"Your system should NEVER hang if you're using a stable-enough kernel. You can have an uptime of 2-3 years if you want to (but the kernel becomes outdated and currently theres no stable way to switch to another kernel without re-booting)."I have not seen an operating system that is crashproof. Each tries with different degees of success to protect the system from wayward programs. Even Windows NT, 2000, and XP are not crashproof. They are just less likely to crash than previous version of Windows. The same for linux. I agree that linux seems more stable thant Windows most times but I have lost track of how many times I have crashed it. In fact I just crashed RedHat Fedora two hours ago.

Probably the best uptime I've seen is a client we have who has had their BSD box going for about 5 years now. My PC here at work has been up for nearly a month so far, the last time I rebooted was to add a hard drive, the next time will be to add the CD writer sat next to m.....
(Connection reset by peer)

Hey Wondering.... do you have a later kernel installed on your notebook (i.e., a kernel with ACPI support)? I set-up ACPI support on my notebook, and now I simply press the power button once, and Linux begins the shut-down process automatically (equivalent of running "shutdown -h now" as a superuser).
Jonathan

"Even Windows NT, 2000, and XP are not crashproof."
They abviously are not.On *BSD and Linux systems, an uptime of 3-4 years is no big deal. That proves the stability.
"Infact I just crashed Redhat Fedora two hours ago"
I'm talking about the kernel here. I crash my X11 every 10 minutes. Tell me if a stable Linux kernel actually crashed."Wondering" you can do one more thing, you can edit your /etc/inittab to execute shutdown -h now instead of shutdown -r now. So you can shutdown using CTRL-ALT-DEL (or whatever you set)

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |