Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
View Poll Results: What is your preferred command for shutting down the system?
I use "sudo shutdown -h now", and even configured sudo not to require a password for the shutdown command. But I should probably use the power button, I guess it's time to get acpi working.
Anyway, in older computers, the power button actually switched off power the the computer. Now it notifies the OS, which can choose what to do.
BTW, I noticed some members say they just press the power button to shutdown the system, but isn't this bad? Linux needs to unmount filesystems and sync disks and etc before quiting.
If I just powered-off at the wall socket then that's what you'd see and yes, an unclean shutdown is still a very bad thing to do. However, though most desktop systems still have a real power switch on the back of the psu, the power button on the front hasn't been a true power switch for a good number of years now, and will just generate an acpi event when pressed. It's up to the OS to decide what to do at that point. Recent versions of Slackware will respond by doing a clean shutdown.
Tend not to issue shutdown commands from a terminal on my local PC any more.
Always have many ssh sessions open to critical servers, only one key away from an oops moment
shutdown -h now : is the proper way to shutdown a server. Because the shutdown command will wait until the process is getting finished and proceed to shutdown the server
init 0 : This command is logically to tell the Operating environment to switch the runlevel. This will kill all the process with out wait.
halt : To shutdown the server Immediately.
poweroff : Just crash the FS and other sensitive process and power off the hardware.
Issuing "shutdown -h now" command is the best practice for production environment
shutdown -h now : is the proper way to shutdown a server. Because the shutdown command will wait until the process is getting finished and proceed to shutdown the server
init 0 : This command is logically to tell the Operating environment to switch the runlevel. This will kill all the process with out wait.
halt : To shutdown the server Immediately.
poweroff : Just crash the FS and other sensitive process and power off the hardware.
Issuing "shutdown -h now" command is the best practice for production environment
shutdown -h now : is the proper way to shutdown a server. Because the shutdown command will wait until the process is getting finished and proceed to shutdown the server
init 0 : This command is logically to tell the Operating environment to switch the runlevel. This will kill all the process with out wait.
halt : To shutdown the server Immediately.
poweroff : Just crash the FS and other sensitive process and power off the hardware.
Issuing "shutdown -h now" command is the best practice for production environment
This advise is BS if you ask me. From the halt/poweroff/reboot manpage:
Quote:
If halt or reboot is called when the system is not in runlevel 0 or 6, in other words when it's running normally, shutdown will be invoked instead.
Are you still using a sysvinit prior to version 2.74? Those older version did not call shutdown.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.