On Tue, 29.03.11 21:46, Michał Piotrowski ([email protected]) wrote: > > Ah of course! Otherwise the modprobe is executed right when the last > > process you ran before exited... > > I do not understand why this is so. > > example I > Type=oneshot > ExecStart=A > ExecStart=B > ExecStop=C > > example II > Type=oneshot > RemainAfterExit=yes > ExecStart=A > ExecStart=B > ExecStop=C > > what is the difference in the sequence of execution in these example scripts? > > I think in both cases is: > start: > - A > - B > stop: > - C
Completely correct. However, if you have RemainAfterExit=no then systemd will notice that no process is running anymore, right after it was started and hence call the stop binaries right-away. If you use RemainAfterExit=yes however systemd doesn't care if there is no process around for that service, and just considers it up until the user (or the system shutdown logic) pulls it down explicitly. In different words: RemainAfterExit=no means: as soon as no process is around anymore a service is considered down, and the stop binaries are executed. The service will go into "deactivating" right after it was done with "activating". RemainAfterExit=yes means: the stop binaries are only executed when the user manually stops the service, or if if this done due to system shutdown. The service will stay in "activated" after having left "activating" until the user manually changes it to "deactivating" via "systemctl stop". Lennart -- Lennart Poettering - Red Hat, Inc. _______________________________________________ systemd-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/systemd-devel
