Bug 850099 - Introduce new systemd-rpm macros in ebnetd spec file
Summary: Introduce new systemd-rpm macros in ebnetd spec file
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ebnetd
Version: 18
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Akira TAGOH
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 850016
TreeView+ depends on / blocked
 
Reported: 2012-08-21 13:34 UTC by Lukáš Nykrýn
Modified: 2012-09-17 22:00 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-09-17 22:00:24 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Lukáš Nykrýn 2012-08-21 13:34:45 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 Akira TAGOH 2012-08-27 09:14:53 UTC
Does this scriptlet work for .socket and @.service too?

Comment 2 Václav Pavlín 2012-08-27 11:45:19 UTC
Look at http://cgit.freedesktop.org/systemd/systemd/tree/src/core/macros.systemd.in

It simply calls systemctl for given unit file - so my answer is: yes, it does.

Comment 3 Akira TAGOH 2012-08-28 03:10:37 UTC
Thanks. one more question: I can stop ndtpd.socket though, how can I stop the processes for ndtpd@*.service? systemctl stop ndtpd@.service says "ntdpd@.service is not valid" and systemctl stop ndtpd.service doesn't take any effects nor errors. I did hack in the scriptlet to do that until now:

        for i in `/bin/systemctl --full | grep ebnetd | grep running | cut -d' ' -f1`; do
                /bin/systemctl stop $i 2>&1 || :
        done

Comment 4 Michal Sekletar 2012-08-28 11:57:59 UTC
Hi,

(In reply to comment #3)
> Thanks. one more question: I can stop ndtpd.socket though, how can I stop
> the processes for ndtpd@*.service? systemctl stop ndtpd@.service says
> "ntdpd@.service is not valid" and systemctl stop ndtpd.service doesn't take
> any effects nor errors.

You can do it by using new dependency type introduces in systemd-v188, namely PartOf, you should introduce new .target file and then add configuration stanza PartOf=ndtpd-instances.target to ndtpd@.service. Then calling calling systemctl stop ndtpd-instances.target will allow you to stop|restart all currently running instances at once. Please see man page for more information.

Michal

Comment 5 Akira TAGOH 2012-08-29 05:22:42 UTC
Thanks for kindly information and awesome work :)

Comment 6 Fedora Update System 2012-08-29 11:03:04 UTC
ebnetd-1.0-14.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/ebnetd-1.0-14.fc18

Comment 7 Fedora Update System 2012-08-29 18:42:59 UTC
Package ebnetd-1.0-14.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 ebnetd-1.0-14.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-12913/ebnetd-1.0-14.fc18
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2012-09-17 22:00:24 UTC
ebnetd-1.0-14.fc18 has been pushed to the Fedora 18 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.