Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 585658 - sys-apps/kexec-tools: systemd unit does not allow more than one commandline argument
Summary: sys-apps/kexec-tools: systemd unit does not allow more than one commandline a...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL: https://github.com/gentoo/gentoo/pull...
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2016-06-12 07:53 UTC by Tiziano Müller (RETIRED)
Modified: 2024-08-12 15:56 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tiziano Müller (RETIRED) gentoo-dev 2016-06-12 07:53:16 UTC
With curly braces, environment variables will be be passed as one string (one argument) to the command, making it impossible to pass more than one optional argument to kexec, see also http://0pointer.de/public/systemd-man/systemd.service.html#Command%20lines

diff --git a/sys-apps/kexec-tools/files/kexec.service b/sys-apps/kexec-tools/files/kexec.service
index 289aae0..c387310 100644
--- a/sys-apps/kexec-tools/files/kexec.service
+++ b/sys-apps/kexec-tools/files/kexec.service
@@ -9,8 +9,8 @@ ConditionPathExists=!/nokexec
 Type=oneshot
 RemainAfterExit=yes
 EnvironmentFile=/etc/kexec.conf
-ExecStart=/usr/sbin/kexec -l /boot/${KNAME} ${KEXEC_OPT_ARGS}
-ExecStop=/usr/sbin/kexec -l /boot/${KNAME} ${KEXEC_OPT_ARGS}
+ExecStart=/usr/sbin/kexec -l /boot/${KNAME} $KEXEC_OPT_ARGS
+ExecStop=/usr/sbin/kexec -l /boot/${KNAME} $KEXEC_OPT_ARGS
 
 [Install]
 WantedBy=multi-user.target
Comment 1 SpanKY gentoo-dev 2016-06-12 17:58:46 UTC
if you use systemd, feel free to commit changes to service files
Comment 2 Larry the Git Cow gentoo-dev 2024-08-06 07:32:45 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8cb4582e9d05279ad58dd8282b7a927e53a2dbec

commit 8cb4582e9d05279ad58dd8282b7a927e53a2dbec
Author:     Andrew Ammerlaan <andrewammerlaan@gentoo.org>
AuthorDate: 2024-07-27 10:27:24 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan@gentoo.org>
CommitDate: 2024-08-06 07:32:27 +0000

    sys-apps/kexec-tools: remove broken installkernel hooks
    
    and replace with little wrapper script that reads the latest kernel from the
    installkernel log file and uses the usual locations for the cmdline.
    
    Merge /etc/kexec.conf and /etc/conf.d/kexec, both config files are now
    basically the same, with the exception of some variables only being used by
    the openrc script.
    
    TODO (by someone on OpenRC): adapt the openrc init script so it also reads
    the installkernel.log.
    
    Closes: https://bugs.gentoo.org/585658
    Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
    Closes: https://github.com/gentoo/gentoo/pull/37742
    Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>

 sys-apps/kexec-tools/files/kexec-auto-load         | 95 ++++++++++++++++++++++
 sys-apps/kexec-tools/files/kexec.conf              | 42 +++++++---
 sys-apps/kexec-tools/files/kexec.conf-2.0.4        |  6 +-
 sys-apps/kexec-tools/files/kexec.service           |  4 +-
 ...-2.0.29.ebuild => kexec-tools-2.0.29-r1.ebuild} | 17 +---
 sys-apps/kexec-tools/kexec-tools-9999.ebuild       | 17 +---
 6 files changed, 135 insertions(+), 46 deletions(-)