Systemd unit file implementation questions (ypbind)
Lennart Poettering
mzerqung at 0pointer.de
Wed Apr 13 18:59:53 UTC 2011
On Wed, 13.04.11 19:55, Honza Horak (hhorak at redhat.com) wrote:
> 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?
Yes, this looks like something that needs to be fixed in rpmlint eventually.
> 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?
In an ideal world the daemon binary itself does what is needed to start
up. In the real world ExecStartPre= is indeed what you should be using,
if your daemon isn't ideal (yet).
Lennart
--
Lennart Poettering - Red Hat, Inc.
More information about the devel
mailing list