diff options
author | Antonin Kral <a.kral@bobek.cz> | 2012-02-01 14:51:59 +0100 |
---|---|---|
committer | Antonin Kral <a.kral@bobek.cz> | 2012-02-01 14:53:52 +0100 |
commit | 1a7d46ff72a66d38287894be2122c787cb1db8dd (patch) | |
tree | 24a23b333f81c983e05c2325aa310f2ccc5fcb7c | |
parent | 0be233910d42d5aab192f9c4ca502661d8439df6 (diff) | |
download | mongodb-1a7d46ff72a66d38287894be2122c787cb1db8dd.tar.gz |
Move socket from /tmp to /var/run/mongodb (Closes: #658177)
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | debian/mongodb-server.mongodb.init | 6 | ||||
-rw-r--r-- | debian/mongodb-server.postinst | 4 | ||||
-rw-r--r-- | debian/mongodb-server.postrm | 1 |
4 files changed, 15 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog index 8558e5b..4bad3f5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +mongodb (1:2.0.2-4) unstable; urgency=low + + * Move socket from /tmp to /var/run/mongodb (Closes: #658177) + + -- Antonin Kral <A.Kral@sh.cvut.cz> Wed, 01 Feb 2012 14:53:12 +0100 + mongodb (1:2.0.2-3) unstable; urgency=low * Describe jsonArray option for mongoimport in manpage (Closes: 656444) diff --git a/debian/mongodb-server.mongodb.init b/debian/mongodb-server.mongodb.init index 5c5f879..ba426e6 100644 --- a/debian/mongodb-server.mongodb.init +++ b/debian/mongodb-server.mongodb.init @@ -55,7 +55,8 @@ DESC=database # Default defaults. Can be overridden by the /etc/default/$NAME NAME=mongodb CONF=/etc/mongodb.conf -PIDFILE=/var/run/$NAME.pid +RUNDIR=/var/run/mongodb +PIDFILE=$RUNDIR/$NAME.pid ENABLE_MONGODB=yes # Include mongodb defaults if available @@ -81,7 +82,7 @@ DIETIME=10 # Time to wait for the server to die, in seconds # 'restart' will not work DAEMONUSER=${DAEMONUSER:-mongodb} -DAEMON_OPTS=${DAEMON_OPTS:-"--config $CONF run"} +DAEMON_OPTS=${DAEMON_OPTS:-"--unixSocketPrefix=$RUNDIR --config $CONF run"} set -e @@ -110,6 +111,7 @@ running() { } start_server() { + test -e "$RUNDIR" || install -m 755 -o mongodb -g mongodb -d "$RUNDIR" # Start the process using the wrapper start-stop-daemon --background --start --quiet --pidfile $PIDFILE \ --make-pidfile --chuid $DAEMONUSER \ diff --git a/debian/mongodb-server.postinst b/debian/mongodb-server.postinst index 4d0e786..5dac006 100644 --- a/debian/mongodb-server.postinst +++ b/debian/mongodb-server.postinst @@ -34,6 +34,10 @@ case "$1" in # create logdir -- note: this should agree with logpath in mongodb.conf mkdir -p /var/log/mongodb chown -R mongodb:mongodb /var/log/mongodb + + # create rundir + mkdir -p /var/run/mongodb + chown -R mongodb:mongodb /var/run/mongodb ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/mongodb-server.postrm b/debian/mongodb-server.postrm index 4bbb708..07795e3 100644 --- a/debian/mongodb-server.postrm +++ b/debian/mongodb-server.postrm @@ -21,6 +21,7 @@ set -e case "$1" in purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + rm -rf /var/run/mongodb ;; *) |