osmocom-nitb debian package improvements.

* Don't enable MNCC sock by default.
* Create important directories.
* Fix init script 'stop' command.
diff --git a/openbsc/debian/changelog b/openbsc/debian/changelog
index ed0b8f2..a1141cb 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 106c2f9..ef76a5f 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 0000000..efbca2b
--- /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 e4d02b4..0747446 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 @@
 	#   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 @@
 	#   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 @@
 	# 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 @@
 	# 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
 }