[Bug 769924] New: the autoyast runlevel config kicks in after reboot only with systemd
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c0
Summary: the autoyast runlevel config kicks in after reboot
only with systemd
Classification: openSUSE
Product: openSUSE 12.2
Version: Beta 2
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: P5 - None
Component: AutoYaST
AssignedTo: locilka@suse.com
ReportedBy: ug@suse.com
QAContact: qa-bugs@suse.de
Found By: Customer
Blocker: ---
if you use systemd on 12.2 (on 12.1 too btw) and you have a runlevel config in
the autoyast XML like:
<runlevel>
<default>3</default>
<services config:type="list">
<service>
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c1
Lukas Ocilka
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c2
Lukas Ocilka
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c3
--- Comment #3 from Lukas Ocilka
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c4
Joschi Brauchle
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c5
--- Comment #5 from Lukas Ocilka
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c6
--- Comment #6 from Joschi Brauchle
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c7
Lukas Ocilka
I have done a first test with the yast2-runlevel-2.21.4 package from the YaST:Head 12.2 repo, and that test was *not* successful... But I'll try again and report back.
I'll be unifying the solution with another one already provided in Runlevel Proposal during installation. That one also takes take of service dependencies. Solution that I've implemented for this bug only additionally takes into consideration the currently running runlevel. I will merge these two together.
By the way, just to make sure: Have you considered, that the problem of services not starting without a reboot also affects *all services configured during in other autoyast modules*?
No, that's not a problem or runlevel, I'm afraid, but I'll think about it and if there is a simple solution that will not break anything else (for instance the runlevel configuration on a running system) I might add it.
That is, the problem is not limited to the services specified in the <runlevel> tag, but also affects "sssd" and "autofs" for example, which are configured during yast2-ldapclient...
Then it seems that either yast2-ldap client should start these services or AutoYast should start all enabled services at the end of the run. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c8
--- Comment #8 from Lukas Ocilka
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c9
--- Comment #9 from Joschi Brauchle
I have done a first test with the yast2-runlevel-2.21.4 package from the YaST:Head 12.2 repo, and that test was *not* successful... But I'll try again and report back.
Then it seems that either yast2-ldap client should start these services or AutoYast should start all enabled services at the end of the run. Ok, sounds reasonable. I will open a separate bugreport for this. But, if AutoYast would add a function that starts all enabled services at the end of it's run, you would not have to include that functionality into the runlevel or any other module, right? Maybe finding an overall solution to this
I've done some more tests (and added debug output to RunlevelEd.ycp) and all tests failed to start the services, because the function GetCurrentRunlevel returns "unknown". Hence, the "if (contains(service_runlevels, GetCurrentRunlevel()))" never succeeds... (In reply to comment #7) problem would fix this particular problem in the runlevel module as well. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c10
Lukas Ocilka
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c11
--- Comment #11 from Lukas Ocilka
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c12
--- Comment #12 from Joschi Brauchle
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c13
Joschi Brauchle
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c14
--- Comment #14 from Joschi Brauchle
Looking at the AutoYast flowchart http://suse.gansert.net/wp-content/uploads/2011/08/autoyast_workflow.jpg I think it would be better to start configured all services at the very end of the installation procedure (3rd to last step: "init to configured <runlevel>").
Also note that currently runlevel runs before the sysconfig module (and others). Hence, it may start services, where the sysconfig module has not had the change to make its changes! In my case, I use sysconfig to set some variables in /etc/sysconfig/autofs. But runlevel starts autofs before these variables are set! -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c15
Lukas Ocilka
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c16
Lukas Ocilka
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c17
Lukas Ocilka
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c18
Frederic Crozat
Frederic, what's the preferred solution to start all the services that are "enabled" but not running in the proper order? Is there a way using systemd/systemctl to do so?
Can we, for instance, use something like `systemctl start default.target`? Is there a better way?
"systemctl isolate default.target" would do that, but be carefull, it would also stop all services which are not enabled in the specified target / service. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c19
--- Comment #19 from Joschi Brauchle
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c20
--- Comment #20 from Thomas Fehr
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c21
--- Comment #21 from Joschi Brauchle
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c22
Thomas Fehr
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c23
Thomas Fehr
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c24
Frederic Crozat
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c25
--- Comment #25 from Thomas Fehr
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c26
--- Comment #26 from Thomas Fehr
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c27
--- Comment #27 from Frederic Crozat
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c28
--- Comment #28 from Thomas Fehr
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c29
--- Comment #29 from Thomas Fehr
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c
Thomas Fehr
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c30
--- Comment #30 from Thomas Fehr
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c31
--- Comment #31 from Thomas Fehr
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c32
--- Comment #32 from Frederic Crozat
Frederic did you already have to to look into attachment in comment#28
no sorry, been busy with other urgent things right now, I'll try later this week. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c33
--- Comment #33 from Thomas Fehr
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c34
--- Comment #34 from Thomas Fehr
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c35
--- Comment #35 from Joschi Brauchle
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c36
--- Comment #36 from Joschi Brauchle
From the manpage of systemctl, there is: "--no-block Do not synchronously wait for the requested operation to finish. If this is not specified the job will be verified, enqueued and systemctl will wait until it is completed. By passing this argument it is only verified and enqueued."
So maybe "systemctl --no-block --ignore-dependencies isolate default.target" would add this call to the queue and then YaST could continue cleaning up...? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c37
--- Comment #37 from Thomas Fehr
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c38
--- Comment #38 from Frederic Crozat
My expectation would be: If autoyast finishes at this stage, all services configured in default.target are available.
Autoyast init scripts should have the above guarantee that at the time of their execution all services are up and running. If this is not the case init scripts have to start/stop system service (like is the case in your bnc#803577) which I think should not be necessary and potentially causes new problems.
In that case, the service for starting autoyast scripts should have : After=default.target This will ensure it is started "after" all the services started for default "runlevel". -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c
Joschi Brauchle
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c39
--- Comment #39 from Joschi Brauchle
In that case, the service for starting autoyast scripts should have : After=default.target
This will ensure it is started "after" all the services started for default "runlevel".
That make sence, but then again, "isolate default.target" will end all services not part of the default target, right? So I would image systemd to end/cancel the autoyast init scripts if they are not wanted by the default target. Hence, autoyast init scripts must be wanted by **and** started after the default target..? Is that possible..? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c40
--- Comment #40 from Thomas Fehr
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c41
--- Comment #41 from Frederic Crozat
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c42
--- Comment #42 from Joschi Brauchle
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c43
--- Comment #43 from Frederic Crozat
BTW, just asking: is the "--ignore-dependencies" currently used with "isolate default.target" really needed?
No, I'm not sure it is needed.. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c44
--- Comment #44 from Thomas Fehr
Maybe it works by replacing "WantedBy=default.target" with "After=default.target" and then issuing: systemctl --no-block isolate default.target systemctl --no-block start autoyast-initscripts.service and then finishing up within YaST stage2.
I would image systemd to order them and start them correctly, once YaST-stage2 finishes?
BTW, just asking: is the "--ignore-dependencies" currently used with "isolate default.target" really needed?
But what if for some reason "systemctl isolate " hangs (potentially forever) for some reason. YaST is finished, user expects system to be usable but autoyast-initscripts.service is delayed forever. Currently there is a log entry on autoyast screen saying Activating systemd default target So if it hangs it is quite clear, something is wrong and where to look. This information would be much harder to get when using "--no-block". -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c45
--- Comment #45 from Frederic Crozat
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c46
--- Comment #46 from Thomas Fehr
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c47
Frederic Crozat
Current state is the following: - autoyast2 wants to initiate current runlevel by calling "systemctl isolate default-target" - since yast2 itself is started by a systemd service (YaST2-Second-Stage.service) calling "systemctl isolate default-target" blocks forever - so far I do not want to simply use "--no-block" since when autoyast2 finishes (and autoyast init scripts are called afterwards) I wnt to be sure that all services started with "systemctl isolate default-target" are up and running
Why is this call needed at all in the first place ? systemd has been initially started to go to this target, so it will go there, after YaST2 Second Stage is finished. I'm a bit lost (and confused on when Second Stage is being expected to started, which seems different in your case and the usual case). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c48
--- Comment #48 from Thomas Fehr
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c49
Thomas Fehr
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c50
--- Comment #50 from Bernhard Wiedemann
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c51
--- Comment #51 from Joschi Brauchle
https://bugzilla.novell.com/show_bug.cgi?id=769924
https://bugzilla.novell.com/show_bug.cgi?id=769924#c52
--- Comment #52 from Frederic Crozat
participants (1)
-
bugzilla_noreply@novell.com