Bug 850099 - Introduce new systemd-rpm macros in ebnetd spec file
Introduce new systemd-rpm macros in ebnetd spec file
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: ebnetd (Show other bugs)
18
All Linux
medium Severity medium
: ---
: ---
Assigned To: Akira TAGOH
Fedora Extras Quality Assurance
:
Depends On:
Blocks: 850016
  Show dependency treegraph
 
Reported: 2012-08-21 09:34 EDT by Lukáš Nykrýn
Modified: 2012-09-17 18:00 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-09-17 18:00:24 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Lukáš Nykrýn 2012-08-21 09:34:45 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 Akira TAGOH 2012-08-27 05:14:53 EDT
Does this scriptlet work for .socket and @.service too?
Comment 2 Václav Pavlín 2012-08-27 07:45:19 EDT
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-27 23:10:37 EDT
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 07:57:59 EDT
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 01:22:42 EDT
Thanks for kindly information and awesome work :)
Comment 6 Fedora Update System 2012-08-29 07:03:04 EDT
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 14:42:59 EDT
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 18:00:24 EDT
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.