Skip to content

Commit

Permalink
Merge pull request #48 from thin-edge/feat-remove-gnu-sed-dep
Browse files Browse the repository at this point in the history
feat(s6-overlay): use s6-format-filter for log formatting to avoid gnu sed dependency
  • Loading branch information
reubenmiller authored Sep 28, 2024
2 parents 75b051f + 5a1b9ea commit 0baeb76
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 19 deletions.
4 changes: 1 addition & 3 deletions images/s6-overlay/alpine-s6-overlay.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ RUN apk update \
ca-certificates \
mosquitto \
sudo \
curl \
# GNU sed (used in service definitions)
sed
curl

# Install s6-overlay
# Based on https://github.com/just-containers/s6-overlay#which-architecture-to-use-depending-on-your-targetarch
Expand Down
4 changes: 2 additions & 2 deletions services/s6-overlay/s6-rc.d/c8y-firmware-plugin-log/run
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
sed 's/^/\x1b[34mc8y-firmware-plugin |\x1b[0m /' --unbuffered
#!/command/execlineb -P
s6-format-filter "\033[34m%1 |\033[0m %s" c8y-firmware-plugin
4 changes: 2 additions & 2 deletions services/s6-overlay/s6-rc.d/mosquitto-log/run
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
sed 's/^/\x1b[34mmosquitto |\x1b[0m /' --unbuffered
#!/command/execlineb -P
s6-format-filter "\033[34m%1 |\033[0m %s" mosquitto
4 changes: 2 additions & 2 deletions services/s6-overlay/s6-rc.d/tedge-agent-log/run
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
sed 's/^/\x1b[34mtedge-agent |\x1b[0m /' --unbuffered
#!/command/execlineb -P
s6-format-filter "\033[34m%1 |\033[0m %s" tedge-agent
4 changes: 2 additions & 2 deletions services/s6-overlay/s6-rc.d/tedge-mapper-aws-log/run
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
sed 's/^/\x1b[34mtedge-mapper-aws |\x1b[0m /' --unbuffered
#!/command/execlineb -P
s6-format-filter "\033[34m%1 |\033[0m %s" tedge-mapper-aws
4 changes: 2 additions & 2 deletions services/s6-overlay/s6-rc.d/tedge-mapper-az-log/run
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
sed 's/^/\x1b[34mtedge-mapper-az |\x1b[0m /' --unbuffered
#!/command/execlineb -P
s6-format-filter "\033[34m%1 |\033[0m %s" tedge-mapper-az
4 changes: 2 additions & 2 deletions services/s6-overlay/s6-rc.d/tedge-mapper-c8y-log/run
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
sed 's/^/\x1b[34mtedge-mapper-c8y |\x1b[0m /' --unbuffered
#!/command/execlineb -P
s6-format-filter "\033[34m%1 |\033[0m %s" tedge-mapper-c8y
4 changes: 2 additions & 2 deletions services/s6-overlay/s6-rc.d/tedge-mapper-collectd-log/run
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
sed 's/^/\x1b[34mtedge-mapper-collectd |\x1b[0m /' --unbuffered
#!/command/execlineb -P
s6-format-filter "\033[34m%1 |\033[0m %s" tedge-mapper-collectd
4 changes: 2 additions & 2 deletions services/s6-overlay/templates/service-log/run
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
sed 's/^/\x1b[34m$LOG_NAME |\x1b[0m /' --unbuffered
#!/command/execlineb -P
s6-format-filter "\033[34m%1 |\033[0m %s" $LOG_NAME

0 comments on commit 0baeb76

Please sign in to comment.