1

Using Kernel.spawn I can start a new process from within ruby, executing som arbitrary shell commands. The new process will appear in the same control group as the ruby process. How can I change that to have it go in it's own?

The reason for me wanting this is that my ruby process is managed by systemd and I don't want any of these particular shell command processes to be cleaned up/terminated when the ruby process is restarted.

Niels Kristian
  • 8,661
  • 11
  • 59
  • 117
  • 1
    Would `type=forking` work? I'm not sure how that works with multiple forked processes though. – Max Nov 22 '17 at 16:00

1 Answers1

0

I didn't find any way to do this. Instead I changed the KillMode of my systemd script to process, this solved the problem: Can't detach child process when main process is started from systemd

Niels Kristian
  • 8,661
  • 11
  • 59
  • 117