Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## original paste
- fp = open("/dev/null","w")
- run("#{request[:command]}", :stdout => fp, :stderr => fp)
- ## full action
- action "start_daemon" do
- validate :command, String
- child = fork do
- # this the child run command
- fp = open("/dev/null","w")
- run("#{request[:command]}", :stdout => fp, :stderr => fp)
- end
- # back in father, return data
- Process.detach(child)
- reply[:data][:pid] = child
- end # end of start_daemon
Add Comment
Please, Sign In to add comment