Re: Automatically stop systemd service

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



On 29/03/13 00:39, Leonid Isaev wrote:
On Thu, 28 Mar 2013 18:23:03 +1100
Robbie Smith <zoqaeski@xxxxxxxxx> wrote:

TL;DR: More toying with mobile broadband and systemd; would like help
automatically stopping service depending on device availability.

[...]

What I cannot figure out how to do is automatically stop the service if
the device is unplugged, similar to how ifplugd works for wired ethernet
interfaces.

How about "BindsTo=" from man 5 systemd.unit? For example,
"BindsTo=sys-subsystem-net-devices-wap.device".

That did the trick (when the device is /dev/ttyUSB0). Now to just make a persistent name for the rare occasions when it appears as something else (always a /dev/ttyUSBx).


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux