Add pm2 configuration for manager MagicMirror in script installer

This commit is contained in:
Rodrigo Ramírez Norambuena
2017-01-09 20:39:48 -03:00
parent 8ac8b666bf
commit d71fd0ff2d
4 changed files with 16 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Added
- Add loaded function to modules, providing an async callback.
- Add use pm2 for manager process into Installer RaspberryPi script
## [2.1.0] - 2016-12-31

2
installers/mm.sh Executable file
View File

@@ -0,0 +1,2 @@
cd ~/MagicMirror
DISPLAY=:0 npm start

View File

@@ -0,0 +1,7 @@
{
apps : [{
name : "MagicMirror",
script : "/home/pi/MagicMirror/installer/mm.sh",
watch : ["/home/pi/MagicMirror/config/config.js"]
}]
}

View File

@@ -141,6 +141,12 @@ else
echo -e "\e[93mplymouth is not installed.\e[0m";
fi
# Use pm2 control like a service MagicMirror
sudo npm install -g pm2
sudo su -c "env PATH=$PATH:/usr/bin pm2 startup linux -u pi --hp /home/pi"
pm2 start ~/MagicMirror/installers/pm2_MagicMirror.json
pm2 save
echo " "
echo -e "\e[92mWe're ready! Run \e[1m\e[97mDISPLAY=:0 npm start\e[0m\e[92m from the ~/MagicMirror directory to start your MagicMirror.\e[0m"
echo " "