Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 04-19-2005, 04:21 AM   #1
Registered: Jan 2005
Distribution: debian
Posts: 44

Rep: Reputation: 15
stopping programs

i usually run large simulations, and it happened sometimes power to go down suddenly, i don't know why.
I have a UPS linked to my desktop, but i do not know how to stop the simulation running while UPS keeps the pc on for a short time (10 minutes) before everything goes down.
I'd like to restart my programs just at the same point where they have been stopped.

Any suggestions welcome.

Old 04-19-2005, 04:34 AM   #2
Simon Bridge
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
You can stop anything you run in terminal with control-c - provided you don't disable the keyboard.

You can program an emergency interrupt into the simularion so it watches for a keystroke while it's running and exist if it sees one.

Of course - if the UPS talks to the computer then you may be able to get the program to check for a power-down and then it can exit on it's own. But control-c is probably what you want.
Old 04-19-2005, 04:36 AM   #3
Senior Member
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 63
Since you want to restart things at the same point they were before getting stopped, I suggest you try and use suspend. Depending on your hardware, it may be easiest to use ACPI suspend to disk, or "Software Suspend 2" suspend to disk, or ACPI suspend to ram.

Any of those is so specific, that you'll have to start another thread in case you have difficulty with either.

Next, you'll want of course to fire the suspend operation in case of power shortage. I have absolutely no experience with that, but I remember seeing something about it in the /etc/inittab file.

Good luck!



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Stopping programs with Kcron underberg Linux - General 2 03-06-2005 08:55 AM
my table with programs when i press in button (left down corner) do no show programs sagi7ario Mandriva 1 03-12-2004 12:02 PM
end ssh session without stopping programs joshf Linux - Newbie 7 07-13-2003 08:39 AM
stopping programs running when linux starts face_master Linux - General 1 02-10-2003 07:04 AM
stopping X theslyfox Linux - Newbie 1 05-26-2002 03:55 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:10 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration