управляйте системой systemd и менеджером служб (Control the systemd system and service manager)
Статус выхода (Exit)
On success, 0 is returned, a non-zero failure code otherwise.
systemctl
uses the return codes defined by LSB, as defined in LSB
3.0.0
[1].
Table 3. LSB return codes
┌──────┬────────────────────┬────────────────────┐
│Value
│ Description in LSB
│ Use in systemd
│
├──────┼────────────────────┼────────────────────┤
│0
│ "program is │ unit is active │
│ │ running or service │ │
│ │ is OK" │ │
├──────┼────────────────────┼────────────────────┤
│1
│ "program is dead │ unit not failed │
│ │ and /var/run pid │ (used by │
│ │ file exists" │ is-failed
) │
├──────┼────────────────────┼────────────────────┤
│2
│ "program is dead │ unused │
│ │ and /var/lock lock │ │
│ │ file exists" │ │
├──────┼────────────────────┼────────────────────┤
│3
│ "program is not │ unit is not active │
│ │ running" │ │
├──────┼────────────────────┼────────────────────┤
│4
│ "program or │ no such unit │
│ │ service status is │ │
│ │ unknown" │ │
└──────┴────────────────────┴────────────────────┘
The mapping of LSB service states to systemd unit states is
imperfect, so it is better to not rely on those return values but
to look for specific unit states and substates instead.