From 0880cd3128b3a2c130d553f0fc4c6868f3570f89 Mon Sep 17 00:00:00 2001 From: folex <0xdxdy@gmail.com> Date: Thu, 24 Jun 2021 20:00:55 +0300 Subject: [PATCH] Handle SIGTERM (#3) --- .vscode/settings.json | 3 ++- s6/root/etc/cont-init.d/20-config | 1 - s6/root/etc/services.d/ipfs/log/run | 5 ++--- s6/root/etc/services.d/ipfs/run | 11 +++++------ 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 0c5de1a..d943c87 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,7 +3,8 @@ "editor.quickSuggestions": { "strings": true }, - "editor.formatOnSave": false + "editor.formatOnSave": false, + "editor.formatOnPaste": false }, "shellformat.effectLanguages": [ "shellscript", diff --git a/s6/root/etc/cont-init.d/20-config b/s6/root/etc/cont-init.d/20-config index 993996b..8a4b0e3 100644 --- a/s6/root/etc/cont-init.d/20-config +++ b/s6/root/etc/cont-init.d/20-config @@ -28,4 +28,3 @@ mkdir -p \ # permissions chown -R abc:abc /config -chmod -R 644 /etc/logrotate.d diff --git a/s6/root/etc/services.d/ipfs/log/run b/s6/root/etc/services.d/ipfs/log/run index 5366009..ca7d307 100644 --- a/s6/root/etc/services.d/ipfs/log/run +++ b/s6/root/etc/services.d/ipfs/log/run @@ -1,4 +1,4 @@ -#!/usr/bin/with-contenv bash +#!/bin/execlineb -P # s6-setuidgid abc - run as a user abc (unprivileged) @@ -7,5 +7,4 @@ # S30000000 - keep only 30 MB of rotated (and compressed) logs # T - prepend timestamp to each line # !"gzip -nq9" - compresses logs on rotation -exec \ - s6-setuidgid abc s6-log n30 s10000000 S30000000 T !"gzip -nq9" /config/log/ipfs +s6-setuidgid abc s6-log n30 s10000000 S30000000 T !"gzip -nq9" /config/log/ipfs diff --git a/s6/root/etc/services.d/ipfs/run b/s6/root/etc/services.d/ipfs/run index 2c87ddd..1fa34c8 100644 --- a/s6/root/etc/services.d/ipfs/run +++ b/s6/root/etc/services.d/ipfs/run @@ -1,7 +1,6 @@ -#!/usr/bin/with-contenv bash +#!/bin/execlineb -P -exec \ - # seems like IPFS logs most logs to stderr, so - # map stderr to stdout so s6-log can catch it - fdmove -c 2 1 \ - s6-setuidgid abc ipfs daemon +# seems like IPFS logs most logs to stderr, so +# map stderr to stdout so s6-log can catch it +fdmove -c 2 1 +s6-setuidgid abc ipfs daemon