Bug 4892

Summary: "service ... start" lies, saying "OK" when it actually failed
Product: Mageia Reporter: Richard Neill <mageia>
Component: RPM PackagesAssignee: Colin Guthrie <mageia>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Normal    
Version: Cauldron   
Target Milestone: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Source RPM: dhcp-4.2.3P2-2.mga2.src.rpm CVE:
Status comment:
Bug Depends on:    
Bug Blocks: 2120    

Description Richard Neill 2012-03-12 04:05:01 CET
I just reconfigured dhcpd.conf with an error. Then I ran
 "service dhcpd start"

and was given the reply:
 "Starting dhcpd (via systemctl):        [  OK  ]"

BUT actually it didn't start ok, and 
  "service dhcpd status" shows that it did not.

It should have printed:
 "Starting dhcpd (via systemctl):        [  FAILED  ]"


[This isn't a problem in dhcpd; it's a bug in the integration of /sbin/service with systemd]
Comment 1 Remco Rijnders 2012-03-12 09:07:09 CET
Colin, can you have a look at this one please? Assigning it to you for now.

Assignee: bugsquad => mageia

Manuel Hiebel 2012-03-12 18:27:37 CET

Blocks: (none) => 2120

Comment 2 Colin Guthrie 2012-03-12 21:14:15 CET
Hmmm, I can't reproduce with another service.

I'll have a look at dhcpd specifically.

Status: NEW => ASSIGNED

Comment 3 Colin Guthrie 2012-03-12 21:29:36 CET
This looks like a problem specific to the dhcpd package to be honest, but I cannot immediately see what the problem is.

There *is* a problem - the sysconfig file we use does not properly set the options actually used in the systemd unit, but that shouldn't cause this problem.

I'll look into it, but systemctl start dhcpd.service is showing the same behaviour, so it's nothing to do with the service command (it's just passing you through to systemctl).

Will assign to systemd for now... but it might still be a unit problem in dhcpd and I'm just being blind.

Source RPM: initscripts => systemd-43-5.mga2.src.rpm

Comment 4 Colin Guthrie 2012-03-12 23:00:39 CET
OK, this is just a problem with dhcpd.service file.

It seems this was copied form fedora where a similar bug exists.

The -f or -d arguments cause the daemon not to fork, but the Type=simple (or rather the lack of any Type argument which means it defaults to simple) means that systemd pretty much just starts it and returns the shell before we even wait for the return of the command itself. It then later fails (this is a very small value of "later").

I'll rewrite the units and fix the bugs mentioned earlier.
Comment 5 Colin Guthrie 2012-03-12 23:24:18 CET
Should be fixed in latest dhcp package.

Please test and reopen of the problem persists.

Status: ASSIGNED => RESOLVED
Resolution: (none) => FIXED
Source RPM: systemd-43-5.mga2.src.rpm => dhcp-4.2.3P2-2.mga2.src.rpm

Comment 6 Richard Neill 2012-03-13 00:00:56 CET
Indeed, fixed. Thanks :-)