Them tmux, run server.js trong rc.local
This commit is contained in:
parent
7bf828f0d2
commit
53a9e5553b
|
@ -9,11 +9,46 @@ sudo chmod +x /root/monitor/setup/install_S905X_BI.sh
|
||||||
sudo chmod +x /root/monitor/setup/capture.sh
|
sudo chmod +x /root/monitor/setup/capture.sh
|
||||||
sudo chmod +x /root/monitor/setup/key.sh
|
sudo chmod +x /root/monitor/setup/key.sh
|
||||||
sudo chmod +x /root/monitor/setup/serverlite.sh
|
sudo chmod +x /root/monitor/setup/serverlite.sh
|
||||||
|
sudo apt install -y tmux
|
||||||
|
#****************rc.local*************
|
||||||
|
echo "setup rc.local"
|
||||||
|
echo '#!/bin/sh -e
|
||||||
|
#
|
||||||
|
# rc.local
|
||||||
|
#
|
||||||
|
# This script is executed at the end of each multiuser runlevel.
|
||||||
|
# Make sure that the script will "" on success or any other
|
||||||
|
# value on error.
|
||||||
|
#
|
||||||
|
# In order to enable or disable this script just change the execution
|
||||||
|
# bits.
|
||||||
|
#
|
||||||
|
# By default this script does nothing.
|
||||||
|
|
||||||
|
|
||||||
|
#/boot/fan.sh &
|
||||||
|
|
||||||
|
if [ ! -d /var/run/sshd ]; then
|
||||||
|
mkdir /var/run/sshd
|
||||||
|
chmod 0755 /var/run/sshd
|
||||||
|
systemctl restart ssh
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Begin rc.local. Time restart: $time_begin" >> /root/monitor/log/rc_local.log
|
||||||
|
|
||||||
|
echo "nameserver 8.8.8.8" > /etc/resolv.conf
|
||||||
|
|
||||||
|
tmux new -d -s server_js 'node /root/BiFace_Server_Config_API/server.js'
|
||||||
|
|
||||||
|
exit 0' > /etc/rc.local
|
||||||
|
|
||||||
|
#
|
||||||
sudo apt -y update
|
sudo apt -y update
|
||||||
sudo apt-get install -y apache2
|
sudo apt-get install -y apache2
|
||||||
cd /var/www
|
cd /var/www
|
||||||
sudo chmod -R 0777 html
|
sudo chmod -R 0777 html
|
||||||
cd html
|
cd html
|
||||||
|
sudo rm -rf BiFace_Server_Lite
|
||||||
git clone http://gitea.beetai.com/dongpd/BiFace_Server_Lite.git
|
git clone http://gitea.beetai.com/dongpd/BiFace_Server_Lite.git
|
||||||
sudo chmod -R 0777 BiFace_Server_Lite
|
sudo chmod -R 0777 BiFace_Server_Lite
|
||||||
sudo apt-get install -y libapache2-mod-php php php-common php-curl php-dev php-gd php-pear php-imagick php-mysql php-xsl php-sqlite3 php-zip
|
sudo apt-get install -y libapache2-mod-php php php-common php-curl php-dev php-gd php-pear php-imagick php-mysql php-xsl php-sqlite3 php-zip
|
||||||
|
@ -60,11 +95,12 @@ sudo service apache2 restart
|
||||||
sudo echo "* * * * * php /var/www/html/BiFace_Server_Lite/yii sync" >> /var/spool/cron/crontabs/root
|
sudo echo "* * * * * php /var/www/html/BiFace_Server_Lite/yii sync" >> /var/spool/cron/crontabs/root
|
||||||
#
|
#
|
||||||
cd /root
|
cd /root
|
||||||
|
sudo rm -rf BiFace_Server_Config_API
|
||||||
git clone http://gitea.beetai.com/dongpd/BiFace_Server_Config_API.git
|
git clone http://gitea.beetai.com/dongpd/BiFace_Server_Config_API.git
|
||||||
sudo apt-get install -y nodejs npm
|
sudo apt-get install -y nodejs npm
|
||||||
sudo apt-get install -y nodejs-dev node-gyp libssl1.0-dev
|
sudo apt-get install -y nodejs-dev node-gyp libssl1.0-dev
|
||||||
sudo apt install -y npm
|
sudo apt install -y npm
|
||||||
cd BiFace_Server_Config_API
|
cd BiFace_Server_Config_API
|
||||||
npm install
|
npm install
|
||||||
|
sudo bash /etc/rc.local
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -74,6 +74,7 @@ echo -e "#IP#\n\n###" >> /etc/network/interfaces
|
||||||
#*************setup service S905X_BI***************
|
#*************setup service S905X_BI***************
|
||||||
echo "setup autorun S905X_BI"
|
echo "setup autorun S905X_BI"
|
||||||
cd /etc/systemd/system/
|
cd /etc/systemd/system/
|
||||||
|
sudo rm S905X_BI.service
|
||||||
echo "[Unit]
|
echo "[Unit]
|
||||||
Description=S905X_BI demo service
|
Description=S905X_BI demo service
|
||||||
After=network.target
|
After=network.target
|
||||||
|
|
Loading…
Reference in New Issue
Block a user