shrikant1712
shrikant1712

Reputation: 4446

Block shutdown process from Ruby application

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

Answers (1)

sawa
sawa

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

Related Questions