summaryrefslogtreecommitdiffstats
path: root/debian/buildsys/common
diff options
context:
space:
mode:
Diffstat (limited to 'debian/buildsys/common')
-rw-r--r--debian/buildsys/common/bcfg2-server.init86
-rw-r--r--debian/buildsys/common/bcfg2.init70
-rw-r--r--debian/buildsys/common/compat1
-rw-r--r--debian/buildsys/common/pycompat1
4 files changed, 158 insertions, 0 deletions
diff --git a/debian/buildsys/common/bcfg2-server.init b/debian/buildsys/common/bcfg2-server.init
new file mode 100644
index 000000000..5a51056f2
--- /dev/null
+++ b/debian/buildsys/common/bcfg2-server.init
@@ -0,0 +1,86 @@
+#!/bin/sh
+#
+# Bcfg2Server - Bcfg2 configuration daemon
+#
+# chkconfig: 2345 19 81
+# description: bcfg2 server for configuration requests
+#
+### BEGIN INIT INFO
+# Provides: bcfg2-server
+# Required-Start: $network
+# Required-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: S 0 1 6
+# Short-Description: Configuration management Server
+# Description: Bcfg2 is a configuration management system that builds
+# installs configuration files served by bcfg2-server
+### END INIT INFO
+
+DAEMON=/usr/sbin/bcfg2-server
+PIDFILE=/var/run/bcfg2-server.pid
+PARAMS="-D $PIDFILE"
+
+# Exit if $DAEMON doesn't exist and is not executable
+test -x $DAEMON || exit 5
+
+# Include lsb functions
+. /lib/lsb/init-functions
+
+# Internal variables
+BINARY=$(basename $DAEMON)
+
+case "$1" in
+ start)
+ echo -n "Starting Configuration Management Server: "
+ start_daemon ${DAEMON} ${PARAMS}
+ STATUS=$?
+ if [ "$STATUS" = 0 ]
+ then
+ log_success_msg "bcfg2-server"
+ else
+ log_failure_msg "bcfg2-server"
+ fi
+ exit $STATUS
+ ;;
+ stop)
+ echo -n "Stopping Configuration Management Server: "
+ killproc ${BINARY}
+ STATUS=$?
+ if [ "$STATUS" = 0 ]; then
+ log_success_msg "bcfg2-server"
+ exit 0
+ else
+ log_failure_msg "bcfg2-server"
+ fi
+ exit $STATUS
+ ;;
+ force-reload|restart)
+ $0 stop
+ sleep 5
+ $0 start
+ ;;
+ status)
+ # Inspired by redhat /etc/init.d/functions status() call
+ PID=$(pidof -x $BINARY)
+ if [ -n "$PID" ]; then
+ echo "$BINARY (pid $PID) is running..."
+ exit 0
+ fi
+
+ if [ -f $PIDFILE ]; then
+ if [ -n "$PID" ]; then
+ echo "$BINARY dead but pid file exists..."
+ exit 1
+ fi
+ fi
+
+ echo "$BINARY is not running"
+ exit 3
+ ;;
+ *)
+ log_success_msg "Usage: bcfg2-server {start|stop|restart|force-reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/debian/buildsys/common/bcfg2.init b/debian/buildsys/common/bcfg2.init
new file mode 100644
index 000000000..e7466f18d
--- /dev/null
+++ b/debian/buildsys/common/bcfg2.init
@@ -0,0 +1,70 @@
+#!/bin/sh
+# Start bcfg2 client on startup
+#
+# bcfg2 - bcfg2 configuration client
+#
+# chkconfig: 2345 19 81
+# description: bcfg2 client for configuration requests
+#
+### BEGIN INIT INFO
+# Provides: bcfg2
+# Required-Start: $network $named
+# Required-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: S 0 1 6
+# Short-Description: Configuration management client
+# Description: Bcfg2 is a configuration management system that builds
+# installs configuration files served by bcfg2-server
+# This is a client that installs the server provided
+# Configuration.
+### END INIT INFO
+
+# This might need some better logic
+BCFG2=/usr/sbin/bcfg2
+
+BCFG2_OPTIONS="-q"
+
+# Disabled per default
+BCFG2_ENABLED=0
+
+# Include default startup configuration if exists
+test -f "/etc/default/bcfg2" && . /etc/default/bcfg2
+
+test "$BCFG2_ENABLED" != "0" || exit 0
+
+# Exit if bcfg2 doesn't exist and is not executable
+test -x $BCFG2 || exit 5
+
+# Include lsb functions
+. /lib/lsb/init-functions
+
+case "$1" in
+ start)
+ echo -n "Running configuration management client: "
+ ${BCFG2} ${BCFG2_OPTIONS}
+ STATUS=$?
+ if [ "$STATUS" = 0 ]
+ then
+ log_success_msg "bcfg2"
+ else
+ log_failure_msg "bcfg2"
+ fi
+ exit $STATUS
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ status)
+ # Since we are always OK, always return OK as status
+ exit 0
+ ;;
+ stop|force-reload)
+ true
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|force-reload|status}"
+ exit 1
+esac
+
+exit 0
diff --git a/debian/buildsys/common/compat b/debian/buildsys/common/compat
new file mode 100644
index 000000000..7ed6ff82d
--- /dev/null
+++ b/debian/buildsys/common/compat
@@ -0,0 +1 @@
+5
diff --git a/debian/buildsys/common/pycompat b/debian/buildsys/common/pycompat
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/debian/buildsys/common/pycompat
@@ -0,0 +1 @@
+1