[med-svn] [conquest-dicom-server] 06/08: Run daemon if sqlite or dbase. Others need config.

Pablo Lorenzzoni spectra at moszumanska.debian.org
Mon Mar 31 18:32:04 UTC 2014


This is an automated email from the git hooks/post-receive script.

spectra pushed a commit to branch master
in repository conquest-dicom-server.

commit 5d61c15eee980400f9061d5749e2555edcb72ea2
Author: Pablo Lorenzzoni <spectra at debian.org>
Date:   Sun Mar 30 13:39:38 2014 +0000

    Run daemon if sqlite or dbase. Others need config.
---
 debian/conquest-dicom-server.dgate.init | 10 ++++++++++
 debian/dgate.default.in                 |  8 ++++++++
 debian/replicate-common-files           | 24 ++++++++++++++++++++----
 3 files changed, 38 insertions(+), 4 deletions(-)

diff --git a/debian/conquest-dicom-server.dgate.init b/debian/conquest-dicom-server.dgate.init
index b08bbf3..283d808 100755
--- a/debian/conquest-dicom-server.dgate.init
+++ b/debian/conquest-dicom-server.dgate.init
@@ -25,10 +25,14 @@ DAEMON=/usr/bin/$NAME # Introduce the server's location here
 DAEMON_ARGS="-^$LOGDIR/$NAME.log" # Arguments to run the daemon with
 PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
+DGATE_ENABLE=false
 
 # Exit if the package is not installed
 [ -x $DAEMON ] || exit 0
 
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
 # Load the VERBOSE setting and other rcS variables
 . /lib/init/vars.sh
 
@@ -46,6 +50,12 @@ if ! getent group | grep -q "^$GROUP:"; then
     exit 1
 fi
 
+# Does not run if not enabled in default file
+if ! $DGATE_ENABLE; then
+    echo "You must enable daemon at /etc/default/$NAME. Aborting" >&2
+    exit 1
+fi
+
 #
 # Function that starts the daemon/service
 #
diff --git a/debian/dgate.default.in b/debian/dgate.default.in
new file mode 100644
index 0000000..5f82dc2
--- /dev/null
+++ b/debian/dgate.default.in
@@ -0,0 +1,8 @@
+# Please note that you have to configure /etc/conquest-dicom-server/dicom.ini
+# to provide database configuration for conquest-mysql and conquest-postgres.
+# The variants with disk-based database (conquest-dbase and conquest-sqlite)
+# have the follwing variable set to true by default since default database file
+# location is assumed.
+#
+# Set the following variable true or false to run the daemon
+DGATE_ENABLE=DGATE_ENABLE_VALUE
diff --git a/debian/replicate-common-files b/debian/replicate-common-files
index 07a9f51..c16559e 100755
--- a/debian/replicate-common-files
+++ b/debian/replicate-common-files
@@ -3,11 +3,27 @@
 EXTENSIONS="dgate.init manpages postinst postrm"
 PACKAGES="conquest-dbase conquest-mysql conquest-postgres conquest-sqlite"
 BASE=conquest-dicom-server
+DGATE_ENABLE_VALUE=true
 
 for package in $PACKAGES; do
-	for extension in $EXTENSIONS; do
-		cp debian/$BASE.$extension debian/$package.$extension
-	done
-	sed "s/PACKAGE/$package/" debian/lintian-overrides.in > \
+    # Solve common replication
+    for extension in $EXTENSIONS; do
+        cp debian/$BASE.$extension debian/$package.$extension
+    done
+
+    # Solve lintian-overrides
+    sed "s/PACKAGE/$package/" debian/lintian-overrides.in > \
             debian/$package.lintian-overrides
+
+    # Solve default file
+    case $package in
+        conquest-dbase|conquest-sqlite)
+            DGATE_ENABLE_VALUE=true
+            ;;
+        conquest-mysql|conquest-postgres)
+            DGATE_ENABLE_VALUE=false
+            ;;
+    esac
+    sed "s/DGATE_ENABLE_VALUE/$DGATE_ENABLE_VALUE/" debian/dgate.default.in > \
+            debian/$package.dgate.default
 done

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/conquest-dicom-server.git



More information about the debian-med-commit mailing list