gridcoin-community / Gridcoin-Research

Gridcoin-Research
MIT License
588 stars 173 forks source link

3.7.11.1/2 dev/staging gridcoinresearchd fails to daemonize in one shot autotools build #1075

Closed jamescowens closed 6 years ago

jamescowens commented 6 years ago

The issue is that with a full autotools build where both the daemon and GUI version are built at the same time (i.e. with the config option --without-gui not set), the daemon is built with QT_GUI set. This causes the macros in init.cpp to malfunction, so the daemon built this way is actually broken. (It runs, but is not daemonized/will not fork to the background or respond to an rpc stop command.) To solve the problem, I have put in PR #1074, which implements a global flag fQtActive that is initially set in init.cpp to false. If Gridcoin is started via main in qt/bitcoin.cpp, this will be set to true. I replaced and/or augmented the macro defs in init.cpp to use if statements to check for the status of fQtActive to determine daemon behavior.

tomasbrod commented 6 years ago

I think that daemonize / fork to background should be removed, because the same functionality is provided by shell or systemd.

jamescowens commented 6 years ago

Probably right, (the & is a good thing...) but other bitcoin derivatives have it. Not sure we want to deviate too much. Also, without this change StartShutdown() (called when rpc stop is issued) malfunctions and does nothing.

Sent from my iPhone

On May 2, 2018, at 6:24 PM, Tomáš notifications@github.com wrote:

I think that daemonize / fork to background should be removed, because the same functionality is provided by shell or systemd.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

denravonska commented 6 years ago

This should be working now, right?

jamescowens commented 6 years ago

Yes. Let’s close it.

Sent from my iPhone

On May 28, 2018, at 3:18 PM, Marco Nilsson notifications@github.com wrote:

This should be working now, right?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.