lfs-execline-scripts

Repository for execline scripts used in my linux-from-scratch builds
Log | Files | Refs

commit 1b54fd8b3d763e243efe6e8d2395b308706ecada
parent 9aaa1575bdac519ef69e9ce09ca4d5e0abcdc300
Author: mrgrouse <bdmfegys@duck.com>
Date:   Sun,  3 Aug 2025 04:48:27 -0400

moved config files to default/ directory, to be better understood within the context of svc

Diffstat:
Asvc/services/default/dropbear.conf | 6++++++
Rsvc/services/hwclock.conf -> svc/services/default/hwclock.conf | 0
Rsvc/services/network.conf -> svc/services/default/network.conf | 0
Asvc/services/dropbear | 26++++++++++++++++++++++++++
4 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/svc/services/default/dropbear.conf b/svc/services/default/dropbear.conf @@ -0,0 +1,6 @@ +# dropbear svc config file +# see dropbear man page for flags to use. +# -F stops dropbear from fork()ing into the background +# -R automatically generates the server's keys. no more checking for keys every startup! +# ( i know the above is probably a bad idea maybe due to known_hosts but i'm gonna try it anyway :O ) +DB_OPTS="-FR" diff --git a/svc/services/hwclock.conf b/svc/services/default/hwclock.conf diff --git a/svc/services/network.conf b/svc/services/default/network.conf diff --git a/svc/services/dropbear b/svc/services/dropbear @@ -0,0 +1,25 @@ +#!/usr/bin/execlineb -S1 +# Use execlineb -WS1 for debug/testing (errors out on bad syntax) +importas -S PATH + +envfile /etc/svc.d/default/dropbear + +case -N -- $1 + { + "-s" { + foreground { printf "Starting dropbear daemon...\n" } + background { dropbear $DB_OPTS -P /run/dropbear.pid } + + } + "-k" { + # set PID to pid of running process (may (not) exist) + #backtick PID { pidof -o %PPID dropbear } + backtick PID { cat /run/dropbear.pid } + foreground { printf "Stopping dropbear daemon...\n" } + + forx x { $PID } + { + foreground { kill -9 $x } + } + } + } foreground { /usr/bin/printf "usage: %s -s|-k\n" $0 } exit 1 +\ No newline at end of file