Bug 11191

Summary: 4_a2: systemctl disable not managing chkconfig managed daemons/services
Product: Mageia Reporter: Bit Twister <bittwister2>
Component: RPM PackagesAssignee: Colin Guthrie <mageia>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Normal CC: bittwister2, mageia
Version: Cauldron   
Target Milestone: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Source RPM: systemd-206-6.mga4.src.rpm CVE:
Status comment:

Description Bit Twister 2013-09-08 00:33:55 CEST
Description of problem:
systemctl disable not managing chkconfig managed daemons/services.

Version-Release number of selected component (if applicable):


How reproducible: Always


Steps to Reproduce:
Clean install of Mageia-4-alpha2-x86_64-DVD.iso. Default runlevel: 3
Package Group Selection screen has all package groups selected except
Other Graphical Desktops. non-free and tainted media are enabled.
Followed with:
remove-unused-packages
urpmi --downloader wget --auto --auto-update
urpme --auto-orphans and reboot. 
 
1. click up a terminal
2. su - root
3. Pick any running service that can be found with
   chkconfig --list | grep 3:on
Example: 
proftpd         0:off   1:off   2:off   3:on    4:on    5:on    6:off   7:off

4. systemctl stop proftpd
5. systemctl disable proftpd
6. reboot
7. click up a terminal
8. su - root
9. systemctl status proftpd

Note:
proftpd.service - LSB: ProFTPD FTP server
   Loaded: loaded (/etc/rc.d/init.d/proftpd)
   Active: active (running) since Sat 2013-09-07 17:22:47 CDT; 8min ago



Reproducible: 

Steps to Reproduce:
Comment 1 David Walser 2013-09-08 00:52:30 CEST
systemctl just redirects to chkconfig I think.  Does using chkconfig to disable the service work?  (chkconfig proftpd off)  chkconfig was recently updated, so something could be wrong there.

CC: (none) => luigiwalser

Comment 2 Bit Twister 2013-09-08 01:23:38 CEST
(In reply to David Walser from comment #1)
> systemctl just redirects to chkconfig I think.

Well, systemctl status will show that it is not enabled before reboot.
Testing with smb, reboot showed it disabled and running. :(

>  Does using chkconfig to disable the service work?  (chkconfig proftpd off)

Not going to bother to check. Reboot just hangs and I have to power cycle the system.

Cheap workaround is to wrap systemd server/daemon management in a wrapper to 
   systemctl stop $service
   systemctl disable $service
   chkconfig --del $service

>  chkconfig was recently updated, so something could be wrong there.

I do not think so. I had been seeing disabled services reactivated all though alpha1 but had not done any research to see what was causing it until now.

My WAG is systemd dropped a patch, again. Just like the 1 minute+ shutdown service timeout has come back to haunt us.  :(
David Walser 2013-09-08 01:46:50 CEST

CC: luigiwalser => mageia

Comment 3 Colin Guthrie 2013-09-08 12:09:15 CEST
I suspect this is something upstream too. Dunno what tho', but I confirm it's happening for me too.

Status: NEW => ASSIGNED
Assignee: bugsquad => mageia

Comment 4 Colin Guthrie 2013-09-09 09:55:26 CEST
OK, so it seems chkconfig support is now conditional and as I don't add it as a build requires, support wasn't included. I've now added an explicit --enable-chkconfig. 

Sadly this still sucks a bit it seems. Missing out the .service suffix will will still give rubbish feedback to the user on enable and disable (no feedback at all on disable!), so it definitely needs polishing, but if you include the .service suffix it does redirect properly.

I'm tempted to close this but I would like to check back and actually fix the feedback problem (and .service suffix mismatch between native units) before doing so.
Comment 5 Bit Twister 2013-09-09 11:30:47 CEST
(In reply to Colin Guthrie from comment #4)

> Sadly this still sucks a bit it seems. Missing out the .service suffix will
> will still give rubbish feedback to the user on enable and disable (no
> feedback at all on disable!), so it definitely needs polishing, but if you
> include the .service suffix it does redirect properly.

I am going to have to assume you mean with your latest systemd release.

I am a little confused as to where you are wanting the .service.
I know that the newer releases of systemd did not require .service and should be a reasonable default. I.E. No dot in service name argument, automagically add .service inside the code.

> I'm tempted to close this but I would like to check back and actually fix
> the feedback problem (and .service suffix mismatch between native units)
> before doing so.

And this is where I get confused. I have a disable_servers script.
I supply the service name, script appends .service to systemd calls, but does not supply it to chkconfig. Am I going to have to supply .system to chkconfig

Snippet of code I have been using since systemd came out.
      case $_cmd in
	disable)
	  echo "disabling $_serv - $_comment"
	  if [ $_use_systemd -eq 0 ] ; then
	    chkconfig --del "$_serv"
	  else
	    chkconfig --del "$_serv"           # kludge added for 11191 bug
	    systemctl disable ${_serv}.service
	  fi
#	  for _d in 0 1 2 3 4 5 6 7 ; do
#	    /bin/rm -f /etc/rc.d/rc${_d}.d/???${_serv}
#	  done
	;;
Comment 6 Colin Guthrie 2013-09-09 11:37:57 CEST
Sorry, I'll try and explain better.

With the latest build, you can use systemctl enable/disable with sysvinit scripts again.

Sadly, it's not perfect, e.g.:

"systemctl enable native-unit.service" and "systemctl enable native-unit" are equivalent and both work.

However, "systemctl enable sysvinit.service" and systemctl enable sysvinit" do not both work. The former works, but the latter does not. IMO this needs to be fixed so that native and non-native stuff behaves the same.

So for the avoidance of doubt, chkconfig command should never need a ".service" suffix.

Hope that helps.
Bit Twister 2014-01-18 16:32:21 CET

CC: (none) => junknospam

Comment 7 Colin Guthrie 2014-02-23 19:00:22 CET
This was fixed some time back.

Status: ASSIGNED => RESOLVED
Resolution: (none) => FIXED