-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstaller
More file actions
20 lines (20 loc) · 741 Bytes
/
installer
File metadata and controls
20 lines (20 loc) · 741 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
#
# Initial user and directory setup
echo "Creating a new system account named mongodb ..."
useradd -s /sbin/nologin -r mongodb
echo "Creating directory /opt/mongo/data ..."
mkdir /opt/mongo/data
echo "Creating directory /opt/mongo/log ..."
mkdir /opt/mongo/log
echo "Changing the owner of directory /opt/mongo/data to mongodb ..."
chown mongodb /opt/mongo/data
echo "Changing the owner of directory /opt/mongo/log to mongodb ..."
chown mongodb /opt/mongo/log
# Copy the init script and config file
echo "Copying init script to /etc/init.d/mongod ..."
cp ./etc/init.d/mongodb /etc/init.d/mongodb
echo "Making init script executable ..."
chmod +x /etc/init.d/mongodb
echo "Setting up runtime links ..."
update-rc.d mongodb defaults