vext01 / hgd

Hackathon Gunther Daemon :: Opensource Multi-User Jukebox
http://hgd.theunixzoo.co.uk
ISC License
22 stars 10 forks source link

Wrong pid written to .pid file on Linux #139

Closed shaun2029 closed 12 years ago

shaun2029 commented 12 years ago

The pids written to /var/hgd/hgd-playd.pid and /var/hgd/hgd-netd.pid are incorrect.

The call to hgd_daemonise() seems changes the pid of the process. This results in hgd-admin not working as expected.

/* Do this before daemonising so we can see its output if it fails. */
if (hgd_write_pid_file() != HGD_OK) {
    DPRINTF(HGD_D_ERROR, "Can't write PID away");
    return (HGD_FAIL);
}

/* alright, everything looks good, lets be a daemon and background */
if (background)
    hgd_daemonise();

hgd_listen_loop();

Testing on Ubuntu 11.10 Oneiric.

shaun2029 commented 12 years ago

For Ubuntu packaging of 0.5.2 I have hacked the code to write the pid after hgd_daemonise()

vext01 commented 12 years ago

Mex thinks he broke this. He fiddled this recently.

vext01 commented 12 years ago

Fixed by reverting fix for #129