Bug 812541

Summary: reboot won't proceed
Product: [openSUSE] openSUSE 12.3 Reporter: Jiri Slaby <jslaby>
Component: BasesystemAssignee: systemd maintainers <systemd-maintainers>
Status: RESOLVED UPSTREAM QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: fbui
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: openSUSE 12.3   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: journalctl output
journalctl with try-restart

Description Jiri Slaby 2013-03-29 20:40:00 UTC
Created attachment 532700 [details]
journalctl output

Not even after some time. I'm attaching journalctl from debug shell when this happens (which is every time).
Comment 1 Frederic Crozat 2013-04-02 11:22:36 UTC
This looks similar to bnc#787228

Did you change the vpn config to not restart dnsmasq on shutdown ?
Comment 2 Jiri Slaby 2013-04-02 15:05:48 UTC
Of course, my bad. This is another machine. Sorry for the noise.

*** This bug has been marked as a duplicate of bug 787228 ***
Comment 3 Jiri Slaby 2013-04-08 07:48:46 UTC
Created attachment 533912 [details]
journalctl with try-restart

(In reply to comment #2)
> Of course, my bad. This is another machine. Sorry for the noise.

Not really. I had 'dnsmasq restart' there, so I changed that to try-restart, but still the issue is there.
Comment 4 Jiri Slaby 2013-04-08 07:49:08 UTC
.
Comment 5 Frederic Crozat 2013-04-08 13:48:34 UTC
Apr 08 09:34:32 anemoi systemd[1]: Trying to enqueue job dnsmasq.service/try-restart/replace
Apr 08 09:34:32 anemoi systemd[1]: Job dnsmasq.service/stop finished, result=canceled
Apr 08 09:34:32 anemoi systemd[1]: Installed new job dnsmasq.service/restart as 906

So, try-restart replaced "stop" by "restart" because it wasn't stopped at the time try-restart was reached.

The "real" fix (non abortable shutdown / kexec / reboot) will be available in Factory soon but I can't backport it for 12.3 (changes are too intrusive).

I've asked upstream their opinion on whether try-restart should ack as "no-op" or "restart" if a "stop" call is pending. There is currently no precise answer for this so I've sent a mail on systemd-devel mailing list to see if we can change the behavior or not.

In the mean time, you should probably add something like:
systemd_booting () {
        # returns 0 when we boot, 1 in running system
        systemctl show -p ActiveState default.target | grep -qi inactive
}

and use it to call systemctl try-restart dnsmasq.service only if system is in running state..
Comment 6 Jiri Slaby 2013-04-09 08:15:05 UTC
(In reply to comment #5)
> The "real" fix (non abortable shutdown / kexec / reboot) will be available in
> Factory soon but I can't backport it for 12.3 (changes are too intrusive).

Ok, is it safe to install Base:System's systemd on the top of 12.3? I'm using tumbleweed anyway, so I'm asking if adding new systemd there is an option?
Comment 7 Frederic Crozat 2013-04-09 08:35:50 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > The "real" fix (non abortable shutdown / kexec / reboot) will be available in
> > Factory soon but I can't backport it for 12.3 (changes are too intrusive).
> 
> Ok, is it safe to install Base:System's systemd on the top of 12.3? I'm using
> tumbleweed anyway, so I'm asking if adding new systemd there is an option?

Right now, Base:System doesn't have new systemd (I'm planning to work on it this week). It "should" work but it is less tested and I can't make any garantee on how broken it will be in the future when used on 12.3, during 13.1 development.

I would suggest to "workaround" the try-restart issue instead, might be more stable ;)
Comment 8 Jiri Slaby 2013-04-09 08:40:10 UTC
Ok, I'm now having this:

if ! systemctl show -p ActiveState default.target | grep -qi inactive; then
        systemctl try-restart dnsmasq.service
fi
Comment 10 Jiri Slaby 2013-04-15 07:45:50 UTC
(In reply to comment #8)
> Ok, I'm now having this:
> 
> if ! systemctl show -p ActiveState default.target | grep -qi inactive; then
>         systemctl try-restart dnsmasq.service
> fi

This doesn't work when openvpn is started during boot-up -- dnsmasq is not restarted at that time. I have to restart it manually.
Comment 11 Frederic Crozat 2013-04-19 13:14:55 UTC
Could you try :

if ! systemctl show -p ActiveState shutdown.target | grep -qi active; then
        systemctl try-restart dnsmasq.service
fi

This should detect properly when the system is in shutdown mode (the other test was more to detect when system was not in startup mode).
Comment 12 Jiri Slaby 2013-04-20 08:22:55 UTC
(In reply to comment #11)
> Could you try :
> 
> if ! systemctl show -p ActiveState shutdown.target | grep -qi active; then
>         systemctl try-restart dnsmasq.service
> fi

This doesn't work either. Are you sure with the 'not'?
Comment 13 Jiri Slaby 2013-04-20 08:24:15 UTC
I mean this:

> if ! systemctl show -p ActiveState shutdown.target | grep -qi active; then

     ^
-----'
Comment 14 Jiri Slaby 2013-04-20 08:25:25 UTC
This whole is weird. 'grep active' matches both active *and* inactive...
Comment 15 Frederic Crozat 2013-04-22 08:42:10 UTC
err, I should learn to type, someday :)

if systemctl show -p ActiveState shutdown.target | grep -qi =active ; then


should work much better..
Comment 16 Jiri Slaby 2013-04-25 14:09:55 UTC
(In reply to comment #15)
> err, I should learn to type, someday :)
> 
> if systemctl show -p ActiveState shutdown.target | grep -qi =active ; then
> 
> 
> should work much better..

Are you sure?
  if systemctl show -p ActiveState shutdown.target | grep -qi =active; then
    echo aa
  fi
doesn't print anything on a running system. Maybe it's OK, but I don't see why it should be :)...
Comment 17 Franck Bui 2015-07-02 13:26:47 UTC
Since the proper fix has been included since v198 meaning that opensuse 13.[12] have it and opensuse 12.3 is not supported anymore, it should be safe to close this bug.