[Bug 811870] New: Recent commit causes SysV services not to be enabled
https://bugzilla.novell.com/show_bug.cgi?id=811870 https://bugzilla.novell.com/show_bug.cgi?id=811870#c0 Summary: Recent commit causes SysV services not to be enabled Classification: openSUSE Product: openSUSE 12.3 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: YaST2 AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: joschibrauchle@gmx.de QAContact: jsrain@suse.com Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:19.0) Gecko/20100101 Firefox/19.0 Due to the recent commit to yast2, https://github.com/yast/yast-yast2/commit/f600967b96446de309a63ca6ed9154a4ba... Yast now calls "systemctl is-enabled <service>" to check if a service is enabled before it actually enables it. Problem: This does not work correctly for old sysvinit services due to a possible bug in systemd, see the following y2log: ---------- 2013-03-26 19:36:19 <1> student04(4489) [YCP] RunlevelEd.ycp:687 Setting nfs: ["3", "5"] 2013-03-26 19:36:19 <2> student04(4489) [YCP] Service.ycp:341 Cannot enable service nfs (just) in selected runlevels, enabling in all default ones 2013-03-26 19:36:19 <3> student04(4489) [bash] ShellCommand.cc(shellcommand):78 nfs.service is not a native service, redirecting to /sbin/chkconfig. 2013-03-26 19:36:19 <3> student04(4489) [bash] ShellCommand.cc(shellcommand):78 Executing /sbin/chkconfig nfs --level=5 ---------- The installed system ends up with nfs service not running. The reason is this: ---------- -bash-4.2# rcnfs status Checking for mounted nfs shares (from /etc/fstab):gssd not running idmapd not running unused nfs.service - LSB: NFS client services Loaded: loaded (/etc/init.d/nfs) Active: inactive (dead) CGroup: name=systemd:/system/nfs.service -bash-4.2# /sbin/chkconfig -l nfs Note: This output shows SysV services only and does not include native systemd services. SysV configuration data might be overridden by native systemd configuration. nfs 0:off 1:off 2:off 3:off 4:off 5:off 6:off -bash-4.2# systemctl is-enabled nfs.service nfs.service is not a native service, redirecting to /sbin/chkconfig. Executing /sbin/chkconfig nfs --level=5 nfs off enabled -bash-4.2# ---------- Clearly, "systemctl is-enabled nfs.service" incorrectly reports nfs to be "enabled" although it is disabled! Due to this wrong information and the commit mentioned above, YaST now does not enable sysvinit services because systemd tells it they would already be enabled! Reproducible: Always Steps to Reproduce: 1. Let YaST enable a sysvinit service 2. YaST calls "systemctl is-enabled <service>" which wrongly reports it to be enabled -- 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=811870 https://bugzilla.novell.com/show_bug.cgi?id=811870#c1 Joschi Brauchle <joschibrauchle@gmx.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|YaST2 |Basesystem QAContact|jsrain@suse.com |qa-bugs@suse.de --- Comment #1 from Joschi Brauchle <joschibrauchle@gmx.de> 2013-03-26 23:00:18 UTC --- Actually, it looks like the "chkconfig" command included in aaa_base does not support the "--level" option. Also, systemctl seems to check the exit code of "chkconfig <service> --level 5", which currently does not give any indication of the service state. See: ---------- -bash-4.2# chkconfig nfs; echo $? nfs off 0 -bash-4.2# chkconfig xdm; echo $? xdm on 0 ---------- So is this a problem of chkconfig in aaa_base? -- 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=811870 https://bugzilla.novell.com/show_bug.cgi?id=811870#c Joschi Brauchle <joschibrauchle@gmx.de> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team-screening@forge.pr |lnussel@suse.com |ovo.novell.com | Summary|Recent commit causes SysV |Change in YaST causes |services not to be enabled |SysVinit services not to be | |enabled -- 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=811870 https://bugzilla.novell.com/show_bug.cgi?id=811870#c2 Joschi Brauchle <joschibrauchle@gmx.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fcrozat@suse.com --- Comment #2 from Joschi Brauchle <joschibrauchle@gmx.de> 2013-03-27 09:41:26 UTC --- (In reply to comment #1)
Actually, it looks like the "chkconfig" command included in aaa_base does not support the "--level" option. Correction: It does seem to support it but does not say so in the man page.
The line where systemd decides about the status of a sysvinit service is here: http://cgit.freedesktop.org/systemd/systemd/tree/src/systemctl/systemctl.c#n... So I can't tell who's fault this is :-) -- 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=811870 https://bugzilla.novell.com/show_bug.cgi?id=811870#c3 --- Comment #3 from Frederic Crozat <fcrozat@suse.com> 2013-03-27 09:47:18 UTC --- for systemd .service, chkconfig will forward by default the enable/disable to systemctl, which will use the defaults in the .service. I guess handling levels for systemd .service could be done by chkconfig creating the symlink in /etc/systemd/runlevel<N>.target.wants/ manually, but my perl skills are way too limited to patch it myself :( -- 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=811870 https://bugzilla.novell.com/show_bug.cgi?id=811870#c4 --- Comment #4 from Joschi Brauchle <joschibrauchle@gmx.de> 2013-03-27 10:01:05 UTC --- Hello Frederic, the problem is not the "enable" or "disable" command, but rather "is-enabled". It seems that systemd incorrectly reports sysvinit services as "enabled" although that is not true. This leads to YaST not enabling them, because it gets the wrong information. -- 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=811870 https://bugzilla.novell.com/show_bug.cgi?id=811870#c5 Ludwig Nussel <lnussel@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO InfoProvider| |joschibrauchle@gmx.de --- Comment #5 from Ludwig Nussel <lnussel@suse.com> 2013-03-27 11:07:15 CET --- systemd just doesn't use the suse syntax for the check: # chkconfig -c nfs 5 So this could be called a missing adoption to suse in systmed. OTOH implementing compat syntax in chkconfig is reasonably simple as well. Could you please try the attached patch to chkconfig? -- 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=811870 https://bugzilla.novell.com/show_bug.cgi?id=811870#c6 --- Comment #6 from Ludwig Nussel <lnussel@suse.com> 2013-03-27 11:07:45 CET --- Created an attachment (id=532069) --> (http://bugzilla.novell.com/attachment.cgi?id=532069) chkconfig patch -- 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=811870 https://bugzilla.novell.com/show_bug.cgi?id=811870#c7 --- Comment #7 from Frederic Crozat <fcrozat@suse.com> 2013-03-27 10:17:37 UTC --- (In reply to comment #4)
Hello Frederic, the problem is not the "enable" or "disable" command, but rather "is-enabled".
It seems that systemd incorrectly reports sysvinit services as "enabled" although that is not true.
Looking at systemd code, is-enabled is "global" and not restricted to a specific runlevel (or target, in "systemd" speak). -- 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=811870 https://bugzilla.novell.com/show_bug.cgi?id=811870#c8 Joschi Brauchle <joschibrauchle@gmx.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW InfoProvider|joschibrauchle@gmx.de | --- Comment #8 from Joschi Brauchle <joschibrauchle@gmx.de> 2013-03-27 10:20:06 UTC --- I applied the patch but still get this: ---------- st-brauchle:~ # systemctl is-enabled ntp.service ntp.service is not a native service, redirecting to /sbin/chkconfig. Executing /sbin/chkconfig ntp --level=5 ntp off enabled ---------- Does chkconfig adjust its exit code according to the service status? I think this is what systemd expects, looking at the code here: http://cgit.freedesktop.org/systemd/systemd/tree/src/systemctl/systemctl.c#n... But maybe I'm wrong? -- 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=811870 https://bugzilla.novell.com/show_bug.cgi?id=811870#c9 --- Comment #9 from Joschi Brauchle <joschibrauchle@gmx.de> 2013-03-27 10:49:14 UTC --- If I understand the code correct, Fedora (for example) does return 0/1 for service state on/off. See http://git.fedorahosted.org/cgit/chkconfig.git/tree/chkconfig.c#n816 -- 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=811870 https://bugzilla.novell.com/show_bug.cgi?id=811870#c10 --- Comment #10 from Ludwig Nussel <lnussel@suse.com> 2013-03-27 14:06:47 CET --- Are you sure you applied the patch correctly? # chkconfig ntp --level=5; echo $? 0 # chkconfig ntp off # chkconfig ntp --level=5; echo $? 1 -- 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=811870 https://bugzilla.novell.com/show_bug.cgi?id=811870#c11 --- Comment #11 from Joschi Brauchle <joschibrauchle@gmx.de> 2013-03-27 13:18:08 UTC --- You're right, seems something went wrong on my part! Trying the second time did the job. Thanks for the quick fix. -- 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=811870 https://bugzilla.novell.com/show_bug.cgi?id=811870#c12 Joschi Brauchle <joschibrauchle@gmx.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO InfoProvider| |joschibrauchle@gmx.de --- Comment #12 from Joschi Brauchle <joschibrauchle@gmx.de> 2013-03-27 13:19:12 UTC --- I will include the patch in my autoinstallation and report back ASAP if the problem of YaST not enabling services is gone. -- 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=811870 https://bugzilla.novell.com/show_bug.cgi?id=811870#c13 Joschi Brauchle <joschibrauchle@gmx.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW InfoProvider|joschibrauchle@gmx.de | --- Comment #13 from Joschi Brauchle <joschibrauchle@gmx.de> 2013-03-27 15:47:28 UTC --- Looking good, all sysvinit services are enabled correctly now after installation using yast2-2.23.23. -- 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=811870 https://bugzilla.novell.com/show_bug.cgi?id=811870#c14 --- Comment #14 from Bernhard Wiedemann <bwiedemann@suse.com> 2013-03-27 17:00:27 CET --- This is an autogenerated message for OBS integration: This bug (811870) was mentioned in https://build.opensuse.org/request/show/161460 Maintenance / -- 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=811870 https://bugzilla.novell.com/show_bug.cgi?id=811870#c15 Ludwig Nussel <lnussel@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #15 from Ludwig Nussel <lnussel@suse.com> 2013-03-28 16:42:31 CET --- closing as fixed. I suppose the maintenance update will be approved after easter. -- 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=811870 https://bugzilla.novell.com/show_bug.cgi?id=811870#c16 --- Comment #16 from Bernhard Wiedemann <bwiedemann@suse.com> 2013-03-28 17:00:22 CET --- This is an autogenerated message for OBS integration: This bug (811870) was mentioned in https://build.opensuse.org/request/show/161632 Factory / aaa_base -- 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=811870 https://bugzilla.novell.com/show_bug.cgi?id=811870#c17 --- Comment #17 from Swamp Workflow Management <swamp@suse.de> 2013-04-10 10:05:25 UTC --- openSUSE-RU-2013:0652-1: An update that has three recommended fixes can now be installed. Category: recommended (low) Bug References: 809842,811870,812291 CVE References: Sources used: openSUSE 12.3 (src): aaa_base-12.3-14.8.1 -- 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.
participants (1)
-
bugzilla_noreply@novell.com