parent
50c45ffb3a
commit
7b2ede28fe
@ -0,0 +1,43 @@
|
|||||||
|
sudo dnf -y update
|
||||||
|
sudo dnf -y in nano nodejs npm mongodb
|
||||||
|
systemctl enable --now mongodb
|
||||||
|
|
||||||
|
sudo useradd -m -r -d /home/meshcentral -s /sbin/nologin meshcentral
|
||||||
|
|
||||||
|
#
|
||||||
|
#
|
||||||
|
cat <<EOF > /etc/systemd/system/meshcentral.service
|
||||||
|
[Unit]
|
||||||
|
Description=MeshCentral Server
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
LimitNOFILE=1000000
|
||||||
|
ExecStart=/usr/bin/node /home/meshcentral/node_modules/meshcentral
|
||||||
|
WorkingDirectory=/home/meshcentral
|
||||||
|
Environment=NODE_ENV=production
|
||||||
|
User=default
|
||||||
|
Group=default
|
||||||
|
Restart=always
|
||||||
|
# Restart service after 10 seconds if node service crashes
|
||||||
|
RestartSec=10
|
||||||
|
# Set port permissions capability
|
||||||
|
#AmbientCapabilities=cap_net_bind_service
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
cd /home/meshcentral
|
||||||
|
sudo npm install meshcentral
|
||||||
|
read -n1 -r -p "Press any key to continue..."
|
||||||
|
nano meshcentral-data/config.json
|
||||||
|
echo "ctrl+c to continue after testing..."
|
||||||
|
sudo -u meshcentral node ./node_modules/meshcentral
|
||||||
|
|
||||||
|
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
sudo systemctl enable --now meshcentral.service
|
||||||
Loading…
Reference in new issue