Compare commits

...

15 commits

Author SHA1 Message Date
f
39127b267d send prometheus logs to syslog
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-07-09 23:21:26 -03:00
f
c7615afb9a correctly remove prometheus temp/lock file 2022-07-09 23:21:11 -03:00
f
b47c31e546 Merge branch 'antifascista' of ssh://gitea.nulo.in:420/Sutty/containers-ruby into antifascista 2022-07-09 23:19:10 -03:00
f
1a7d31ba15 alpine 3.16 2022-07-09 23:19:03 -03:00
f
a5073d2630 prometheus listens on ipv6 too 2022-07-09 23:18:51 -03:00
f
736b0fa016 Merge branch 'antifascista' of https://gitea.nulo.in/Sutty/containers-monit into antifascista 2022-07-09 23:18:09 -03:00
f
08209d764d alpine 3.16 2022-07-09 23:17:04 -03:00
e2894c0aae Merge pull request 'syslogize' (#1) from syslogize into antifascista
Reviewed-on: Sutty/containers-monit#1
2022-06-05 20:14:47 -03:00
f
75df2530e3 tag with the program name by default 2022-06-04 17:40:00 -03:00
f
af44e95be9 propagate signals
send signals received by syslogize to the wrapped program.  this way we
can treat syslogize as we treated the program itself.
2022-06-04 17:38:44 -03:00
f
94583cdcca add to container 2022-06-04 16:53:38 -03:00
f
9f2673b4e1 daemonize requires the full path 2022-06-04 16:53:04 -03:00
f
e38f6a1fe6 syslogize
a wrapper for sending output to syslog when the program doesn't support
it.  if adds syslogging support to daemonize as well.
2022-06-04 16:48:38 -03:00
f
5d2ad04336 Merge branch 'antifascista' of ssh://gitea.nulo.in:420/Sutty/containers-skel into antifascista 2022-05-29 21:05:42 -03:00
f
c90ba65374 alpine 3.16 2022-05-29 21:05:05 -03:00
4 changed files with 40 additions and 4 deletions

View file

@ -30,3 +30,6 @@ matrix:
- ALPINE_VERSION: 3.15.4
RUBY_VERSION: 3.0
RUBY_PATCH: 4
- ALPINE_VERSION: 3.16.0
RUBY_VERSION: 3.1
RUBY_PATCH: 2

View file

@ -5,4 +5,4 @@ blazer_5m: bundle exec rake blazer:run_checks SCHEDULE="5 minutes"
blazer_1h: bundle exec rake blazer:run_checks SCHEDULE="1 hour"
blazer_1d: bundle exec rake blazer:run_checks SCHEDULE="1 day"
blazer: bundle exec rake blazer:send_failing_checks
prometheus: bundle exec prometheus_exporter -b 0.0.0.0 --prefix "lunar_"
prometheus: bundle exec prometheus_exporter -b ::

View file

@ -18,17 +18,17 @@ case $1 in
;;
prometheus)
rm -f /tmp/prometheus.pid
daemonize -c /srv \
-p /tmp/prometheus.pid \
-l /tmp/prometheus.pid \
-u rails \
/usr/local/bin/syslogize \
/usr/bin/foreman start -f /etc/Procfile -d /srv prometheus
;;
prometheus-stop)
cat /tmp/prometheus.pid | xargs -r kill
test ! -f /tmp/prometheus.pid || cat /tmp/prometheus.pid | xargs -r kill
rm -f /tmp/prometheus.pid
;;

33
syslogize.sh Executable file
View file

@ -0,0 +1,33 @@
#!/bin/sh
# A wrapper for programs that can't write to syslog. Output and error
# are sent to syslog.
#
# Use LOGGER environment variable to pass options to `logger`. They'll
# probably be system-dependent, so handle with care.
#
# Usage:
#
# LOGGER="-t program" syslogize program -o -p --tions argu ments
#
# daemonize /usr/local/bin/syslogize program
if test $# -eq 0 ; then
grep "^#" $0 | grep -v /bin/sh | sed -re "s/^#\s*//" >&2
exit 1
fi
LOGGER="${LOGGER:--t $1}"
propagate_signal () {
logger ${LOGGER} "Received $1 signal"
jobs -p | xargs kill -$1
}
for signal in HUP INT QUIT USR1 USR2 TERM; do
trap "propagate_signal ${signal}" ${signal}
done
$@ 2>&1 | logger ${LOGGER} &
wait $!