[csw-devel] SF.net SVN: opencsw:[624] catalog_signatures
bdwalton at users.sourceforge.net
bdwalton at users.sourceforge.net
Tue Jul 24 04:32:36 CEST 2012
Revision: 624
http://opencsw.svn.sourceforge.net/opencsw/?rev=624&view=rev
Author: bdwalton
Date: 2012-07-24 02:32:36 +0000 (Tue, 24 Jul 2012)
Log Message:
-----------
Avoid trying to start another screen based on PID file
Avoid starting more than one screen session and print a message for the
caller if it looks as though screen might be running. We're using a
simple PID file to mark this for now. We'll add more smarts if required.
Signed-off-by: Ben Walton <bwalton at opencsw.org>
Modified Paths:
--------------
catalog_signatures/bin/signing_daemon
catalog_signatures/etc/signing_daemon.conf
catalog_signatures/tmp/.gitignore
Modified: catalog_signatures/bin/signing_daemon
===================================================================
--- catalog_signatures/bin/signing_daemon 2012-07-24 02:32:12 UTC (rev 623)
+++ catalog_signatures/bin/signing_daemon 2012-07-24 02:32:36 UTC (rev 624)
@@ -32,4 +32,11 @@
export GPG_AGENT_INFO
fi
-exec screen -c "${APP_ETC}/screenrc" -p 0
+if [ -f "${APP_PID}" ]; then
+ echo "We think a daemon is already running (pid: $(cat ${APP_PID}))."
+ echo "If this is wrong, remove:"
+ echo "'${APP_PID}'"
+else
+ echo $$ >"${APP_PID}"
+ exec screen -c "${APP_ETC}/screenrc" -p 0
+fi
Modified: catalog_signatures/etc/signing_daemon.conf
===================================================================
--- catalog_signatures/etc/signing_daemon.conf 2012-07-24 02:32:12 UTC (rev 623)
+++ catalog_signatures/etc/signing_daemon.conf 2012-07-24 02:32:36 UTC (rev 624)
@@ -4,6 +4,7 @@
APP_TMP="${APP_HOME}/tmp"
APP_LOGDIR="${APP_HOME}/log"
APP_GPG_ENV="${APP_TMP}/gpg-agent-env.conf"
+APP_PID="${APP_TMP}/signing_daemon.pid"
APP_MIRROR_BASE="/export/mirror"
APP_PORT=9981
APP_MAILTO="bwalton maciej ihsan"
Modified: catalog_signatures/tmp/.gitignore
===================================================================
--- catalog_signatures/tmp/.gitignore 2012-07-24 02:32:12 UTC (rev 623)
+++ catalog_signatures/tmp/.gitignore 2012-07-24 02:32:36 UTC (rev 624)
@@ -1,3 +1,4 @@
gpg-agent.conf
*asc
gpg-agent*
+signing_daemon.pid
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list