Author: lslezak Date: Tue Sep 6 14:51:15 2011 New Revision: 65577 URL: http://svn.opensuse.org/viewcvs/yast?rev=65577&view=rev Log: systemd support - read/write systemd default runlevel Modified: branches/tmp/lslezak/runlevel/src/RunlevelEd.ycp Modified: branches/tmp/lslezak/runlevel/src/RunlevelEd.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/runlevel/src/RunlevelEd.ycp?rev=65577&r1=65576&r2=65577&view=diff ============================================================================== --- branches/tmp/lslezak/runlevel/src/RunlevelEd.ycp (original) +++ branches/tmp/lslezak/runlevel/src/RunlevelEd.ycp Tue Sep 6 14:51:15 2011 @@ -25,6 +25,7 @@ import "CommandLine"; import "ProductControl"; import "ProductFeatures"; + import "Systemd"; include "runlevel/toposort.ycp"; @@ -204,8 +205,8 @@ current = (string) SCR::Read (.init.scripts.current_runlevel); Progress::NextStep (); - //.. - default_runlevel = (string) SCR::Read (.init.scripts.default_runlevel); + // read the default from the current init system (systemd or classic init) + default_runlevel = Systemd::Running() ? tostring(Systemd::DefaultRunlevel()): (string) SCR::Read (.init.scripts.default_runlevel); default_orig = default_runlevel; Progress::NextStep (); @@ -512,8 +513,16 @@ Progress::Simple (_("Saving changes to runlevels."), " ", prsize + 1, ""); if (default_runlevel != default_orig) + { SCR::Write (.init.scripts.default_runlevel, default_runlevel); + // write systemd default (if present) so it works also after switch to systemd + if (Systemd::Installed()) + { + Systemd::SetDefaultRunlevel(tointeger(default_runlevel)); + } + } + if (default_runlevel == "4") { // If not in use, the whole runlevel is commented out! y2milestone ("Runlevel 4 in use!"); @@ -653,8 +662,8 @@ } } - //.. - default_runlevel = (string) SCR::Read (.init.scripts.default_runlevel); + // read the default from the current init system (systemd or classic init) + default_runlevel = Systemd::Running() ? tostring(Systemd::DefaultRunlevel()): (string) SCR::Read (.init.scripts.default_runlevel); default_orig = default_runlevel; // and finaly process map being imported -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org