Meas: separate the meas_json task
This allows more than one client to open the web meas
This commit is contained in:
parent
dc28f03a7c
commit
bca9ccae5d
4 changed files with 21 additions and 2 deletions
4
modules/rhizo_base/files/etc/sv/meas-json/log/run
Executable file
4
modules/rhizo_base/files/etc/sv/meas-json/log/run
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
|
LOG_FOLDER=/var/log/meas-json
|
||||||
|
mkdir -p $LOG_FOLDER
|
||||||
|
exec svlogd -tt $LOG_FOLDER
|
4
modules/rhizo_base/files/etc/sv/meas-json/run
Executable file
4
modules/rhizo_base/files/etc/sv/meas-json/run
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/bash
|
||||||
|
exec 2>&1
|
||||||
|
|
||||||
|
exec /usr/bin/stdbuf -oL /usr/bin/meas_json > /tmp/json_pipe
|
|
@ -1,3 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
exec 2>&1
|
exec 2>&1
|
||||||
exec /usr/bin/websocketd --staticdir=/var/www/meas --port=8080 /usr/bin/stdbuf -oL /usr/bin/meas_json
|
|
||||||
|
if [ ! -p /tmp/json_pipe ] ; then
|
||||||
|
mkfifo /tmp/json_pipe
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec /usr/bin/websocketd --staticdir=/var/www/meas --port=8080 cat /tmp/json_pipe
|
||||||
|
|
|
@ -77,4 +77,10 @@ class rhizo_base::runit {
|
||||||
require => [ File['/etc/sv'], Package['websocketd'] ],
|
require => [ File['/etc/sv'], Package['websocketd'] ],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
file { '/etc/service/meas-json':
|
||||||
|
ensure => link,
|
||||||
|
target => '/etc/sv/meas-json',
|
||||||
|
require => [ File['/etc/sv'] ],
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue