systemd: Is it wrong?

JB jb.1234abcd at gmail.com
Mon Jul 11 08:44:16 UTC 2011


Lennart Poettering <mzerqung <at> 0pointer.de> writes:

> ...

I would like to verify the systemd's parallelism (or should we say
concurrency in case of systemd ?) claim.

Any parallelization possible to achieve thru configuration of service files ?
What it would look like ?

Let me take a shot at 2 examples of service files below.
Are they correct setup-wise ?
Will both examples be executed sequentially only ?
 
1.

main-service-1.service:
[Unit]
Description=Main service 1
Requires= ... sub-service-1.service sub-service-2.service
After= ... sub-service-1.service sub-service-2.service
...
[Service]
Type=forking    <---------------------- any other type too ?      
ExecStartPre=
ExecStartPre=
ExecStart=
ExecStart= /usr/sbin/some-service
ExecStartPost=
ExecStartPost=
...

sub-service-1.service:
[Unit]
Description=Sub service 1
...
[Service]
...

sub-service-2.service:
[Unit]
Description=Sub service 2
...
[Service]
...

2.

main-service-2.service:
[Unit]
Description=Main service 2
After= ...
...
[Service]
Type=forking    <---------------------- any other type too ?      
ExecStartPre= sub-service-1.service 
ExecStartPre= sub-service-2.service
ExecStart=
ExecStart= /usr/sbin/some-service
ExecStartPost=
ExecStartPost=
...

sub-service-1.service:
[Unit]
Description=Sub service 1
...
[Service]
...

sub-service-2.service:
[Unit]
Description=Sub service 2
...
[Service]
...

What if sysadmin wants to execute them in parallel because she knows they
can be executed this way (no conflict and no races) ?
How, if by definition, systemd executes them sequentially only ?
Can they be grouped and execution-parallelized in the whole service file, or
at least in subgroups Pre-, regular, and Post- ?

The /etc/init.d/nfs under current SysV init system can start the main service
and include calling sub-services (each of whom is a separate service as well).
Yes, they are executed sequentially.

Can that be done under systemd as well ?
Are the examples given above good for that ?
If yes, they would be examples of a sequential execution as under SysV init ?

So, where would be the promised parallelism in there, in the way the main and
sub services are executed ?

Can you give us a working example of a services setup (or something else) in
systemd where execution-parallelism would be present or at least theoretically
exploitable ?

JB




More information about the devel mailing list