summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamie Lenehan <lenehan@twibble.org>2006-07-05 03:38:14 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2006-07-05 03:38:14 +0000
commit2409fc2ca7617c894f85b2debb980e4f2ee97dd7 (patch)
treeeeb96617653125afb2a4f0bbd967241e24c2624d
parentda91731e4e859cdd363e72957624d0e87cc47b18 (diff)
conserver: Add a proper init script for conserver and use a default file to
set the port number so that it does not require an entry in /etc/services to run.
-rw-r--r--packages/conserver/conserver.inc25
-rw-r--r--packages/conserver/conserver_8.1.14.bb2
-rw-r--r--packages/conserver/conserver_8.1.2.bb2
-rw-r--r--packages/conserver/files/.mtn2git_empty0
-rw-r--r--packages/conserver/files/conserver.default2
-rw-r--r--packages/conserver/files/conserver.init37
6 files changed, 60 insertions, 8 deletions
diff --git a/packages/conserver/conserver.inc b/packages/conserver/conserver.inc
index 1102630b5b..579def2fab 100644
--- a/packages/conserver/conserver.inc
+++ b/packages/conserver/conserver.inc
@@ -3,16 +3,29 @@ consoles and logs all data to a central host."
HOMEPAGE = "http://www.conserver.com/"
SECTION = "console/network"
LICENSE = "BSD"
-SRC_URI = "http://www.conserver.com/conserver-${PV}.tar.gz"
-inherit autotools
+SRC_URI = "http://www.conserver.com/conserver-${PV}.tar.gz \
+ file://conserver.init \
+ file://conserver.default"
+
+inherit autotools update-rc.d
+
+# Settings for the initscript
+INITSCRIPT_NAME = "conserver"
+INITSCRIPT_PARAMS = "defaults 98 2"
-#
# Stop install being called with -s so it doesn't try and run the host strip command
-#
EXTRA_OEMAKE=" INSTALL_PROGRAM=install"
-#
# Include the examples in the documentation package
-#
FILES_${PN}-doc += "${datadir}/examples/conserver"
+
+# Indicate that the default file is a configuation file
+CONFFILES_${PN} = "${sysconfdir}/default/conserver"
+
+# Include the init script and default settings in the package
+do_install_append () {
+ install -m 0755 -d ${D}${sysconfdir}/default ${D}${sysconfdir}/init.d
+ install -m 0644 ${WORKDIR}/conserver.default ${D}${sysconfdir}/default/conserver
+ install -m 0755 ${WORKDIR}/conserver.init ${D}${sysconfdir}/init.d/conserver
+}
diff --git a/packages/conserver/conserver_8.1.14.bb b/packages/conserver/conserver_8.1.14.bb
index 3b16ea5547..ce7ba48efc 100644
--- a/packages/conserver/conserver_8.1.14.bb
+++ b/packages/conserver/conserver_8.1.14.bb
@@ -1,2 +1,2 @@
include conserver.inc
-PR="r1"
+PR="r2"
diff --git a/packages/conserver/conserver_8.1.2.bb b/packages/conserver/conserver_8.1.2.bb
index ce7ba48efc..306a3f5129 100644
--- a/packages/conserver/conserver_8.1.2.bb
+++ b/packages/conserver/conserver_8.1.2.bb
@@ -1,2 +1,2 @@
include conserver.inc
-PR="r2"
+PR="r3"
diff --git a/packages/conserver/files/.mtn2git_empty b/packages/conserver/files/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/conserver/files/.mtn2git_empty
diff --git a/packages/conserver/files/conserver.default b/packages/conserver/files/conserver.default
new file mode 100644
index 0000000000..64e589c6a2
--- /dev/null
+++ b/packages/conserver/files/conserver.default
@@ -0,0 +1,2 @@
+# Set the port (otherwise it needs conserver in /etc/services)
+CONSERVER_ARGS="-p 782"
diff --git a/packages/conserver/files/conserver.init b/packages/conserver/files/conserver.init
new file mode 100644
index 0000000000..dfbb72c6be
--- /dev/null
+++ b/packages/conserver/files/conserver.init
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# Startup for conserver
+#
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/conserver
+PIDFILE="/var/run/conserver.pid"
+DESC="Serial console server"
+CONF="/etc/conserver.cf"
+
+test ! -r /etc/default/conserver || . /etc/default/conserver
+test -x "$DAEMON" || exit 0
+test -f "$CONF" || exit 0
+
+case "$1" in
+ 'start')
+ echo "Starting console server daemon"
+ start-stop-daemon -S -x "$DAEMON" -- -d $CONSERVER_ARGS
+ ;;
+
+ 'stop')
+ echo "Stopping console server daemon"
+ start-stop-daemon -K -x "$DAEMON"
+ ;;
+
+ 'restart')
+ echo "Restarting console server daemon"
+ [ -e $PIDFILE ] && kill -HUP `cat $PIDFILE`
+ ;;
+
+ *)
+ echo "Usage: $0 { start | stop | restart }"
+ ;;
+
+esac
+exit 0