Bug 1197239 - Unknown operation '/bin/systemctl' on puppet %preun
Summary: Unknown operation '/bin/systemctl' on puppet %preun
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: puppet
Version: 21
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Haïkel Guémar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-27 22:14 UTC by Jean-Baptiste Poittevin
Modified: 2015-03-29 04:27 UTC (History)
14 users (show)

Fixed In Version: puppet-3.7.1-2.fc21
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-29 04:26:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
spec file with systemd macros (6.35 KB, patch)
2015-02-28 11:25 UTC, Jean-Baptiste Poittevin
no flags Details | Diff

Description Jean-Baptiste Poittevin 2015-02-27 22:14:23 UTC
Description of problem:

Reload of puppetagent.service do not work as intended during %preun stage of package updating.

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

puppet-3.6.2

Patch proposition :

$ diff puppet.spec.orig puppet.spec 
328c328
<     /bin/systemctl /bin/systemctl --no-reload disable puppetagent.service > /dev/null 2>&1
---
>     /bin/systemctl --no-reload disable puppetagent.service

Comment 1 Jean-Baptiste Poittevin 2015-02-27 22:16:40 UTC
$ rpm -q puppet
puppet-3.6.2-2.fc21.noarch

Comment 2 Orion Poplawski 2015-02-27 23:20:52 UTC
Shouldn't the package be using the standard scriptlets from https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd

Comment 3 Jean-Baptiste Poittevin 2015-02-28 11:25:02 UTC
Created attachment 996425 [details]
spec file with systemd macros

Here is a patch with a bit of refactoring on puppet.spec :
- add a BuildRequires on systemd (for _unitdir macro)
- use %systemd_{post,preun,postun*} macros
- replace ps aux | grep $PID | grep -v grep idiom for a more robust ps -p $PID

Note that the pending_upgrade case could not be factored out. I'm also not sure why the packager felt the need to put additional systemctl daemon-reloads.

Comment 4 Haïkel Guémar 2015-02-28 18:40:02 UTC
@Jean-Baptiste: thanks for attaching the patch, I will apply it as a provenpackager on EPEL7 & F21+

A friendly tip when you submit a patch: 
fedpkg clone -a <package>
(do your changes, you may even create a separate branch for your changes)
git commit -m "my changes" # you may even bump the release and add a changelog entry
git format-patch HEAD~<number of patches>

It doesn't take much of your time and it will be easier for maintainers to apply your patches.

Comment 5 Fedora Update System 2015-02-28 18:59:38 UTC
puppet-3.7.1-2.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/puppet-3.7.1-2.fc21

Comment 6 Fedora Update System 2015-02-28 20:12:16 UTC
puppet-3.7.1-3.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/puppet-3.7.1-3.fc22

Comment 7 Fedora Update System 2015-03-01 06:50:54 UTC
Package puppet-3.7.1-2.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing puppet-3.7.1-2.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-2899/puppet-3.7.1-2.fc21
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2015-03-29 04:26:39 UTC
puppet-3.7.1-3.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2015-03-29 04:27:58 UTC
puppet-3.7.1-2.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.