LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


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

Rep: Reputation: 15
stopping programs


Hello,
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.

Bye.
 
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
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 66
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!

Yves.
 
  


Reply



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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:33 AM.

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