[Bug 769946] New: YaST2 Service::Enable[d]("foo") no longer works in case of systemd
https://bugzilla.novell.com/show_bug.cgi?id=769946 https://bugzilla.novell.com/show_bug.cgi?id=769946#c0 Summary: YaST2 Service::Enable[d]("foo") no longer works in case of systemd Classification: openSUSE Product: openSUSE 12.2 Version: Beta 2 Platform: All OS/Version: openSUSE 12.2 Status: NEEDINFO Severity: Normal Priority: P5 - None Component: YaST2 AssignedTo: msvec@suse.com ReportedBy: jsmeix@suse.com QAContact: jsrain@suse.com CC: badshah400@gmail.com, fcrozat@suse.com InfoProvider: fcrozat@suse.com Found By: Development Blocker: --- For the history see https://bugzilla.novell.com/show_bug.cgi?id=769346#c13 Michal Svec, I assigned this issue initially to you because according to https://github.com/yast/yast-yast2/blame/master/library/runlevel/src/Service... you are one of those who currently work on Service.ycp. In the YaST printer module in printer/src/Printerlib.ycp I call Service::Enabled("cups") to test if the service cups is enabled to be started during boot and if it is not enabled I call Service::Enable("cups") to enable that the service cups is started during boot. It seems somehow this does not work if systemd is used. It works if SysVinit is used. As far as I see Service::Enable[d] is implemented in yast2/library/runlevel/src/Service.ycp and therein it seems it runs basically /sbin/chkconfig -l cups | /usr/bin/grep -q '[0-6]:on' When I run this on my openSUSE 12.2 beta2 test machine I get ---------------------------------------------------------------------------- # /sbin/chkconfig -l cups Note: This output shows SysV services only and does not include native systemd services. SysV configuration data might be overridden by native systemd configuration. cups 0:off 1:off 2:on 3:on 4:off 5:on 6:off # /sbin/chkconfig -l cups | /usr/bin/grep -q '[0-6]:on' \ && echo enabled || echo disabled Note: This output shows SysV services only and does not include native systemd services. SysV configuration data might be overridden by native systemd configuration. enabled ---------------------------------------------------------------------------- Nevertheless after a reboot, cupsd is not running. Some time ago crrodriguez@opensuse.org had added "complete systemd support" to the cups package which now provides /lib/systemd/system/cups.path /lib/systemd/system/cups.service /lib/systemd/system/cups.socket in addition to its traditional SysVinit setup via -------------------------------------------------------------------- %post %{fillup_and_insserv -ny cups cups} -------------------------------------------------------------------- in cups.spec which must stay there to be backward compatible. According to how I understand the above "Note:" in the chkconfig output it means that chkconfig is no longer the right tool for services which have a native systemd configuration. If my analysis is right, the question is must Service.ycp be adapted so that all the YaST modules which use it still work even if a service gets a native systemd configuration or must /sbin/chkconfig be adapted so that it also works even if a service gets a native systemd configuration or must all YaST modules which call Service::... functions be adapted to work even if a service gets a native systemd configuration or must something in the cups package be adapted so that it still works for both systems with SysVinit and with systemd? I do not know how to solve this because I am not a SysVinit expert and not at all a systemd expert. Frederic Crozat, could you provide uesful information how to solve this? -- 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=769946 https://bugzilla.novell.com/show_bug.cgi?id=769946#c1 Frederic Crozat <fcrozat@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW InfoProvider|fcrozat@suse.com | --- Comment #1 from Frederic Crozat <fcrozat@suse.com> 2012-07-04 11:53:16 UTC --- for cups package itself, I've updated systemd-presets-branding-openSUSE (sr #127093) chkconfig has been patched to forward request of an initscript which is shadowed by a systemd unit (like cups is now, in Factory) to systemctl. Of course, it would be better if YaST could plug directly into systemd / systemctl but it might be a little late for 12.2 (to get the status of a systemd service, the best way would be to plug to systemd using D-Bus, when running under systemd, otherwise systemctl should be used). -- 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=769946 https://bugzilla.novell.com/show_bug.cgi?id=769946#c2 Johannes Meixner <jsmeix@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|msvec@suse.com |lslezak@suse.com --- Comment #2 from Johannes Meixner <jsmeix@suse.com> 2012-07-04 12:14:05 UTC --- Ladislav Slezak, I re-assign this issue to you because according to https://github.com/yast/yast-yast2/commits/master/library/runlevel/src/Servi... you did some changes in Service.ycp in particular regarding chkconfig https://github.com/yast/yast-yast2/commit/c6bba8611107ba94e9e99016bde7df46f7... -- 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=769946 https://bugzilla.novell.com/show_bug.cgi?id=769946#c3 --- Comment #3 from Johannes Meixner <jsmeix@suse.com> 2012-07-04 12:49:43 UTC --- Regarding calling Service::Enable("cups") As far as I understand https://github.com/yast/yast-yast2/blob/master/library/runlevel/src/Service.... calling Service::Enable("cups") calls Adjust("cups", "enable") in Service.ycp which basically runs /sbin/chkconfig -a cups I run this on my openSUSE 12.2 beta2 test-system (long lines wrapped here): ------------------------------------------------------------------------------ # /sbin/chkconfig -a cups insserv: Note: sysvinit service cups is shadowed by systemd cups.service, Forwarding request to '/bin/systemctl --no-reload --root / enable cups.service'. ln -s '///lib/systemd/system/cups.service' '///etc/systemd/system/printer.target.wants/cups.service' ln -s '///lib/systemd/system/cups.socket' '///etc/systemd/system/sockets.target.wants/cups.socket' ln -s '///lib/systemd/system/cups.path' '///etc/systemd/system/multi-user.target.wants/cups.path' insserv: Forward service request to systemctl returned error status : 768 Note: This output shows SysV services only and does not include native systemd services. SysV configuration data might be overridden by native systemd configuration. cups 0:off 1:off 2:on 3:on 4:off 5:on 6:off ------------------------------------------------------------------------------ Therein the "error status : 768" does not look good and ------------------------------------------------------------------------------ # systemctl --all list-units | grep -i cups cupsd.service error inactive dead cupsd.service ------------------------------------------------------------------------------ indicates that something is really not working in case of systemd. -- 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=769946 https://bugzilla.novell.com/show_bug.cgi?id=769946#c4 --- Comment #4 from Johannes Meixner <jsmeix@suse.com> 2012-07-04 12:59:10 UTC --- More from my openSUSE 12.2 beta2 test-system: ----------------------------------------------------------------------- # /bin/systemctl --no-reload --root / enable cups.service # echo $? 3 # systemctl --all list-units | grep -i cups cupsd.service error inactive dead cupsd.service ----------------------------------------------------------------------- I have no idea what exit code 3 means here and I have no idea how to get verbose or debugging info from systemctl because "man systemctl" does not mention this. -- 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=769946 https://bugzilla.novell.com/show_bug.cgi?id=769946#c5 --- Comment #5 from Frederic Crozat <fcrozat@suse.com> 2012-07-04 13:25:00 UTC --- from what I see in my test, the "error status: 768" is caused by --root / (which shouldn't be added for a call to systemctl in the "local" environment). But since I'm very bad at perl, I guess my attempt to fix it failed (see bnc#732934, help welcome). systemctl did the right work (the service is enabled for future startup, but not started) though. systemctl --all list-units | grep -i cups output isn't very informative, I suggest using systemctl status cups.service instead. -- 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=769946 https://bugzilla.novell.com/show_bug.cgi?id=769946#c6 --- Comment #6 from Johannes Meixner <jsmeix@suse.com> 2012-07-04 14:01:32 UTC --- On my openSUSE 12.2 beta2 test-system "systemctl status cups.service" looks better: -------------------------------------------------------------------------------- # systemctl status cups.service cups.service - CUPS Printing Service Loaded: loaded (/lib/systemd/system/cups.service; enabled) Active: inactive (dead) CGroup: name=systemd:/system/cups.service # systemctl start cups.service # systemctl status cups.service cups.service - CUPS Printing Service Loaded: loaded (/lib/systemd/system/cups.service; enabled) Active: active (running) since Wed, 04 Jul 2012 15:52:52 +0200; 1s ago Main PID: 3753 (cupsd) CGroup: name=systemd:/system/cups.service â 3753 /usr/sbin/cupsd -f -------------------------------------------------------------------------------- I rebooted and cupsd is running after boot! This means that with appropriate plain systemctl commands it works. Only via YaST/chkconfig/insserv/whatever it does not work. In particular in YaST calling if( ! Service::Enabled("cups") ) Service::Enable("cups"); does not work. -- 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=769946 https://bugzilla.novell.com/show_bug.cgi?id=769946#c7 Ladislav Slezak <lslezak@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - None |P3 - Medium Status|NEW |NEEDINFO InfoProvider| |locilka@suse.com --- Comment #7 from Ladislav Slezak <lslezak@suse.com> 2013-01-11 21:52:52 UTC --- Lukas, you did some changes related to systemd recently, any chance that this was also fixed? -- 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=769946 https://bugzilla.novell.com/show_bug.cgi?id=769946#c8 Lukas Ocilka <locilka@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |RESOLVED CC| |lslezak@suse.com InfoProvider|locilka@suse.com | Resolution| |FIXED AssignedTo|lslezak@suse.com |locilka@suse.com --- Comment #8 from Lukas Ocilka <locilka@suse.com> 2013-01-14 13:14:36 UTC --- Yes, this should be fixed in yast2-2.23.15 (and later) See https://github.com/yast/yast-yast2/pull/33 -- 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