Browse Source

Closing FCGX socket + unlinking unix socket before bind

Yann Weber 4 years ago
parent
commit
5f5c8043a9
2 changed files with 4 additions and 1 deletions
  1. 1
    1
      src/ipc.c
  2. 3
    0
      src/monitor.c

+ 1
- 1
src/ipc.c View File

@@ -210,7 +210,7 @@ int pyfcgi_IPC_destroy(pyfcgi_ipc_flag_t flag)
210 210
 			{
211 211
 				err = errno;
212 212
 				pyfcgi_log(LOG_ALERT,
213
-					"Unable to destroy %s semaphore (%s) : %s",
213
+					"Unable to unlink %s semaphore (%s) : %s",
214 214
 					semnames[i], PyFCGI_SEM(i).name,
215 215
 					strerror(err));
216 216
 				res = -1;

+ 3
- 0
src/monitor.c View File

@@ -5,6 +5,7 @@ static pyfcgi_monitor_t pyfcgi_mon;
5 5
 static void clean_exit(int status)
6 6
 {
7 7
 	pyfcgi_wd_stop();
8
+	pyfcgi_log(LOG_DEBUG, "Exiting with status %d", status);
8 9
 	if(pyfcgi_mon.sockserv)
9 10
 	{
10 11
 		if(pyfcgi_mon.sockcli)
@@ -359,6 +360,8 @@ int pyfcgi_monitor_parse_sock(const char *sockurl, int sockargs[3],
359 360
 		*protocol = 0;
360 361
 		addr_un->sun_family = AF_UNIX;
361 362
 		strncpy(addr_un->sun_path, addr_ptr, UNIX_SOCKPATH_MAX);
363
+
364
+		unlink(addr_ptr); // if socket exists delete it
362 365
 		return 0;
363 366
 	}
364 367
 

Loading…
Cancel
Save