summaryrefslogtreecommitdiff
path: root/yarns/morph.shell-lib
diff options
context:
space:
mode:
Diffstat (limited to 'yarns/morph.shell-lib')
-rw-r--r--yarns/morph.shell-lib20
1 files changed, 20 insertions, 0 deletions
diff --git a/yarns/morph.shell-lib b/yarns/morph.shell-lib
index 9d67f2ab..9c13e449 100644
--- a/yarns/morph.shell-lib
+++ b/yarns/morph.shell-lib
@@ -184,3 +184,23 @@ slashify_colons()
{
echo "$1" | sed s,:,/,g
}
+
+start_cache_server(){
+ mkfifo "$1"
+ start-stop-daemon --start --pidfile="$2" \
+ --background --make-pidfile --verbose \
+ --startas="$SRCDIR/morph-cache-server" -- \
+ --port-file="$1" --no-fcgi \
+ --repo-dir="$DATADIR/gits" --direct-mode \
+ --bundle-dir="$DATADIR/bundles" \
+ --artifact-dir="$3" "$@"
+ port="$(cat "$1")"
+ rm "$1"
+ echo "$port" >"$1"
+}
+
+stop_daemon(){
+ if [ -e "$1" ]; then
+ start-stop-daemon --stop --pidfile "$1" --oknodo
+ fi
+}