8

For some reason monerod gets angry if it reads EOF from stdin and decides to exit. I don't know why. Go ahead, try it:

monerod < /dev/null

This is really unfriendly behavior for daemons, because it is incompatible with process supervision (daemontools, runit, etc) which keep the daemon as a child process of the supervisor so it can do things like notice when the child dies and restart it, prevent two copies of the daemon from running at the same time (no more stupid pidfiles) or centralize logging policy by having the daemons send their logs to stdout.

Running monerod with the --detach option is not what I want; this causes it to double-fork and deliberately trick the parent process into thinking it has died.

How do I get monero to just act like a normal daemon?

  • 1
    it works with both upstart and systemd. You may need to use the --detach flag. – Ginger Ale Jan 16 '17 at 13:56
  • That double fork IS what a normal daemon does. What you're describing is not a daemon, but a normal process being made to kinda look like a daemon using a bodge. – user36303 Jun 18 '17 at 9:50
3

Monero now has this feature, added two months after the question was asked (way to go responsive devs!). Here is the pull request that added it:

https://github.com/monero-project/monero/pull/1897

To use the feature, just launch monerod using the extra option shown below:

 monerod --non-interactive

to the command line when launching monerod. This will make it act differently than a normal unix daemon and not exit right after starting up. Works great!

1

That would be monerod --detach

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.