Installation for Pis

This commit is contained in:
Ruben van de Ven 2019-03-29 16:20:23 +01:00
parent 15a3ddc5dd
commit 357008c377
4 changed files with 88 additions and 0 deletions

View file

@ -69,8 +69,28 @@ git submodule init
git sumodule update git sumodule update
``` ```
### clients
```
apt install supervisor
```
Add the following to the first section of `/etc/supervisor/supervisord.conf`
```
chown=pi:pi
```
## Deploy / usefull commands ## Deploy / usefull commands
```bash ```bash
for i in {1..6}; do rsync -av ~/hugvey/ pi@hugvey$i.local:/home/pi/hugvey/ --exclude=www --exclude=venv --exclude=local --exclude=*.pyc --exclude=.git; done for i in {1..6}; do rsync -av ~/hugvey/ pi@hugvey$i.local:/home/pi/hugvey/ --exclude=www --exclude=venv --exclude=local --exclude=*.pyc --exclude=.git; done
``` ```
```bash
for i in {1..6}; do ssh pi@hugvey$i.local "sudo shutdown -h now"; done
```

16
install_server.sh Normal file
View file

@ -0,0 +1,16 @@
sudo apt install munin-node
sudo cp installation/rpi-internal-temp /usr/share/munin/plugins
sudo ln -sf /usr/share/munin/plugins/rpi-internal-temp /etc/munin/plugins/rpi-internal-temp
sudo chmod a+x /usr/share/munin/plugins/rpi-internal-temp
sudo echo "allow ^192\\.168\\.0\\.155\$" >> /etc/munin/munin-node.conf
sudo service munin-node restart
sudo apt install supervisor
# Added chown=pi:pi
sudo cp installation/supervisord.conf /etc/supervisor/supervisord.conf
sudo ln -s /home/pi/hugvey/supervisor.conf /etc/supervisor/conf.d/hugvey.conf
sudo service supervisord restart
sudo supervisorctl reread
sudo supervisorctl update

View file

@ -0,0 +1,22 @@
#!/bin/bash
# A basic munin-node script to monitor the Raspberry Pi temperature
if [ "$1" == "autoconf" ]; then
if [ -e /sys/class/thermal/thermal_zone0/temp ]; then
echo "yes"
else
echo "no"
exit 1
fi
elif [ "$1" == "config" ]; then
echo "graph_title Raspberry Pi Temperature"
echo "graph_vlabel Temperature in Celsius"
echo "graph_category Sensors"
echo "temp.warning 60"
echo "temp.critical 80"
echo "temp.label CPU"
else
temp=$(cat /sys/class/thermal/thermal_zone0/temp)
awk "BEGIN { print \"temp.value \" $temp/1000 }"
fi

View file

@ -0,0 +1,30 @@
; supervisor config file
[unix_http_server]
file=/var/run/supervisor.sock ; (the path to the socket file)
chmod=0700 ; sockef file mode (default 0700)
chown=pi:pi
[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP)
; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket
; The [include] section can just contain the "files" setting. This
; setting can list multiple files (separated by whitespace or
; newlines). It can also contain wildcards. The filenames are
; interpreted as relative to this file. Included files *cannot*
; include files themselves.
[include]
files = /etc/supervisor/conf.d/*.conf