linux - When should the option RemainAfterExit needs to be set true when creating new systemd services? -
i trying write few services. of them have 'type' option set oneshot. still confused when option 'remainafterexit' needs set true. (not service needs active after exiting).
use remainafterexit=yes
services, somehow change state of system. when want state reverted, stop service. can start again, not without first stopping it. example service creates flag in filesystem used other application. on start, create flag file, exists, service kept active systemd. can stop , remove flag file.
use remainafterexit=no
services, action, not change state of system. example service cleanup /tmp
. start it, work , inactive (no need stop it). , can start again anytime , again work (cleanup).
Comments
Post a Comment