-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
restructure logging, bugfix and fix datalogger service
- Loading branch information
Bram van Dartel
committed
Apr 18, 2024
1 parent
f3e0476
commit 7c8a90e
Showing
31 changed files
with
78 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/execlineb -P | ||
# /etc/s6-overlay/s6-rc.d/sig-handler/run | ||
# shellcheck shell=bash | ||
|
||
# Trap SIGINT and gracefully shutdown | ||
foreground { | ||
s6-trap-init SIGINT | ||
} | ||
importas -u SIGINT SIGINT | ||
s6-svscanctl -t /var/run/s6/services |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
longrun |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/etc/s6-overlay/s6-rc.d/sig-handler/run |
1 change: 1 addition & 0 deletions
1
rootfs/etc/s6-overlay/s6-rc.d/svc-dsmr-backend-log/dependencies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
svc-dsmr-backend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/execlineb -P | ||
# /etc/s6-overlay/s6-rc.d/dsmr_backend-log/run | ||
# shellcheck shell=bash | ||
|
||
s6-log -bp -- /var/log/dsmr_backend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
longrun |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/etc/s6-overlay/s6-rc.d/svc-dsmr-backend-log/run |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
#!/command/with-contenv bash | ||
#!/bin/execlineb -P | ||
# /etc/s6-overlay/s6-rc.d/dsmr_backend/run | ||
# shellcheck shell=bash | ||
|
||
with-contenv | ||
|
||
if [[ "${DSMRREADER_OPERATION_MODE}" = standalone || "${DSMRREADER_OPERATION_MODE}" = api_server ]]; then | ||
echo "Starting DSMR Reader - backend..." | ||
cd /app || exit | ||
exec s6-setuidgid app /usr/local/bin/python3 -u /app/manage.py dsmr_backend | ||
nice -n 10 | ||
s6-setuidgid app | ||
/usr/local/bin/python3 -u /dsmr/manage.py dsmr_backend | ||
else | ||
sleep infinity | ||
fi | ||
fi |
1 change: 1 addition & 0 deletions
1
rootfs/etc/s6-overlay/s6-rc.d/svc-dsmr-datalogger-log/dependencies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
svc-dsmr-datalogger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/execlineb -P | ||
# /etc/s6-overlay/s6-rc.d/dsmr_datalogger-log/run | ||
# shellcheck shell=bash | ||
|
||
s6-log -bp -- /var/log/dsmr_datalogger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
longrun |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/etc/s6-overlay/s6-rc.d/svc-dsmr-datalogger-log/run |
Empty file modified
0
rootfs/etc/s6-overlay/s6-rc.d/svc-dsmr-datalogger/dependencies
100644 → 100755
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
#!/command/with-contenv bash | ||
#!/bin/execlineb -P | ||
# /etc/s6-overlay/s6-rc.d/dsmr_datalogger/run | ||
# shellcheck shell=bash | ||
|
||
with-contenv | ||
|
||
if [[ "${DSMRREADER_OPERATION_MODE}" = standalone ]]; then | ||
echo "Starting DSMR Reader - datalogger..." | ||
cd /app || exit | ||
exec s6-setuidgid app /usr/local/bin/python3 -u /app/manage.py dsmr_datalogger | ||
nice -n 5 | ||
s6-setuidgid app | ||
/usr/local/bin/python3 -u /dsmr/manage.py dsmr_datalogger | ||
else | ||
sleep infinity | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
oneshot | ||
longrun |
Empty file modified
0
rootfs/etc/s6-overlay/s6-rc.d/svc-dsmr-remote-datalogger/dependencies
100644 → 100755
Empty file.
11 changes: 8 additions & 3 deletions
11
rootfs/etc/s6-overlay/s6-rc.d/svc-dsmr-remote-datalogger/run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
#!/command/with-contenv bash | ||
#!/bin/execlineb -P | ||
# /etc/s6-overlay/s6-rc.d/dsmr_client_datalogger/run | ||
# shellcheck shell=bash | ||
|
||
with-contenv | ||
|
||
if [[ "${DSMRREADER_OPERATION_MODE}" = api_client ]]; then | ||
echo "Starting DSMR Reader - remote datalogger (api_client)..." | ||
cd /app || exit | ||
exec s6-setuidgid app /usr/local/bin/python3 -u /app/dsmr_datalogger_api_client.py | ||
nice -n 5 | ||
s6-setuidgid app | ||
/usr/local/bin/python3 -u /dsmr/dsmr_datalogger/scripts/dsmr_datalogger_api_client.py | ||
else | ||
sleep infinity | ||
fi | ||
fi |
1 change: 1 addition & 0 deletions
1
rootfs/etc/s6-overlay/s6-rc.d/svc-dsmr-webinterface-log/dependencies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
svc-dsmr-datalogger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/execlineb -P | ||
# /etc/s6-overlay/s6-rc.d/dsmr_webinterface-log/run | ||
# shellcheck shell=bash | ||
|
||
s6-log -bp -- /var/log/dsmr_webinterface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
longrun |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/etc/s6-overlay/s6-rc.d/svc-dsmr-webinterface-log/run |
Empty file modified
0
rootfs/etc/s6-overlay/s6-rc.d/svc-dsmr-webinterface/dependencies
100644 → 100755
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
#!/command/with-contenv bash | ||
#!/bin/execlineb -P | ||
# /etc/s6-overlay/s6-rc.d/dsmr_webinterface/run | ||
# shellcheck shell=bash | ||
|
||
with-contenv | ||
|
||
if [[ "${DSMRREADER_OPERATION_MODE}" = standalone || "${DSMRREADER_OPERATION_MODE}" = api_server ]]; then | ||
echo "Starting DSMR Reader - webinterface..." | ||
cd /app || exit | ||
exec s6-setuidgid app /usr/local/bin/gunicorn dsmrreader.wsgi --timeout 60 --max-requests 500 --bind unix:/tmp/gunicorn--dsmr_webinterface.socket | ||
nice -n 15 | ||
s6-setuidgid app | ||
/usr/local/bin/gunicorn dsmrreader.wsgi --timeout 60 --max-requests 500 --bind unix:/tmp/gunicorn--dsmr_webinterface.socket | ||
else | ||
sleep infinity | ||
fi |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
#!/command/with-contenv bash | ||
#!/bin/execlineb -P | ||
# /etc/s6-overlay/s6-rc.d/nginx/run | ||
# shellcheck shell=bash | ||
|
||
with-contenv | ||
|
||
if [[ "${DSMRREADER_OPERATION_MODE}" = standalone || "${DSMRREADER_OPERATION_MODE}" = api_server ]]; then | ||
echo "Starting DSMR Reader - nginx..." | ||
cd /app || exit | ||
exec /usr/sbin/nginx -g "daemon off;" | ||
s6-setuidgid app | ||
/usr/sbin/nginx -g 'daemon off;' | ||
else | ||
sleep infinity | ||
fi |
Empty file.
Empty file.
Empty file.
Empty file.