On Du, 16 nov 14, 20:52:13, Robert wrote: > > To help with field debugging I currently check the state of one of the > buttons at startup and if it is pressed, the unit starts the 802.11 in > host (hostapd) mode and starts sshd. > > This was trivial to configure with /sbin/init calling a shellscript that > checks the GPIO and then chooses between two different runlevels. The > runlevels are setup by making a few symlinks in rcx.d. > > Since it is not possible to make decisions in systemd unit files, this > has become much harder. I have a solution for this, but it is smelly. > How would you solve this? This is quite a common use case (at least in > the world I live in), and I will post my solution later but I don't want > to poison anybodies thinking right now.
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? Kind regards, Andrei -- http://wiki.debian.org/FAQsFromDebianUser Offtopic discussions among Debian users and developers: http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic http://nuvreauspam.ro/gpg-transition.txt
signature.asc
Description: Digital signature