This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours

Bug 716994

Summary: Provide native systemd unit file
Product: [Fedora] Fedora Reporter: Jóhann B. Guðmundsson <johannbg>
Component: kexec-toolsAssignee: WANG Chao <chaowang>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: caiqian, fche, johannbg, nhorman, ruyang
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: kexec-tools-2.0.2-29.fc16 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-07 04:33:37 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 713562    

Description Jóhann B. Guðmundsson 2011-06-27 13:09:13 EDT
Description of problem:

https://fedoraproject.org/wiki/Features/SysVtoSystemd


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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Jóhann B. Guðmundsson 2011-06-28 13:58:16 EDT
is it possible to split kexec and kdump?
Comment 2 Jóhann B. Guðmundsson 2011-07-04 16:50:45 EDT
Note that you need to package the old sysv init script separately or drop it as stated but the packaging guidelines.

"SysV Initscripts
Packages may also provide a SysV initscript file, but are not required to do so. This format is considered legacy, but Fedora still contains init mechanisms such as upstart which do not support the systemd unit file format. If present, the SysV initscript(s) must go into an optional subpackage, so as not to confuse sysadmins. The guidelines for SysV initscripts can be found here: Packaging:SysVInitScript"

https://fedoraproject.org/wiki/Packaging:Guidelines:Systemd
https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd
http://fedoraproject.org/wiki/Packaging:Tmpfiles.d

Currently there's about 60/40 drop/keep ratio...
Comment 3 Jóhann B. Guðmundsson 2011-07-04 17:23:57 EDT
Hence hacks like these dont cut it...

[Unit]
Description=Crash recovery kernel arming
After=network.target 

[Service]
Type=oneshot
ExecStart=/etc/init.d/kdump start <--- wtf ;) 
RemainAfterExit=yes
Comment 4 Jóhann B. Guðmundsson 2011-07-06 18:13:54 EDT
I've flagged Kexec as done on https://fedoraproject.org/wiki/User:Johannbg/Features/SysVtoSystemd and you can close this as FIXED to get it off the alpha blocker bug 

Thanks for quick responces.
Comment 5 Fedora Admin XMLRPC Client 2011-07-15 11:01:53 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 6 Jóhann B. Guðmundsson 2011-07-15 11:04:58 EDT
Could you please close this bug now that you have shipped a native systemd unit file so it goes of the bug trackers radar 

Any addtional changes can be submitted via update..

Thanks.
Comment 7 Fedora Update System 2011-09-09 15:12:05 EDT
kexec-tools-2.0.2-29.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/kexec-tools-2.0.2-29.fc16
Comment 8 Fedora Update System 2011-09-10 14:57:40 EDT
Package kexec-tools-2.0.2-29.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing kexec-tools-2.0.2-29.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/kexec-tools-2.0.2-29.fc16
then log in and leave karma (feedback).
Comment 9 Fedora Update System 2011-09-30 14:55:32 EDT
kexec-tools-2.0.2-29.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 10 Frank Ch. Eigler 2011-12-19 14:00:53 EST
How is automatic kdump-start-at-boot supposed to work with these unit files?

# systemctl enable kdump.service
Warning: unit files do not carry install information. No operation executed.
Comment 11 Jóhann B. Guðmundsson 2011-12-19 15:41:54 EST
If that happens the unit is missing an install section as in...

[Install]
WantedBy=multi-user.target

Just note that in some cases this can be intentionally left out just add the above is that is not the case.
Comment 12 Jóhann B. Guðmundsson 2011-12-19 15:42:42 EST
s/is that/if that/
Comment 13 Fedora Admin XMLRPC Client 2012-04-16 02:12:22 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 14 Dave Young 2012-06-04 02:32:41 EDT
(In reply to comment #11)
> If that happens the unit is missing an install section as in...
> 
> [Install]
> WantedBy=multi-user.target
> 
> Just note that in some cases this can be intentionally left out just add the
> above is that is not the case.

Hello Johann

With this WantedBy line kdump service still fails start-at-boot, because it depends on /boot/ mounted, I tried add local-fs.target to Wants seems it does not help. Do you have idea about this?
Comment 15 Jóhann B. Guðmundsson 2012-06-04 09:42:47 EDT
The WantedBy line in the [Install] section of the unit is only relevant to which boot target you want the service to be enable in. 

You order startup ordering of units with After= or Before=. 

So the After= line should go from this "After=network.target" 

to this.., 

"After=local-fs.target network.target" 

To be order after local mount points 

and this... 

After=local-fs.target remote-fs.target network.target" 

if for some reason /boot is an remote filesystem. 

Try changing that and see if that fixes your problem

Now you might also want to add condition checks in the [Unit] section of the the unit as in.. 

ConditionPathExists=/boot 

If the above condition is not met as in /boot does not exist the unit will fail 

ConditionKernelCommandLine=crashkernel 


If crashkernel is not set on the kernel command line the unit will fail

Probably with this option you could request exception from fesco to enable the service by default. 

Putting this altogether you can test this unit file... 

[Unit]
Description=Crash recovery kernel arming
ConditionPathExists=/boot
ConditionKernelCommandLine=crashkernel
After=local-fs.target remote-fs.target network.target

[Service]
Type=oneshot
ExecStart=/usr/bin/kdumpctl start
ExecStop=/usr/bin/kdumpctl stop
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
Comment 16 Dave Young 2012-06-07 02:53:26 EDT
Johann, Thanks

It still fails with your service content,I found my tested version is Fedora 17 beta, I tried F17 GA today the original kdump.service works just ok except a ldconfig problem of dracut:

ldconfig: Can't create temporary cache file /etc/ld.so.cache~: Permission denied
E: ldconfig exited ungracefully
Comment 17 Jóhann B. Guðmundsson 2012-06-07 04:14:11 EDT
(In reply to comment #16)
> Johann, Thanks
> 
> It still fails with your service content,I found my tested version is Fedora
> 17 beta, I tried F17 GA today the original kdump.service works just ok
> except a ldconfig problem of dracut:
> 
> ldconfig: Can't create temporary cache file /etc/ld.so.cache~: Permission
> denied
> E: ldconfig exited ungracefully

The unit I mentioned there in comment 15 will fail if. 

A) /boot does not exist
B) crashkernel kernel parameter does not exist on the kernel command line.

These "local-fs.target remote-fs.target" should not be necessary I just added that to ensure you did not hit any kind of ordering problem 


[Unit]
Description=Crash recovery kernel arming
ConditionKernelCommandLine=crashkernel
After=network.target

[Service]
Type=oneshot
ExecStart=/usr/bin/kdumpctl start
ExecStop=/usr/bin/kdumpctl stop
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

I suggest you test your unit on F16 so you aren't hitting some fallout from /usr move then you know remove "ro" from the kernel command line put "enforce=0" to rule out selinux etc. stuff like that to debug those permission errors.
Comment 18 Fedora Admin XMLRPC Client 2013-02-25 03:06:08 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 19 Fedora Admin XMLRPC Client 2013-02-25 03:09:04 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 20 Fedora End Of Life 2013-04-03 15:14:43 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19