-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add debian-based setup for local test server
- Loading branch information
Showing
3 changed files
with
227 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
tests/testdata/qgis_local_server/fcgi/scripts/spawn_fcgi_debian.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#!/bin/sh | ||
#culled from lighttpd init script | ||
|
||
|
||
PATH=/sbin:/bin:/usr/sbin:/usr/bin | ||
DAEMON=$2 | ||
NAME=spawn-fcgi | ||
DESC="$NAME" | ||
TEMPDIR=$4 | ||
FCGI=qgis_mapserv | ||
PIDFILE=$TEMPDIR/var/$NAME.pid | ||
FCGISOCKET=$3 | ||
FCGIBIN=$TEMPDIR/cgi-bin/$FCGI.fcgi | ||
SCRIPTNAME=$NAME | ||
|
||
|
||
test -x $DAEMON || exit 1 | ||
|
||
set -e | ||
|
||
. /lib/lsb/init-functions | ||
|
||
case "$1" in | ||
start) | ||
log_daemon_msg "Starting $DESC" $NAME | ||
if ! start-stop-daemon --start --oknodo --quiet \ | ||
--pidfile $PIDFILE -m -b --exec $DAEMON -- \ | ||
-n -C 0 -s $FCGISOCKET -f $FCGIBIN | ||
then | ||
log_end_msg 1 | ||
else | ||
log_end_msg 0 | ||
fi | ||
;; | ||
stop) | ||
log_daemon_msg "Stopping $DESC" $NAME | ||
# this would also kill any other qgis_mapserv.fcgi running; not good | ||
#if killall --signal 2 $FCGI.fcgi > /dev/null 2> /dev/null | ||
# we can get around this because there should only be 1 process when testing | ||
if kill -s 9 $(cat $PIDFILE) > /dev/null 2> /dev/null | ||
then | ||
rm -f $PIDFILE $FCGISOCKET | ||
log_end_msg 0 | ||
else | ||
log_end_msg 1 | ||
fi | ||
;; | ||
restart) | ||
$0 stop $2 $3 $4 | ||
$0 start $2 $3 $4 | ||
;; | ||
status) | ||
status_of_proc -p "$PIDFILE" "$DAEMON" spawn-fcgi && exit 0 || exit $? | ||
;; | ||
*) | ||
echo "Usage: $SCRIPTNAME {start|stop|restart|status}" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
|
||
exit 0 |
93 changes: 93 additions & 0 deletions
93
tests/testdata/qgis_local_server/lighttpd/scripts/lighttpd_debian.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#!/bin/sh | ||
#from init script | ||
|
||
|
||
PATH=/sbin:/bin:/usr/sbin:/usr/bin | ||
DAEMON=$2 | ||
NAME=lighttpd | ||
DESC="web server" | ||
PIDFILE=$3/var/$NAME.pid | ||
SCRIPTNAME=$NAME | ||
|
||
export QGIS_SERVER_TEMP_DIR=$3 | ||
|
||
if [ ! -z $4 ]; then | ||
DAEMON_OPTS="-f ${4}" | ||
fi | ||
|
||
test -x $DAEMON || exit 1 | ||
|
||
set -e | ||
|
||
check_syntax() | ||
{ | ||
$DAEMON -t $DAEMON_OPTS > /dev/null || exit $? | ||
} | ||
|
||
. /lib/lsb/init-functions | ||
|
||
case "$1" in | ||
start) | ||
check_syntax | ||
log_daemon_msg "Starting $DESC" $NAME | ||
if ! start-stop-daemon --start --oknodo --quiet \ | ||
--pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS | ||
then | ||
log_end_msg 1 | ||
else | ||
log_end_msg 0 | ||
fi | ||
;; | ||
stop) | ||
log_daemon_msg "Stopping $DESC" $NAME | ||
if start-stop-daemon --stop --retry 30 --oknodo --quiet \ | ||
--pidfile $PIDFILE --exec $DAEMON | ||
then | ||
rm -f $PIDFILE | ||
log_end_msg 0 | ||
else | ||
log_end_msg 1 | ||
fi | ||
;; | ||
reload|force-reload) | ||
check_syntax | ||
log_daemon_msg "Reloading $DESC configuration" $NAME | ||
if start-stop-daemon --stop --signal INT --quiet \ | ||
--pidfile $PIDFILE --exec $DAEMON | ||
then | ||
rm $PIDFILE | ||
if start-stop-daemon --start --quiet \ | ||
--pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS ; then | ||
log_end_msg 0 | ||
else | ||
log_end_msg 1 | ||
fi | ||
else | ||
log_end_msg 1 | ||
fi | ||
;; | ||
reopen-logs) | ||
log_daemon_msg "Reopening $DESC logs" $NAME | ||
if start-stop-daemon --stop --signal HUP --oknodo --quiet \ | ||
--pidfile $PIDFILE --exec $DAEMON | ||
then | ||
log_end_msg 0 | ||
else | ||
log_end_msg 1 | ||
fi | ||
;; | ||
restart) | ||
check_syntax | ||
$0 stop $2 $3 | ||
$0 start $2 $3 $4 | ||
;; | ||
status) | ||
status_of_proc -p "$PIDFILE" "$DAEMON" lighttpd && exit 0 || exit $? | ||
;; | ||
*) | ||
echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
|
||
exit 0 |