Includes systemd startup

This commit is contained in:
Jarli01 2016-03-08 15:38:21 -05:00
parent b7d96468ba
commit e0af0bf2cc

View File

@ -17,5 +17,23 @@ cd /opt/xo-web
sudo npm i lodash.trim@3.0.1 sudo npm i lodash.trim@3.0.1
sudo npm install sudo npm install
sudo npm run build sudo npm run build
cd /opt/xo-server cat > /etc/systemd/system/xo-server.service <<EOF
sudo npm start # systemd service for XO-Server.
[Unit]
Description= XO Server
After=network-online.target
[Service]
WorkingDirectory=/opt/xo-server/
ExecStart=/usr/local/bin/node ./bin/xo-server
Restart=always
SyslogIdentifier=xo-server
[Install]
WantedBy=multi-user.target
EOF
sudo chmod +x /etc/systemd/system/xo-server.service
sudo systemctl enable xo-server.service
sudo systemctl start xo-server.service