summaryrefslogtreecommitdiff
path: root/wsdd
diff options
context:
space:
mode:
authorDanny Rawlins <contact@romster.me>2021-08-23 00:24:33 +1000
committerDanny Rawlins <contact@romster.me>2021-08-23 00:25:01 +1000
commitde6ec72303f4b7dc91c6bc476256b68c5dcc85af (patch)
tree7f4bb0e6fb4381f3d0c1d29138c400aab4d0427a /wsdd
parent1d173e3976c13dd7619106b656b9307ff9818296 (diff)
downloadopt-de6ec72303f4b7dc91c6bc476256b68c5dcc85af.tar.gz
opt-de6ec72303f4b7dc91c6bc476256b68c5dcc85af.tar.xz
wsdd: initial import
Diffstat (limited to 'wsdd')
-rw-r--r--wsdd/.footprint16
-rw-r--r--wsdd/.signature6
-rw-r--r--wsdd/Pkgfile28
-rwxr-xr-xwsdd/wsdd.rc40
4 files changed, 90 insertions, 0 deletions
diff --git a/wsdd/.footprint b/wsdd/.footprint
new file mode 100644
index 000000000..2de50b62d
--- /dev/null
+++ b/wsdd/.footprint
@@ -0,0 +1,16 @@
+drwxr-xr-x root/root etc/
+drwxr-xr-x root/root etc/rc.d/
+-rwxr-xr-x root/root etc/rc.d/wsdd
+drwxr-xr-x root/root run/
+drwxr-xr-x root/root run/wsdd/
+drwxr-xr-x root/root usr/
+drwxr-xr-x root/root usr/sbin/
+-rwxr-xr-x root/root usr/sbin/wsdd
+drwxr-xr-x root/root usr/share/
+drwxr-xr-x root/root usr/share/man/
+drwxr-xr-x root/root usr/share/man/man1/
+-rw-r--r-- root/root usr/share/man/man1/wsdd.1.gz
+drwxr-xr-x root/root var/
+drwxr-xr-x root/root var/lib/
+drwxr-xr-x nobody/nobody var/lib/wsdd/
+drwxr-xr-x root/root var/log/
diff --git a/wsdd/.signature b/wsdd/.signature
new file mode 100644
index 000000000..f77af9832
--- /dev/null
+++ b/wsdd/.signature
@@ -0,0 +1,6 @@
+untrusted comment: verify with /etc/ports/opt.pub
+RWSE3ohX2g5d/QSyy3UPBiYqO6DUP/DoXcWkSyqgudVoGdohODiYLRLz+d20Vy9NjwF8BZcdAUEdoj0cLQ9fQwb5nxoSSNMOoAQ=
+SHA256 (Pkgfile) = 64eebc956e7f0f51d9209139f8a848ed0e0e6f6f1a9b4bbed0f67e325a6866b2
+SHA256 (.footprint) = d1e1204247a835022bfe48f2b1110ef886c7c4cd0445c334d2155c0f2198d05d
+SHA256 (wsdd-0.6.4.tar.gz) = bb8bc6411b70be68369c53bf75827ac77f16a5bf5606de6536dd7e6d6ce4c2be
+SHA256 (wsdd.rc) = 7beaee123006d764596194b8b80884bc356c7a19918defbd5b36e3ef0dc950ec
diff --git a/wsdd/Pkgfile b/wsdd/Pkgfile
new file mode 100644
index 000000000..9dd56c5f7
--- /dev/null
+++ b/wsdd/Pkgfile
@@ -0,0 +1,28 @@
+# Description: A Web Service Discovery host daemon.
+# URL: https://github.com/christgau/wsdd
+# Maintainer: Danny Rawlins, crux at romster dot me
+
+name=wsdd
+version=0.6.4
+release=1
+source=(https://github.com/christgau/wsdd/archive/v$version/$name-$version.tar.gz
+ wsdd.rc)
+
+build() {
+ cd $name-$version
+ install -D -m 0755 src/wsdd.py $PKG/usr/sbin/wsdd
+ install -D -m 0644 man/wsdd.1 $PKG/usr/share/man/man1/wsdd.1
+
+ # service
+ install -D -m 0755 $SRC/wsdd.rc $PKG/etc/rc.d/wsdd
+
+ # pid
+ install -d $PKG/run/wsdd
+
+ # chroot
+ install -d $PKG/var/lib
+ install -d -m 0755 -o nobody -g nobody $PKG/var/lib/wsdd
+
+ # log
+ install -d $PKG/var/log
+}
diff --git a/wsdd/wsdd.rc b/wsdd/wsdd.rc
new file mode 100755
index 000000000..f9f349b8c
--- /dev/null
+++ b/wsdd/wsdd.rc
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# /etc/rc.d/wsdd: start/stop wsdd daemon
+#
+
+SSD=/sbin/start-stop-daemon
+PROG=/usr/sbin/wsdd
+PID=/run/wsdd/pid
+RUN_AS_USER=nobody:nobody
+LOG_FILE=/var/log/wsdd.log
+OPTS="-w WORKGROUP"
+
+case $1 in
+ start)
+ [ ! -r $LOG_FILE ] && touch wsdd.log
+ chown $RUN_AS_USER $LOG_FILE
+ $SSD --start --background --user $RUN_AS_USER --make-pidfile --pidfile $PID --stdout $LOG_FILE --stderr $LOG_FILE --exec $PROG -- $OPTS
+ ;;
+ stop)
+ $SSD --stop --retry 10 --remove-pidfile --pidfile $PID
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ status)
+ $SSD --status --pidfile $PID
+ case $? in
+ 0) echo "$PROG is running with pid $(cat $PID)" ;;
+ 1) echo "$PROG is not running but the pid file $PID exists" ;;
+ 3) echo "$PROG is not running" ;;
+ 4) echo "Unable to determine the program status" ;;
+ esac
+ ;;
+ *)
+ echo "Usage: $0 [start|stop|restart|status]"
+ ;;
+esac
+
+# End of file

Generated by cgit