[systemd-devel] conditional start with external condition
Markus Weißmann
markus.weissmann at in.tum.de
Mon Aug 11 04:41:42 PDT 2014
Hello systemd,
I've got an embedded system which can run in two configurations;
configuration 1 will run daemon A, B and C
configuration 2 will run daemon A and D
The configuration is chosen at boot-time with a hardware switch. The
position of this switch is accessible with a userland tool (via serial
interface).
I so far came up with two ways of solving this:
1.) start daemon A by default; have the userland tool execute
"systemctl" to start either B&C or D depending on the position of the
switch. (Bonus question: Is there a C-API to do that?)
2.) start daemon A by default; have the userland tool execute as a
one-shot tool that creates files depending on the position of the
switch. Then have B, C and D depend on the userland tool and use
ConditionPathExists to only start B&C or D depending on the files
created by the userland tool.
I'm not totally convinced about either solution, so I'd like an opinion
on both or perhaps a third solution (perhaps I missed a better
conditional-option of systemd?)
Bonus question: Will the ConditionPathExists be checked only once and
if so when exactly? And does this interfere with setting Restart=always?
(will it be re-evaluated if the daemon needs to be restarted, only once,
..?)
Thanks a lot!
regards
Markus
--
Markus Weissmann, M.Sc.
Technische Universität München
Institut für Informatik
Boltzmannstr. 3
D-85748 Garching
Germany
http://wwwknoll.in.tum.de/
More information about the systemd-devel
mailing list