Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 850375

Summary: Introduce new systemd-rpm macros in ypbind spec file
Product: [Fedora] Fedora Reporter: Lukáš Nykrýn <lnykryn>
Component: ypbindAssignee: Honza Horak <hhorak>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 18CC: hhorak, rdieter
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: ypbind-1.36-7.fc18 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-11-19 11:21:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 850016    

Description Lukáš Nykrýn 2012-08-21 14:18:24 UTC
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 08:36:11 UTC
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 15:57:09 UTC
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 14:15:34 UTC
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 07:58:55 UTC
(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 10:26:02 UTC
ypbind-1.36-7.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/ypbind-1.36-7.fc18