On 17/11/2014 08:40, Andrei POPESCU wrote:
> Just by having a quick look at the manpages, you have all the various 
> Condition* directives (see systemd.unit(5)) and ExecStartPre= (see 
> systemd.service(5)).
> 
> Maybe it would help if you posted your script?

I found the Condition* keywords, but I think my way is easier (I don't
have to add Condition* to all my units) So I have:

checkgpio.service (Requires=multiuser.target, execstart=checkgpio.sh,
type=oneshot remainafterexit=yes )

checkgpio.sh (checks gpio, and executes "systemctl isolate
mode1.target", or "systemctl isolate mode2.target" depending on the
state, then exits.

mode1.target (Wants=service1,service2)

mode2.target (Wants=service2,service3)

So I think is is harder than it should be, but not impossible. Maybe I
am missing something obvious.

Thanks for the input,

Robert


-- 
To UNSUBSCRIBE, email to debian-embedded-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/546a6b8b....@gmail.com

Reply via email to