Reputation: 4446
In my Ruby application, I am recording audio and after stopping it takes about 1 minute to secure. During this period, if user shuts down the system, the audio gets corrupted.
I want to restrict the user to shutdown the system. How can I do that using Ruby?
I am using Ruby 1.9.3 and Ubuntu 12.04.
Upvotes: 1
Views: 91
Reputation: 168131
Write this in the file to make it run even when the terminal is closed:
Process.demon(true, true)
Not sure how to prevent OS shutdown. Not sure if that was your question either.
Upvotes: 1