Bug 850375 - Introduce new systemd-rpm macros in ypbind spec file
Introduce new systemd-rpm macros in ypbind spec file
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: ypbind (Show other bugs)
18
All Linux
medium Severity medium
: ---
: ---
Assigned To: Honza Horak
Fedora Extras Quality Assurance
:
Depends On:
Blocks: 850016
  Show dependency treegraph
 
Reported: 2012-08-21 10:18 EDT by Lukáš Nykrýn
Modified: 2012-11-19 06:21 EST (History)
2 users (show)

See Also:
Fixed In Version: ypbind-1.36-7.fc18
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-11-19 06:21:39 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Lukáš Nykrýn 2012-08-21 10:18:24 EDT
Fedora 18 changes the way how to work with services in spec files. It introduces new macros - %systemd_post, %systemd_preun and %systemd_postun; which replace scriptlets from Fedora 17 and older (see https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd, https://bugzilla.redhat.com/show_bug.cgi?id=850016).
Comment 1 Fedora Update System 2012-09-25 04:36:11 EDT
ypbind-1.36-6.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/ypbind-1.36-6.fc18
Comment 2 Fedora Update System 2012-09-25 11:57:09 EDT
Package ypbind-1.36-6.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing ypbind-1.36-6.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-14750/ypbind-1.36-6.fc18
then log in and leave karma (feedback).
Comment 3 Rex Dieter 2012-10-01 10:15:34 EDT
I  saw error on upgrading on f17,

  Updating   : 3:ypbind-1.36-6.fc17.x86_64                                                                                                              
/var/tmp/rpm-tmp.2H46WJ: line 7: fg: no job control

I suspect the preceeding whitespace before the %triggerun in else is one possible cause.

%post
%if 0%{?systemd_post:1}
    %systemd_post %{name}.service
%else
    # Package install, not upgrade
    if [ $1 -eq 1 ]; then
        /bin/systemctl daemon-reload >dev/null || :
    fi

    # Package with native systemd unit file is installed for the first time
    %triggerun -- %{name} < 3:1.32-9
    # Save the current service runlevel info
    # User must manually run systemd-sysv-convert --apply httpd
    # to migrate them to systemd targets
    /usr/bin/systemd-sysv-convert --save %{name} >/dev/null 2>&1 ||:

    # Run these because the SysV package being removed won't do them
    /sbin/chkconfig --del %{name} >/dev/null 2>&1 || :
    /bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || :
%endif
Comment 4 Honza Horak 2012-10-04 03:58:55 EDT
(In reply to comment #3)
> I suspect the preceeding whitespace before the %triggerun in else is one
> possible cause.

Thanks for reporting this. I've realized %triggerun shouldn't be in %if block at all, I'm going to submit a new package soon. It should look like as follows:

%post
%if 0%{?systemd_post:1}
    %systemd_post %{name}.service
%else
    # Package install, not upgrade
    if [ $1 -eq 1 ]; then
        /bin/systemctl daemon-reload >dev/null || :
    fi
%endif

# Package with native systemd unit file is installed for the first time
%triggerun -- %{name} < 3:1.32-9
# Save the current service runlevel info
# User must manually run systemd-sysv-convert --apply httpd
# to migrate them to systemd targets
/usr/bin/systemd-sysv-convert --save %{name} >/dev/null 2>&1 ||:

# Run these because the SysV package being removed won't do them
/sbin/chkconfig --del %{name} >/dev/null 2>&1 || :
/bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || :
Comment 5 Fedora Update System 2012-10-04 06:26:02 EDT
ypbind-1.36-7.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/ypbind-1.36-7.fc18

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