Bug 2071

Summary: systemctl is listing the akmods service as failed
Product: Fedora Reporter: Jason <jmontleo>
Component: akmodsAssignee: Richard <hobbes1069>
Status: RESOLVED INVALID    
Severity: normal CC: kwizart
Priority: P5    
Version: 16   
Hardware: All   
OS: GNU/Linux   
namespace:

Description Jason 2011-12-01 21:13:03 CET
Probably because akmods like to exit 1 when there is nothing to do

[root@fedora ~]#
/usr/sbin/akmods --from-init; echo $?
No akmod packages found, nothing to do.                    [  OK  ]
1
[root@fedora ~]# systemctl start akmods.service
Job failed. See system logs and 'systemctl status' for details.
[root@fedora ~]# systemctl status akmods.service
akmods.service - LSB: Builds and install new kmods from akmod packages
	  Loaded: loaded (/etc/rc.d/init.d/akmods)
	  Active: failed since Thu, 01 Dec 2011 15:03:54 -0500; 18s ago
	 Process: 2141 ExecStart=/etc/rc.d/init.d/akmods start (code=exited, status=1/FAILURE)
	  CGroup: name=systemd:/system/akmods.service


changing in /usr/sbin/akmods:
                echo -n "No akmod packages found, nothing to do." >&2
                echo_success; echo; exit 1
to:
                echo -n "No akmod packages found, nothing to do." >&2
                echo_success; echo; exit 0

yields:
[root@fedora ~]# systemctl start akmods.service
[root@fedora ~]# systemctl status akmods.service
akmods.service - LSB: Builds and install new kmods from akmod packages
	  Loaded: loaded (/etc/rc.d/init.d/akmods)
	  Active: inactive (dead) since Thu, 01 Dec 2011 15:10:17 -0500; 5s ago
	 Process: 2330 ExecStop=/etc/rc.d/init.d/akmods stop (code=exited, status=0/SUCCESS)
	 Process: 2321 ExecStart=/etc/rc.d/init.d/akmods start (code=exited, status=0/SUCCESS)
	  CGroup: name=systemd:/system/akmods.service


or changing in /etc/init.d/akmods and running systemctl --system daemon-reload:
                start_akmods
                ;;
to:
                start_akmods
                exit 0
                ;;
yields:
[root@fedora ~]# systemctl start akmods.service
[root@fedora ~]# systemctl status akmods.service
akmods.service - LSB: Builds and install new kmods from akmod packages
	  Loaded: loaded (/etc/rc.d/init.d/akmods)
	  Active: inactive (dead) since Thu, 01 Dec 2011 15:10:17 -0500; 5s ago
	 Process: 2330 ExecStop=/etc/rc.d/init.d/akmods stop (code=exited, status=0/SUCCESS)
	 Process: 2321 ExecStart=/etc/rc.d/init.d/akmods start (code=exited, status=0/SUCCESS)
	  CGroup: name=systemd:/system/akmods.service

Since the process completed and there was simply nothing to do I don't really see why it exits with status=1, but either way it is giving systemctl the idea that it failed rather than that it exited because there was nothing to do.
Comment 1 Richard 2011-12-01 21:31:45 CET
What package version are you using?
Comment 2 Jason 2011-12-01 21:40:46 CET
akmods-0.3.7-1.fc16.noarch
Comment 3 Richard 2011-12-01 22:00:13 CET
This is a known problem which should be fixed but the packages are in updates-testing. 

Try:

yum --enablerepo=rpmfusion-free-updates-testing update akmods

and see if that fixes it for you.

Richard
Comment 4 Jason 2011-12-02 00:29:30 CET
I see the same thing with the update (and after a reboot). I don't see anything in the new package that would change the exit code to 0 so that systemctl sees it as a success.

[root@fedora ~]# rpm -q akmods
akmods-0.3.8-3.fc16.noarch
[root@fedora ~]# systemctl status akmods.service
akmods.service - LSB: Builds and install new kmods from akmod packages
	  Loaded: loaded (/etc/rc.d/init.d/akmods)
	  Active: failed since Thu, 01 Dec 2011 18:23:13 -0500; 3min 24s ago
	 Process: 1143 ExecStart=/etc/rc.d/init.d/akmods start (code=exited, status=1/FAILURE)
	  CGroup: name=systemd:/system/akmods.service
[root@fedora ~]# systemctl start akmods
Failed to issue method call: Unit name akmods is not valid.
[root@fedora ~]# systemctl start akmods.service
Job failed. See system logs and 'systemctl status' for details.
[root@fedora ~]#
Comment 5 Richard 2011-12-02 01:33:22 CET
Yeah, now that I think about it there was a problem with it exiting with 128 instead of 0 but this is the first time someone has reported a problem exiting as 1.

However, one could argue that someone running akmods without any kmods installed could be considered an error, no?
Comment 6 Richard 2011-12-06 22:04:23 CET
Please let me know if you don't agree with my last comment, otherwise I'm going to go ahead and close this bug.

Thanks,
Richard
Comment 7 Richard 2011-12-27 14:57:32 CET
Closing.