Improve on last commit

Use runit custom control scripts to end child processes
This commit is contained in:
Keith Whyte 2021-02-24 06:33:04 +01:00
parent 93e5fa8956
commit 03536a69c9
3 changed files with 4 additions and 8 deletions

View file

@ -0,0 +1,3 @@
#!/bin/bash
pkill -P `cat /etc/sv/meas-json/supervise/pid`
exit 0

View file

@ -1,10 +1,6 @@
#!/bin/bash #!/bin/bash
exec 2>&1 exec 2>&1
if [ -a /tmp/json_socket ]; then if [ -a /tmp/json_socket ]; then
killall ncat
killall meas_json
rm -f /tmp/json_socket rm -f /tmp/json_socket
fi fi
exec chpst -P /bin/sh -c '/usr/bin/stdbuf -oL /usr/bin/meas_json | ncat -l -U /tmp/json_socket -k --send-only'
exec /etc/sv/meas-json/scr | ncat -l -U /tmp/json_socket -k --send-only

View file

@ -1,3 +0,0 @@
#!/bin/sh
exec 2>&1
exec /usr/bin/stdbuf -oL /usr/bin/meas_json