Bug 850099

Summary: Introduce new systemd-rpm macros in ebnetd spec file
Product: [Fedora] Fedora Reporter: Lukáš Nykrýn <lnykryn>
Component: ebnetdAssignee: Akira TAGOH <tagoh>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 18CC: i18n-bugs, msekleta, tagoh, vpavlin
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-09-17 22:00:24 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 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.