From 3ab2b352144d54d77362c352af1c459594cb6fa7 Mon Sep 17 00:00:00 2001 From: haturatu Date: Tue, 23 Apr 2024 19:38:24 +0900 Subject: first commit --- mongod | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 mongod diff --git a/mongod b/mongod new file mode 100644 index 0000000..9c87973 --- /dev/null +++ b/mongod @@ -0,0 +1,30 @@ +#!/sbin/openrc-run + +command="/usr/bin/mongod" +command_args="--fork --config /etc/mongodb.conf " +pidfile="/var/run/mongodb/mongod.pid" +name="MongoDB" +description="MongoDB is a high-performance, open-source, NoSQL database" + +depend() { + need net + after firewall +} + +start_pre() { + checkpath --directory --owner mongodb:mongodb --mode 0755 /var/run/mongodb + checkpath --directory --owner mongodb:mongodb --mode 0755 /var/lib/mongodb +} + +start() { + ebegin "Starting ${name}" + start-stop-daemon --start --quiet --exec ${command} -- ${command_args} + eend $? +} + +stop() { + ebegin "Stopping ${name}" + start-stop-daemon --stop --quiet --pidfile ${pidfile} + eend $? +} + -- cgit v1.2.3