Systemd unit file implementation questions (ypbind)

Michał Piotrowski mkkp4x4 at gmail.com
Wed Apr 13 18:00:33 UTC 2011


Hi,

2011/4/13 Honza Horak <hhorak at redhat.com>:
> Hi,
>
> I'm working on systemd unit file for ypbind and found some problems,
> that I'm not sure about:
>
> 1) if I use systemctl enable/disable instead of chkconfig in %post and
> %preun sections in spec file, rpmlint prints errors:
> postin-without-chkconfig /etc/rc.d/init.d/ypbind
> preun-without-chkconfig /etc/rc.d/init.d/ypbind
> Is this just rpmlint problem or should I change %post and %preun
> sections somehow?
>
> %post and %preun sections in spec file:
>
> %post
> /bin/systemctl enable %{name}.service || :
>
> %preun
> if [ $1 -eq 0 ] ; then
>     /bin/systemctl stop %{name}.service >/dev/null 2>&1 || :
>     /bin/systemctl disable %{name}.service >/dev/null 2>&1 || :
> fi
>
>
> 2) there is some code before and after starting the daemon in former
> SysV init script, which should be executed even when using systemd unit
> file. I created two scripts, placed them to /usr/lib/ypbind/ and add
> them to "ExecStartPre:" in ypbind.service file. Is this correct solution
> or there is a better one to execute more complicated scripts
> before/after daemon script itself?

This is the most correct solution

>
> Regards,
>
> Honza
> --
> devel mailing list
> devel at lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/devel
>



-- 
Best regards,
Michal

http://eventhorizon.pl/


More information about the devel mailing list