aboutsummaryrefslogtreecommitdiffstats
path: root/bin/srt
diff options
context:
space:
mode:
authorDavid Reyna <David.Reyna@windriver.com>2019-01-14 15:04:36 -0800
committerDavid Reyna <David.Reyna@windriver.com>2019-01-14 15:04:36 -0800
commit959cc8196aab2231b7f6f05c7e0151f8de46ea48 (patch)
tree9c3c17f03ba0e78bae986311d4f7b3368a6e34bc /bin/srt
parenta10fe453f2634d15cca1495e84085e43c65fbd3b (diff)
downloadsrtool-959cc8196aab2231b7f6f05c7e0151f8de46ea48.zip
srtool-959cc8196aab2231b7f6f05c7e0151f8de46ea48.tar.gz
srtool-959cc8196aab2231b7f6f05c7e0151f8de46ea48.tar.bz2
srtool: complete auto-update support
Complete the support for backgroup data source updates: * Add cron-start,cron-stop to srtool_update * Have cron update run as a user space script to avoid sudo * Hook cron-start,cron-stop into srt start,stop * Add list command to show update sources * Have force command propagate to update script calls, and add force option to all source scripts * Add 'srt manage update ...' for access to the update functions * Add flag SRT_SKIP_AUTOUPDATE and srt option noautoupdate to disable the automatic update app for development assistance Related Fixes: * Set the schema generator to always update on startup (13138) * Fix CVE 'recommend' default to the integer zero (13139) with auto-fix at startup for existing databases [YOCTO #13131] [YOCTO #13138] [YOCTO #13139] Signed-off-by: David Reyna <David.Reyna@windriver.com>
Diffstat (limited to 'bin/srt')
-rwxr-xr-xbin/srt19
1 files changed, 19 insertions, 0 deletions
diff --git a/bin/srt b/bin/srt
index 7af2491..41753b7 100755
--- a/bin/srt
+++ b/bin/srt
@@ -22,6 +22,7 @@ HELP="
Usage: source srt start|stop [webport=<address:port>]
Optional arguments:
[webport] Set the SRTool server port (default: localhost:8000)
+ [noautoupdate] Disable the auto update server
"
databaseCheck()
@@ -76,6 +77,11 @@ webserverKillAll()
rm ${pidfile}
fi
done
+
+ # Stop the Update app
+ if [ 0 -eq $no_auto_update ] ; then
+ ./bin/common/srtool_update.py --cron-stop
+ fi
}
webserverStartAll()
@@ -107,6 +113,11 @@ webserverStartAll()
echo "SRTool webserver started at http://$ADDR_PORT"
fi
+ # Start the Update app
+ if [ 0 -eq $no_auto_update ] ; then
+ ./bin/common/srtool_update.py --cron-start > /dev/null 2>&1 &
+ echo "SRTool update service started at PID $!"
+ fi
return $retval
}
@@ -186,6 +197,11 @@ touch $SRT_BASE_DIR/update_logs/master_log.txt
ADDR_PORT="localhost:8000"
unset CMD
manage_cmd=""
+if [ "1" = "$SRT_SKIP_AUTOUPDATE" ] ; then
+ no_auto_update=1
+else
+ no_auto_update=0
+fi
for param in $*; do
case $param in
start )
@@ -207,6 +223,9 @@ for param in $*; do
ADDR_PORT="localhost:$PORT"
fi
;;
+ noautoupdate )
+ no_auto_update=1
+ ;;
--help)
echo "$HELP"
exit 0