[systemd-devel] socket unit refusing connection when JOB_STOP is pending

Michal Sekletar msekleta at redhat.com
Mon Jun 5 09:49:58 UTC 2017

On Wed, May 31, 2017 at 3:43 PM, Moravec, Stanislav (ERT)
<stanislav.moravec at hpe.com> wrote:
> FYI:
> I tried to simply bypass the pending job check:
> +int ignore_stop_pending = true;
> static void socket_enter_running(Socket *s, int cfd) {
> ...
> -        if (unit_stop_pending(UNIT(s))) {
> +        if (!ignore_stop_pending && unit_stop_pending(UNIT(s))) {
> But, as expected, it's not as that easy - the startup of the service fails to get queued.

This is because, stop jobs queued on shutdown have special job mode
that doesn't allow them to be replaced. When you removed the check you
caused activation to go through and that generated start jobs that
would normally replace pending stop jobs. But like I said, on shutdown
those stop job objects have the special job mode (flag) that prohibits


More information about the systemd-devel mailing list