[opensuse] systemd and dhcp clients
I have a number of Ethernet devices that obtain their configuration via DHCP. I would like to start a system service when a device has obtained an address. For example, I have some GigEVision cameras that can synchronize time using PTP (a variation on NTP). We use the openSUSE packages for this. There are two systemd services that should start when a device comes on line. In another situation, I have a LiDAR scanner that gets an address via DHCP. I want to start a daemon that manages remote access to the LiDAR scanners. In both cases the service that should run is on the server after the remote has gotten an address. The services are not running on the client that obtained the address. I do not know if there is a way, in the context of a systemd service starting, to sense that a device has gotten a DHCP address. Of course I do not have to use systemd. But we are trying to do things on openSUSE the openSUSE way. Any pointers are welcome! -- Roger Oberholtzer -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Roger Oberholtzer wrote:
In both cases the service that should run is on the server after the remote has gotten an address. The services are not running on the client that obtained the address.
I do not know if there is a way, in the context of a systemd service starting, to sense that a device has gotten a DHCP address. Of course I do not have to use systemd. But we are trying to do things on openSUSE the openSUSE way.
The ISC dhcp server does have some options for defining actions based on the "reference events": commit, release and expire. I have never had reason to use such a config though. -- Per Jessen, Zürich (3.1°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Wed, Jan 8, 2020 at 9:50 AM Per Jessen <per@computer.org> wrote:
Roger Oberholtzer wrote:
In both cases the service that should run is on the server after the remote has gotten an address. The services are not running on the client that obtained the address.
I do not know if there is a way, in the context of a systemd service starting, to sense that a device has gotten a DHCP address. Of course I do not have to use systemd. But we are trying to do things on openSUSE the openSUSE way.
The ISC dhcp server does have some options for defining actions based on the "reference events": commit, release and expire. I have never had reason to use such a config though.
Interesting. I see something like this referenced: subnet 192.168.1.0 netmask 255.255.255.0 { option routers 192.168.1.2; on commit { set clip = binary-to-ascii(10, 8, ".", leased-address); set clhw = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6)); execute("/usr/local/sbin/dhcpevent", "commit", clip, clhw, host-decl-name); } } I could execute the daemon, returning immediately, which it seems to require Putting this in the dhcp config may actually streamline things. Otherwise I have to maintain that as well as separate systemd scripts, and keep them in sync as hardware changes. -- Roger Oberholtzer -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (2)
-
Per Jessen
-
Roger Oberholtzer