Make a Ruby program a daemon?

后端 未结 5 761
旧巷少年郎
旧巷少年郎 2020-12-01 10:53

I want to write a Ruby program that will always be running in the background (a daemon) on my Mac.

Can someone point me in the right direction on how this would be d

5条回答
  •  有刺的猬
    2020-12-01 11:26

    Ruby 1.9.x has now the following:

    Process.daemon
    

    Put it in your code and that's it.

    Taken from "Daemon Processes in Ruby."

提交回复
热议问题