Skip to content

Socket activation does not work #1492

@lez

Description

@lez

I configured socket activation using this .socket file:

[Socket]
ListenStream=10090

When I connect to port 10090, cherrypy starts up, but throws an error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/cherrypy/process/wspbus.py", line 202, in publish
    output.append(listener(*args, **kwargs))
  File "/usr/local/lib/python3.5/dist-packages/cherrypy/_cpserver.py", line 168, in start
    ServerAdapter.start(self)
  File "/usr/local/lib/python3.5/dist-packages/cherrypy/process/servers.py", line 171, in start
    wait_for_free_port(*self.bind_addr)
  File "/usr/local/lib/python3.5/dist-packages/cherrypy/process/servers.py", line 442, in wait_for_free_port
    raise IOError("Port %r not free on %r" % (port, host))
OSError: Port 10090 not free on '0.0.0.0'

When I remove the lines from around server.py:172, the socket activation works fine:

# Start the httpserver in a new thread.
if isinstance(self.bind_addr, tuple):
    wait_for_free_port(*self.bind_addr)

I use the HEAD version of cherrypy, and the following systemd version:

systemd 229
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions