mirror of
https://github.com/ceph/ceph
synced 2025-02-23 19:17:37 +00:00
mgr: close restful socket after exec
Signed-off-by: liushi <liu.shi@navercorp.com>
This commit is contained in:
parent
8186dd98a6
commit
ec3a696a5d
@ -13,6 +13,7 @@ import threading
|
||||
import traceback
|
||||
import six
|
||||
import socket
|
||||
import fcntl
|
||||
|
||||
from . import common
|
||||
from . import context
|
||||
@ -331,6 +332,10 @@ class Module(MgrModule):
|
||||
),
|
||||
ssl_context=(cert_fname, pkey_fname),
|
||||
)
|
||||
sock_fd_flag = fcntl.fcntl(self.server.socket.fileno(), fcntl.F_GETFD)
|
||||
if not (sock_fd_flag & fcntl.FD_CLOEXEC):
|
||||
self.log.debug("set server socket close-on-exec")
|
||||
fcntl.fcntl(self.server.socket.fileno(), fcntl.F_SETFD, sock_fd_flag | fcntl.FD_CLOEXEC)
|
||||
if self.stop_server:
|
||||
self.log.debug('made server, but stop flag set')
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user