Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am running a program in my terminal. BUt I need to suspend or hibernate the OS (Ubuntu 12.04) for a while. Do I have to Ctrl-Z my running program before doing that? Or will suspension or hibernation of the OS also suspend the running program and allow resuming the program after the OS wakes up?

Thanks!

share|improve this question
add comment

2 Answers 2

What happens with, say, your X11 session? Your desktop environment surely keeps running. OS-wise, there's nothing to discern, e.g. KDE4 from gcc run in a terminal.

Hence, the answer is probably yes. (But this is only true insofar as the outside world is not involved, i.e. no network connections...)

share|improve this answer
    
Thanks! the running program is converting a file on a removable hard drive. I need to move my laptop elsewhere without moving the removable hard drive, and hope to resume the program, when I am back to the removable hard drive –  Tim Jun 4 '12 at 12:30
    
Will you turn it when away from the hard drive? Anyway, I suppose Ctrl+Z won't do in this case, either, since unplugging, replugging won't preserve the file discriptors of the running program... But I'm a little guessing here, maybe someone can fill in the blanks... –  sr_ Jun 4 '12 at 12:44
    
(It should be "turn it on"... rotating the suspended laptop probably doesn't hurt.) –  sr_ Jun 4 '12 at 13:27
    
I think suspension and hibernation keep my laptop on, do they? So no problem when I am back to resume? –  Tim Jun 4 '12 at 13:39
    
They are special hardware states, nothing is running. "Suspension" typically keeps the RAM "running" (and thus needs energy), "Hibernation" writes the RAM to Swap (and thus doesn't need energy). (Have a look here) –  sr_ Jun 4 '12 at 13:54
show 3 more comments

On the kernel level, yes the system is aware of power state changes, so from the I/O reading and writing perspective, your external drive will just power on, spin up, and continue what it was doing.

From a user space perspective, this might fail depending on fault tolerances built into whatever software you are using. If it detects a write fail, it may retry a couple of times until the drive becomes available, or it may fall over.

share|improve this answer
    
Thanks! "From a user space perspective, ...". If I have Ctrl+Z the running program, and resume it after I am back to connect my computer to the removable hard drive, will the program be able to find the drive to continue what was left before? –  Tim Jun 5 '12 at 19:10
    
Yes that could even work, like pausing the process until later. Good thinking. It would be an interesting test, like doing truecrypt container changes while suspending. But in reality one would never suspend with such a container unlocked. –  invert Jun 6 '12 at 7:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.