liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 3677ab9cb398bec09270329a6a10b704c280ac1a
parent 1d9f39bf8769ee5fa454e2f76d253f5bdaa1b136
Author: Daniel Barlow <dan@telent.net>
Date:   Sun, 25 Sep 2022 21:10:04 +0100

move service state out of s6 scandir

getting weird permission errors, seems simpler all raound just to
put them somewhere else

Diffstat:
Mpkgs/liminix-tools/default.nix | 2+-
Mpkgs/liminix-tools/networking/udhcpc.nix | 16+++++++++-------
2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/pkgs/liminix-tools/default.nix b/pkgs/liminix-tools/default.nix @@ -88,6 +88,6 @@ in { }; services = { inherit longrun oneshot bundle target; - output = service: name: "/run/s6-rc/scandir/${service.name}/data/outputs/${name}"; + output = service: name: "/run/service-state/${service.name}/${name}"; }; } diff --git a/pkgs/liminix-tools/networking/udhcpc.nix b/pkgs/liminix-tools/networking/udhcpc.nix @@ -5,15 +5,19 @@ } : let inherit (liminix.services) longrun; +in +interface: { ... } @ args: +let + name = "${interface.device}.udhcp"; script = writeShellScript "udhcp-notify" '' action=$1 -env > /run/udhcp.values set_address() { ip address replace $ip/$mask dev $interface - mkdir -p data/outputs + dir=/run/service-state/${name}.service/ + mkdir -p $dir for i in lease mask ip router siaddr dns serverid subnet opt53 interface ; do - echo ''${!i} > data/outputs/$i + echo ''${!i} > $dir/$i done } case $action in @@ -33,10 +37,8 @@ case $action in ;; esac ''; - -in -interface: { ... } @ args: longrun { - name = "${interface.device}.udhcp"; +in longrun { + inherit name; run = "${busybox}/bin/udhcpc -f -i ${interface.device} -s ${script}"; }