Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

%{systemd_svcs} rpm macro bug in zfs-0.7.3-1.el7_4.x86_64.rpm from zfs-kmod repo #6838

Closed
makhomed opened this issue Nov 7, 2017 · 0 comments · Fixed by #6841
Closed

%{systemd_svcs} rpm macro bug in zfs-0.7.3-1.el7_4.x86_64.rpm from zfs-kmod repo #6838

makhomed opened this issue Nov 7, 2017 · 0 comments · Fixed by #6841
Labels
Component: Packaging custom packages

Comments

@makhomed
Copy link

makhomed commented Nov 7, 2017

System information

Type Version/Name
Distribution Name CentOS
Distribution Version 7.4.1708
Linux Kernel 3.10.0-693.5.2.el7.x86_64
Architecture x86_64
ZFS Version 0.7.3-1
SPL Version 0.7.3-1

Describe the problem you're observing

RPM postinstall scriptlet and preuninstall scriptlet not work as expected,
macro %{systemd_svcs} not expanded.

Describe how to reproduce the problem

  1. enable [zfs-kmod] repo
  2. yum install yum-utils
  3. run yumdownloader zfs
  4. view file zfs-0.7.3-1.el7_4.x86_64.rpm in Midnight Commander, press F3 on this file

As result you will see this:

postinstall scriptlet (using /bin/sh):

if [ $1 -eq 1 ] ; then
        # Initial installation
        systemctl preset %{systemd_svcs} >/dev/null 2>&1 || :
fi
exit 0

preuninstall scriptlet (using /bin/sh):

if [ $1 -eq 0 ] ; then
        # Package removal, not upgrade
        systemctl --no-reload disable %{systemd_svcs} > /dev/null 2>&1 || :
        systemctl stop %{systemd_svcs} > /dev/null 2>&1 || :
fi
exit 0

As you can see, macro %{systemd_svcs} is not expanded,
and systemctl preset will not work as expected:

# systemctl preset %{systemd_svcs}
Failed to execute operation: No such file or directory

%{systemd_svcs} is RPM macro, bash know nothing about it.
%{systemd_svcs} should be expanded in scriptlets to list of services and targets,
as it described in rpm spec:

%define systemd_svcs zfs-import-cache.service zfs-import-scan.service zfs-mount.service zfs-share.service zfs-zed.service zfs.target
@loli10K loli10K added the Component: Packaging custom packages label Nov 7, 2017
@loli10K loli10K self-assigned this Nov 7, 2017
behlendorf pushed a commit that referenced this issue Nov 8, 2017
This allows RPM-based systems to properly control package installation
and removal when using systemd.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Giuseppe Di Natale <[email protected]>
Signed-off-by: loli10K <[email protected]>
Closes #6838 
Closes #6841
tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue Nov 21, 2017
This allows RPM-based systems to properly control package installation
and removal when using systemd.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Giuseppe Di Natale <[email protected]>
Signed-off-by: loli10K <[email protected]>
Closes openzfs#6838 
Closes openzfs#6841
Nasf-Fan pushed a commit to Nasf-Fan/zfs that referenced this issue Jan 29, 2018
This allows RPM-based systems to properly control package installation
and removal when using systemd.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Giuseppe Di Natale <[email protected]>
Signed-off-by: loli10K <[email protected]>
Closes openzfs#6838
Closes openzfs#6841
Nasf-Fan pushed a commit to Nasf-Fan/zfs that referenced this issue Feb 13, 2018
This allows RPM-based systems to properly control package installation
and removal when using systemd.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Giuseppe Di Natale <[email protected]>
Signed-off-by: loli10K <[email protected]>
Closes openzfs#6838
Closes openzfs#6841
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Packaging custom packages
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants