What is the difference between systemd
service Type
oneshot
and simple
?
This link states to use simple
instead of oneshot
for timers. I am not able to understand it correctly.
相关问题
- How to extract service state via Systemd DBus API?
- Beaglebone Boot to Qt App
- systemd service not starting using dbus interface
- Why doesn't PHP 7.2 fopen(/tmp, a) wri
- java: inconsistent watchdog timeout in systemd-not
相关文章
- systemd service startup issue
- Structured logging to journald from within a docke
- what is the best way to start a script in boot tim
- Can I import a Golang package based on the OS I
- Install multiple .service files with dh_systemd pa
- airflow systemd fails due to gunicorn
- Wait for mongodb to be ready before starting pm2 p
- start request repeated too quickly
From systemd's point of view,
Type=simple
is kind of fire and forget. Systemd just forks a process defined inExecStart=
and goes on its way, even if the process fails to start.The
Type=oneshot
service unit:blocks on a start operation until the first process exits, and its state will be reported as "activating";
once the first process exits, transitions from "activating" straight to "inactive", unless
RemainAfterExit=true
is set (in which case it becomes "active" with no processes!);may have any number (0 or more) of
ExecStart=
directives which will be executed sequentially (waiting for each started process to exit before starting the next one);may leave out
ExecStart=
but haveExecStop=
(useful together withRemainAfterExit=true
for arranging things to run on system shutdown).The
Type=simple
service unit:does not block on a start operation (i. e. becomes "active" immediately after forking off the first process, even if it is still initializing!);
once the first process exits, transitions from "active" to "inactive" (there is no
RemainAfterExit=
option);is generally discouraged because there is no way to distinguish situations like "exited on start because of a configuration error" from "crashed after 500ms of runtime" and suchlike.
Both
Type=oneshot
andType=simple
units:Type=oneshot
withKillMode=none
, but only do this if you know what you are doing).