Skip to content

Bug: launching nbd-client (and other daemons) in rc.local blocks shutdown in Ubuntu 16.04 #5497

Closed
@jonsito

Description

@jonsito

Submission type

  • [X ] Bug report
  • Request for enhancement (RFE)

NOTE: Do not submit anything other than bug reports or RFEs via the issue tracker!

systemd version the issue has been seen with

Using systemd 229-4ubuntu16 native

NOTE: Do not submit bug reports about anything but the two most recently released systemd versions upstream!

Used distribution

Ubuntu 16.04 fully updated

In case of bug report: Expected behaviour you didn't see

On pressing power button, executing /sbin/poweroff, or click "poweroff" from session ( also with reboot/shutdown ) system must power off

In case of bug report: Unexpected behaviour you saw

System closes session, start poweroff process... and stall.
Sometimes a message is shown:
A stop job is running for /etc/rc.d/rc.local Compatibility (29min 39s / no limit)

In case of bug report: Steps to reproduce the problem

  • Edit /etc/rc.local to start nbd-client (or any other daemon that forks/exit )
  • Restart computer
  • Verify that daemon is running
  • Try to shutdown/reboot/poweroff

Additional info:

  • The problem is related in the fact that rc.local expect every process started on it should finish and return an exit status.
  • As "nbd-client" daemonizes itself, rc.local associated cgroup remains in active/(running) status;
    you can check it by mean of "systemctl status rc.local" . In shutdown, systemd waits for rc.local to finish (as stated "running" ) but has no timeout declared, so waits forever
  • if you kill related daemons rc.local service status becomes active/(exited) and shutdown works as expected
  • Invoke command by mean of "nohup" or process in background "&" has no effect: PID is anyway associated to rc.local cgroup.
  • The only way to start a daemon in rc.local is by mean of "at -f <commandfile_that_includes_daemon> now", as atd runs in a separate cgroup thus rc.local gets no running PIDs in their group

img_20170228_111011

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-reporter-feedback ❓There's an unanswered question, the reporter needs to answer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions