[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[02/05] Embedded with systemd: systemd and different modes



I have a use case where I have a logging unit with a few buttons that
are available to the user. The buttons are read via the kernel GPIO
methods. There is no display, no keyboard, only 802.11.

Normally the unit starts a few daemons and starts the 802.11 in client
(wpa_supplicant) mode.

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.

b.t.w I asked this question in #systemd a few nights ago and was told my
use case was "bizarre"


Reply to: