Bob Mottram 11 anni fa
parent
commit
8b953d76d5
1 ha cambiato i file con 74 aggiunte e 4 eliminazioni
  1. 74
    4
      beaglebone.txt

+ 74
- 4
beaglebone.txt Vedi File

5502
 a2enmod disk_cache
5502
 a2enmod disk_cache
5503
 apachectl configtest
5503
 apachectl configtest
5504
 service apache2 restart
5504
 service apache2 restart
5505
+npm install forever -g
5505
 #+END_SRC
5506
 #+END_SRC
5506
 
5507
 
5507
-Now you can run the pump.io server:
5508
+Now create the daemon.
5508
 
5509
 
5509
 #+BEGIN_SRC: bash
5510
 #+BEGIN_SRC: bash
5510
-npm install forever -g
5511
-su - pumpio -c 'cd /opt/pump.io && forever ./bin/pump &'
5511
+emacs /etc/init.d/pumpio
5512
+#+END_SRC
5513
+
5514
+Add the following text:
5515
+
5516
+#+BEGIN_SRC: bash
5517
+#!/bin/bash
5518
+# /etc/init.d/pumpio
5519
+
5520
+### BEGIN INIT INFO
5521
+# Provides:          pump.io
5522
+# Required-Start:    $remote_fs $syslog
5523
+# Required-Stop:     $remote_fs $syslog
5524
+# Default-Start:     2 3 4 5
5525
+# Default-Stop:      0 1 6
5526
+# Short-Description: starts pump.io as a background daemon
5527
+# Description:       Starts pump.io on boot
5528
+### END INIT INFO
5529
+
5530
+# Author: Bob Mottram <bob@robotics.uk.to>
5531
+
5532
+#Settings
5533
+SERVICE='pumpio'
5534
+COMMAND="forever /opt/pump.io/bin/pump > /var/local/pump.io/daemon.log"
5535
+USERNAME='pumpio'
5536
+NICELEVEL=19 # from 0-19 the bigger the number, the less the impact on system resources
5537
+HISTORY=1024
5538
+INVOCATION="nice -n ${NICELEVEL} ${COMMAND}"
5539
+PATH='/usr/local/sbin:/usr/local/bin:/usr/bin:/sbin:/usr/sbin:/bin:/var/local/pump.io'
5540
+
5541
+
5542
+pumpio_start() {
5543
+echo "Starting $SERVICE..."
5544
+su --command "screen -h ${HISTORY} -dmS ${SERVICE} ${INVOCATION}" $USERNAME
5545
+}
5546
+
5547
+
5548
+pumpio_stop() {
5549
+echo "Stopping $SERVICE"
5550
+su --command "screen -p 0 -S ${SERVICE} -X stuff "'^C'"" $USERNAME
5551
+}
5552
+
5553
+
5554
+#Start-Stop here
5555
+case "$1" in
5556
+  start)
5557
+    pumpio_start
5558
+    ;;
5559
+  stop)
5560
+    pumpio_stop
5561
+    ;;
5562
+  restart)
5563
+    pumpio_stop
5564
+    sleep 10s
5565
+    pumpio_start
5566
+    ;;
5567
+    *)
5568
+  echo "Usage: $0 {start|stop|restart}"
5569
+  exit 1
5570
+  ;;
5571
+esac
5572
+
5573
+exit 0
5574
+#+END_SRC
5575
+
5576
+Save and exit. Then enable the daemon and run it.
5577
+
5578
+#+BEGIN_SRC: bash
5579
+chmod +x /etc/init.d/pumpio
5580
+update-rc.d pumpio defaults
5581
+service pumpio start
5512
 #+END_SRC
5582
 #+END_SRC
5513
 
5583
 
5514
 Now visit your pump.io site by navigating to:
5584
 Now visit your pump.io site by navigating to:
5515
 
5585
 
5516
 https://mypumpiodomainname.com
5586
 https://mypumpiodomainname.com
5517
 
5587
 
5518
-and adding a new user.  If you wish this to be a single user node not open to the general public (including spammers and sockpuppets) then edit */etc/pump.io.json* and set *disableRegistration* to *true*.  After making that change reboot the BBB by typing "reboot".
5588
+and adding a new user.  If you wish this to be a single user node not open to the general public (including spammers and sockpuppets) then edit */etc/pump.io.json* and set *disableRegistration* to *true*.  After making that change restart with the command *service pumpio restart*.
5519
 
5589
 
5520
 ** Install Tripwire
5590
 ** Install Tripwire
5521
 
5591