Browse Source

Added config file for Systemd and added setup instructions to README.md

Tom Flucke 10 years ago
parent
commit
a15aad28d9
2 changed files with 30 additions and 1 deletions
  1. 19 1
      README.md
  2. 11 0
      chatRoom.service

+ 19 - 1
README.md

@@ -1,5 +1,23 @@
+Using Systemd
 Setup:
 npm install socket.io
+mkdir -vp ~/.config/systemd/user
+cp -v chatRoom.service ~/.config/systemd/user
+systemctl --user daemon-reload
 
 Run:
-node main.js
+systemctl --user start chatRoom
+
+Stop:
+systemctl --user stop chatRoom
+
+
+Manual
+Setup:
+npm install socket.io
+
+Run:
+node main.js &
+
+Stop:
+kill [pid]

+ 11 - 0
chatRoom.service

@@ -0,0 +1,11 @@
+[Unit]
+Description=Chat Room Page
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/node main.js
+Environment=PATH=/usr/bin:/usr/local/bin
+WorkingDirectory=/home/tflucke/public_nodejs/chatRoom/
+
+[Install]
+WantedBy=multi-user.target