aboutsummaryrefslogtreecommitdiff
path: root/system/mongodb/files
diff options
context:
space:
mode:
authorMatteo Bernardini <ponce@slackbuilds.org>2021-11-21 10:35:46 +0100
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2021-11-22 09:10:21 +0700
commit93d08acee128b4d9714bc7c911c5fb88938be804 (patch)
tree466608a8f9dd66d686f61c4cf8aea217694c77d3 /system/mongodb/files
parent8fb7497f26e2bfcaf84fbc37a2f4590237b0f1d3 (diff)
system/mongodb: Updated for version 5.0.4.
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/mongodb/files')
-rw-r--r--system/mongodb/files/mongodb.conf34
-rw-r--r--system/mongodb/files/mongodb.logrotate13
-rw-r--r--system/mongodb/files/mongos.conf30
-rw-r--r--system/mongodb/files/rc.mongodb68
4 files changed, 145 insertions, 0 deletions
diff --git a/system/mongodb/files/mongodb.conf b/system/mongodb/files/mongodb.conf
new file mode 100644
index 0000000000..83b4cc0589
--- /dev/null
+++ b/system/mongodb/files/mongodb.conf
@@ -0,0 +1,34 @@
+# !! IMPORTANT !!
+#
+# This file uses the YAML format as described in the documentation:
+# http://docs.mongodb.org/manual/reference/configuration-options/
+
+storage:
+ dbPath: "/var/lib/mongodb"
+ #engine: wiredTiger
+
+systemLog:
+ destination: file
+ path: "/var/log/mongodb/mongodb.log"
+ quiet: true
+ logAppend: true
+
+net:
+ port: 27017
+ bindIp: 127.0.0.1
+ #ssl:
+ # mode: disabled
+
+#security:
+ #keyFile:
+ #clusterAuthMode:
+
+#replication:
+ #replSetName:
+
+# Specifies one of the MongoDB parameters described here:
+# http://docs.mongodb.org/manual/reference/parameters/
+#
+# You can specify multiple setParameter fields such as:
+# setParameter: {enableTestCommands: 1}
+#setParameter:
diff --git a/system/mongodb/files/mongodb.logrotate b/system/mongodb/files/mongodb.logrotate
new file mode 100644
index 0000000000..f95a438b5b
--- /dev/null
+++ b/system/mongodb/files/mongodb.logrotate
@@ -0,0 +1,13 @@
+# Default log rotation / compression keeps 1 year of logs.
+/var/log/mongodb/*.log {
+ daily
+ rotate 365
+ dateext
+ copytruncate
+ delaycompress
+ compress
+ notifempty
+ extension gz
+ sharedscripts
+ missingok
+}
diff --git a/system/mongodb/files/mongos.conf b/system/mongodb/files/mongos.conf
new file mode 100644
index 0000000000..fc0068962c
--- /dev/null
+++ b/system/mongodb/files/mongos.conf
@@ -0,0 +1,30 @@
+# !! IMPORTANT !!
+#
+# This file uses the YAML format as described in the documentation:
+# http://docs.mongodb.org/manual/reference/configuration-options/
+
+systemLog:
+ destination: file
+ path: "/var/log/mongodb/mongos.log"
+ quiet: true
+ logAppend: true
+
+net:
+ port: 27017
+ bindIp: 127.0.0.1
+ ssl:
+ mode: disabled
+
+#security:
+ #keyFile:
+ #clusterAuthMode:
+
+#sharding:
+ #configDB:
+
+# Specifies one of the MongoDB parameters described here:
+# http://docs.mongodb.org/manual/reference/parameters/
+#
+# You can specify multiple setParameter fields such as:
+# setParameter: {enableTestCommands: 1}
+#setParameter:
diff --git a/system/mongodb/files/rc.mongodb b/system/mongodb/files/rc.mongodb
new file mode 100644
index 0000000000..47ca19be76
--- /dev/null
+++ b/system/mongodb/files/rc.mongodb
@@ -0,0 +1,68 @@
+#!/bin/sh
+#
+# /etc/rc.d/rc.mongodb
+#
+# Start/stop/restart the mongodb server.
+#
+#
+
+PID=/var/state/mongodb.pid
+LOG=/var/log/mongodb
+DBPATH=/var/lib/mongodb
+USER=mongo
+GROUP=mongo
+SHELL=${SHELL:-/bin/bash}
+
+mongo_start() {
+ touch $LOG
+ chown $GROUP.$USER $LOG
+ touch $PID
+ chown $GROUP.$USER $PID
+
+ su -l $USER -s $SHELL -c "/usr/bin/mongod \
+ --dbpath=$DBPATH \
+ --fork \
+ --pidfilepath=$PID \
+ --logappend \
+ --logpath=$LOG \
+ --nohttpinterface \
+ " && {
+ echo "MongoDB server started successfully."
+ } || {
+ echo "Failed starting MongoDB server!" > /dev/stderr
+ exit 1
+ }
+}
+
+mongo_stop() {
+ kill `cat $PID` && {
+ echo "MongoDB server stopped."
+ } || {
+ echo "Failed to stop MongoDB server" > /dev/stderr
+ exit 1
+ }
+ # rm $PID
+}
+
+mongo_restart() {
+ mongo_stop
+ sleep 2
+ mongo_start
+}
+
+case "$1" in
+ 'start')
+ mongo_start
+ ;;
+ 'stop')
+ mongo_stop
+ ;;
+ 'restart')
+ mongo_restart
+ ;;
+ *)
+ # Default is "start", for backwards compatibility with previous
+ # Slackware versions. This may change to a 'usage' error someday.
+ mongo_start
+esac
+