Skip to content

Commit 4ecedc3

Browse files
authored
Merge pull request #85 from thin-edge/fix-s6-shutdown
fix(s6-overlay): shutdown of service when run as root
2 parents 1150fc4 + 08f77ad commit 4ecedc3

File tree

1 file changed

+7
-0
lines changed
  • packaging/services/s6-overlay/tedge-container-plugin

1 file changed

+7
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/command/with-contenv sh
2+
PROC_PID=$(pgrep -f "/usr/bin/tedge-container run" ||:)
3+
if [ -n "$PROC_PID" ]; then
4+
echo "sending SIGTERM to pid=$PROC_PID"
5+
sudo kill -15 "$PROC_PID" || echo "Failed to stop tedge-container service"
6+
fi
7+
exit 0

0 commit comments

Comments
 (0)