From 12b2b7f02ec13e7db146f02d55a3a31401d2b18a Mon Sep 17 00:00:00 2001 From: Maff Date: Sat, 29 Dec 2018 19:38:39 +0000 Subject: [PATCH] mild improvements to startup script --- config.yml | 2 +- start | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/config.yml b/config.yml index 316d4dc..472cb2b 100644 --- a/config.yml +++ b/config.yml @@ -19,7 +19,7 @@ engines: name: colourful words and phrases tagline: techy tangents and general life chatter from a tired sysadmin. author: Maff -about: A dorky dude who spends too much time with perl. +about: A dorky person who spends too much time with computers. keywords: "sysadmin,unix,bsd,freebsd,linux,software,web,developer,perl,bash,shell,gentoo,maff,matthew,connelly,dundee,scotland,furry,blog" blog_prepend: wrote conf: diff --git a/start b/start index f1e578d..cda0463 100755 --- a/start +++ b/start @@ -1,6 +1,16 @@ #!/bin/sh #Application options -START_OPTS="--workers 1" +INVOKER_OPTS="" +SERVER_OPTS="-D --workers 2" +APP_OPTS="" + +#Defaults +INVOKER="plackup" +SERVER="Starman" +#Paths +SOCK_PATH="$BASE/$APP/.sock" +PID_PATH="$BASE/${APP}.pid" +BIN_PATH="$BASE/$APP/bin/app.pl" #Standard startup script [ -z "$BASE$APP" ] && exit 1 @@ -11,7 +21,11 @@ PERL_LOCAL_LIB_ROOT="$BASE/perl5${PERL_LOCAL_LIB_ROOT+:}${PERL_LOCAL_LIB_ROOT}"; PERL_MB_OPT="--install_base \"$BASE/perl5\""; export PERL_MB_OPT; PERL_MM_OPT="INSTALL_BASE=$BASE/perl5"; export PERL_MM_OPT; +INVOKER_OPTS="$INVOKER_OPTS -s $SERVER" +SERVER_OPTS="$SERVER_OPTS -S $SOCK_PATH --pid $PID_PATH $APP_PATH" +APP_OPTS="$APP_OPTS" + pkill -F $BASE/${APP}.pid 2>/dev/null while true;do pkill -0 -F $BASE/${APP}.pid 2>/dev/null || break; sleep 1; done cd $BASE/$APP -plackup -s Starman -D -S $BASE/$APP/.sock $BASE/$APP/bin/app.pl --pid $BASE/${APP}.pid $START_OPTS +$INVOKER $INVOKER_OPTS $SERVER_OPTS $APP_OPTS \ No newline at end of file