Subject: Bug#1013: x2gobroker-daemon doesn't return error when it can't spawn/bind to port

From: Stefan Baur <[email-masked]>
Date: Tue, 22 Mar 2016 10:54:43 +0100

package: x2gobroker-daemon
version: 0.0.3.0

This is what happened:

node:~# service x2gobroker-daemon stop
[....] Stopping X2Go Session Broker standalone daemon:
x2gobroker-daemonstart-stop-daemon: warning: failed to kill 14170: No
such process
 failed!
# huh, wait, what?
node:~# ps ax | grep brok
 5499 ?        S      0:00 x2gobroker-authservice -s
/run/x2gobroker/x2gobroker-authservice.socket -o root -g x2gobroker -p 0660
18791 pts/0    S+     0:00 grep brok
# no running x2gobroker-daemon, so ...

# let's remove the PID file:
node:~# rm /run/x2gobroker/x2gobroker-daemon.pid

node:~# service x2gobroker-daemon stop
node:~# service x2gobroker-daemon start
[ ok ] Starting X2Go Session Broker standalone daemon: x2gobroker-daemon.
# looking good so far ...

node:~# service x2gobroker-daemon stop
[....] Stopping X2Go Session Broker standalone daemon:
x2gobroker-daemonstart-stop-daemon: warning: failed to kill 18470: No
such process
 failed!
# whoops, again?

node:~# ps ax | grep brok
 5499 ?        S      0:00 x2gobroker-authservice -s
/run/x2gobroker/x2gobroker-authservice.socket -o root -g x2gobroker -p 0660
18791 pts/0    S+     0:00 grep brok
# no running x2gobroker-daemon, so ...

# let's remove the PID file:
node:~# rm /run/x2gobroker/x2gobroker-daemon.pid

# I wonder what a restart will do?
node:~# service x2gobroker-daemon restart
[ ok ] Starting X2Go Session Broker standalone daemon: x2gobroker-daemon.
node:~# service x2gobroker-daemon restart
[....] Stopping X2Go Session Broker standalone daemon:
x2gobroker-daemonstart-stop-daemon: warning: failed to kill 18641: No
such process
 failed!
[warn] X2Go Session Broker: stale PID file
(/run/x2gobroker/x2gobroker-daemon.pid). Delete it manually! ... (warning).
node:~# ps ax | grep brok
 5499 ?        S      0:00 x2gobroker-authservice -s
/run/x2gobroker/x2gobroker-authservice.socket -o root -g x2gobroker -p 0660
18791 pts/0    S+     0:00 grep brok
# and again, no running x2gobroker-daemon :-(

The reason, as I found out later, was, that it tries to bind to
127.0.0.1:8080 by default, and that port is already in use by another
process on that machine.

IMO, this is a bug: when it can't bind to the port, and thus dies, this
should be returned to the start script, so it can report back "FAILED".

-Stefan

-- 
BAUR-ITCS UG (haftungsbeschränkt)
Geschäftsführer: Stefan Baur
Eichenäckerweg 10, 89081 Ulm | Registergericht Ulm, HRB 724364
Fon/Fax 0731 40 34 66-36/-35 | USt-IdNr.: DE268653243

---

From: Mike Gabriel <[email-masked]>
Date: Tue, 22 Mar 2016 11:01:34 +0000

Control: severity -1 minor

HI Stefan,

> should be returned to the start script, so it can report back "FAILED".

Yeah, this is a valid issue. Is you system launching x2gobroker-daemon  
via systemd or via System V init scripts?

Mike
-- 

DAS-NETZWERKTEAM
mike gabriel, herweg 7, 24357 fleckeby
fon: +49 (1520) 1976 148

GnuPG Key ID 0x25771B31
mail: [email-masked], http://das-netzwerkteam.de

freeBusy:
https://mail.das-netzwerkteam.de/mailxchange/kronolith/fb.php?u=m.gabriel%40das-netzwerkteam.de

---

From: Stefan Baur <[email-masked]>
Date: Tue, 22 Mar 2016 12:03:52 +0100

> via systemd or via System V init scripts?

This is on System V init, as we've seen SystemD misbehaving with some of
our own init scripts.

Kind Regards,
Stefan