aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Butler <eric@codebutler.com>2012-08-24 20:57:40 -0700
committerHarald Welte <laforge@gnumonks.org>2012-08-26 20:09:55 +0200
commitb561459dd666b4dd4d0f237ac18c3db30edefb1a (patch)
tree2fc636c32ec8d279bae8e7ee83c8481497772efe
parent6e7d137e791408a37836c6e7b41f113bb799bb23 (diff)
osmocom-nitb debian package improvements.
* Don't enable MNCC sock by default. * Create important directories. * Fix init script 'stop' command.
-rw-r--r--openbsc/debian/changelog8
-rw-r--r--openbsc/debian/osmocom-nitb.default7
-rw-r--r--openbsc/debian/osmocom-nitb.dirs3
-rwxr-xr-xopenbsc/debian/osmocom-nitb.init21
4 files changed, 26 insertions, 13 deletions
diff --git a/openbsc/debian/changelog b/openbsc/debian/changelog
index ed0b8f25c..a1141cb6f 100644
--- a/openbsc/debian/changelog
+++ b/openbsc/debian/changelog
@@ -1,3 +1,11 @@
+openbsc (0.12.0+git26-5) precise; urgency=low
+
+ * Don't enable MNCC sock by default.
+ * Automatically create important directories.
+ * Fix init script 'stop' command.
+
+ -- Eric Butler <eric@codebutler.com> Fri, 24 Aug 2012 20:56:33 -0700
+
openbsc (0.12.0+git26-4) precise; urgency=low
* Specify HLR path and enable RTP proxy.
diff --git a/openbsc/debian/osmocom-nitb.default b/openbsc/debian/osmocom-nitb.default
index 106c2f9e4..ef76a5f92 100644
--- a/openbsc/debian/osmocom-nitb.default
+++ b/openbsc/debian/osmocom-nitb.default
@@ -1,3 +1,8 @@
CONFIG_FILE="/etc/osmocom/osmo-nitb.cfg"
HLR_FILE="/var/lib/osmocom/hlr.sqlite3"
-DAEMON_ARGS="-m -P"
+
+DAEMON_ARGS="-P"
+
+# Uncomment if using LCR+Asterisk
+# DAEMON_ARGS="-m -P"
+
diff --git a/openbsc/debian/osmocom-nitb.dirs b/openbsc/debian/osmocom-nitb.dirs
new file mode 100644
index 000000000..efbca2b74
--- /dev/null
+++ b/openbsc/debian/osmocom-nitb.dirs
@@ -0,0 +1,3 @@
+/etc/osmocom
+/var/log/osmocom
+/var/lib/osmocom
diff --git a/openbsc/debian/osmocom-nitb.init b/openbsc/debian/osmocom-nitb.init
index e4d02b427..07474465c 100755
--- a/openbsc/debian/osmocom-nitb.init
+++ b/openbsc/debian/osmocom-nitb.init
@@ -15,17 +15,16 @@
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
-DESC=osmo-nitb # Introduce a short description here
-NAME=osmocom-nitb # Introduce the short server's name here
-DAEMON=/usr/bin/osmo-nitb # Introduce the server's location here
-PIDFILE=/var/run/$NAME.pid
-SCRIPTNAME=/etc/init.d/$NAME
+NAME=osmo-nitb # Introduce the short server's name here
+DESC="Osmocom GSM Network-in-a-Box" # Introduce a short description here
+DAEMON=/usr/bin/osmo-nitb # Introduce the server's location here
+SCRIPTNAME=/etc/init.d/osmocom-nitb
# 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
+[ -r /etc/default/osmocom-nitb ] && . /etc/default/osmocom-nitb
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
@@ -45,9 +44,9 @@ do_start()
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
- start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
+ start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \
|| return 1
- start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
+ start-stop-daemon --start --quiet --exec $DAEMON -- \
$DAEMON_ARGS \
|| return 2
# Add code here, if necessary, that waits for the process to be ready
@@ -65,7 +64,7 @@ do_stop()
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
- start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
+ start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
@@ -76,8 +75,6 @@ do_stop()
# sleep for some time.
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
[ "$?" = 2 ] && return 2
- # Many daemons don't delete their pidfiles when they exit.
- rm -f $PIDFILE
return "$RETVAL"
}
@@ -90,7 +87,7 @@ do_reload() {
# restarting (for example, when it is sent a SIGHUP),
# then implement that here.
#
- start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
+ start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME
return 0
}