No use touching the socket if PID file creation fails.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12287
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
int res, ret = -1;
struct tevent_fd *fde;
- /* create a unix domain stream socket to listen to */
- res = ux_socket_bind(ctdb);
- if (res!=0) {
- DEBUG(DEBUG_ALERT,("Cannot continue. Exiting!\n"));
- exit(10);
- }
-
if (do_fork && fork()) {
return 0;
}
CTDB_VERSION_STRING, ctdb->ctdbd_pid));
ctdb_create_pidfile(ctdb);
+ /* create a unix domain stream socket to listen to */
+ res = ux_socket_bind(ctdb);
+ if (res!=0) {
+ DEBUG(DEBUG_ALERT,("Cannot continue. Exiting!\n"));
+ exit(10);
+ }
+
/* Make sure we log something when the daemon terminates.
* This must be the first exit handler to run (so the last to
* be registered.