Michal Schmidt <mschmidt <at> redhat.com> writes:

> ... 
> > 2.
> > main-service-2.service:
> > [Unit]
> > Description=Main service 2
> > After= ...
> > ...
> > [Service]
> > Type=forking<---------------------- any other type too ?
> > ExecStartPre= exec /etc/init.d/sub-service-1
> > ExecStartPre= exec /etc/init.d/sub-service-2
> > ExecStart= /usr/sbin/some-service
> > ExecStartPost=
> > ExecStartPost=
> > ...
> > Are there any restrictions on those Pre (and Post) commands ?
> 
> One limitation was already mentioned somewhere in this thread - these 
> commands must not fork off daemons.

This is interesting. Or perhaps I read too much into your above statement ?
We know already that ExecStartPre must contain a command to be executed.
> > ExecStartPre= exec /etc/init.d/sub-service-1
Note the 'exec' command, which means "Replace the shell with the given
command." with immediate return.
How does systemd know what's in the "/etc/init.d/sub-service-1" process, to be
able to figure out if any daemon is to be forked off ?

> ... 
> >> Parallelism in systemd happens between multiple units, but never between
> >> ExecStart* commands of one unit.
> >> Requesting parallelism within one unit seems like over-engineering to
> >> me. You can always split your unit to smaller ones if you want
> >> parallelism.
> >
> > But this is what Steve, I believe, wants to do with nfs (to have a bunch of
> > services started from the main one, as under current SysV init system, so
> > his users are not confused by the startup of all these individual service
> > files).
> 
> I proposed a way to do this cleanly using systemd targets elsewhere in 
> this discussion.

Or my example 1 would serve him too ?

> ...

JB


-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Reply via email to