LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Is "poweroff" hard on open apps? (https://www.linuxquestions.org/questions/linux-desktop-74/is-poweroff-hard-on-open-apps-572811/)

jim-j 07-27-2007 03:38 PM

Is "poweroff" hard on open apps?
 
I have a fairly stock Fedora Core 6 desktop which logs in automatically and starts several apps (Firefox, Evolution, Pidgin). This works great when I use my PC locally. However, I will occasionally SSH to my PC and turn it off remotely via the 'poweroff' command from the command line. Does the 'poweroff' command cause my open desktop apps (like Firefox, Evolution, etc.) to close gracefully, or is this hard on them? I.e. is it better to be in front of the computer and manually close each app or is it ok to let the poweroff process close these apps. I assume that doing a 'shutdown -h now' would have the same affect on these apps as the 'poweroff' command does?

jschiwal 07-27-2007 03:50 PM

You might get a message about the last session being aborted when you start Firefox, but there shouldn't be any harm done. You could always use "killall -SIGQUIT firefox"; "killall -SIGQUIT firefox-bin"; etc. remotely before powering down the computer.

guru68 07-27-2007 03:52 PM

During "poweroff", a shutdown (kill -9) command is sent to open processes or applications. It should not cause a problem with any of them unless they have "open files" on the system. Apps like Firefox will see it as a forced shutdown (or crash), and may attempt to recover to their previous state when they are next opened. You should not see any adverse effects from this (such as lost data, etc.). The only possible "bad" thing that could happen is if an application is actively writing to disc (i.e., Evolution auto checking mail and downloading an attachment), then you could lose that data.

Someone please correct me if I am wrong.

Thanks -

Guru

jim-j 07-27-2007 09:54 PM

Quote:

Originally Posted by jschiwal
You might get a message about the last session being aborted when you start Firefox, but there shouldn't be any harm done. You could always use "killall -SIGQUIT firefox"; "killall -SIGQUIT firefox-bin"; etc. remotely before powering down the computer.

So "SISQUIT" is the friendliest way to stop GUI desktop apps from the command line? Based on http://en.wikipedia.org/wiki/SIGQUIT it sounds like this will leave core files. Is there a friendly command line way to stop GUI apps without generating core files?

Does anyone know if using Fedora's built in shutdown button shuts down desktop apps gracefully?

Thanks to all who have replied.

Lunate 07-28-2007 03:40 PM

kill -sigterm (kill -15) or just kill is the normal way to stop processes.
man kill


All times are GMT -5. The time now is 09:19 AM.