Browse Source

updates

master
Andrey Arapov 1 year ago
parent
commit
448ebf7cf1
Signed by: arno <andrey.arapov@nixaid.com> GPG Key ID: 9076D5E6B31AE99C
9 changed files with 35 additions and 10 deletions
  1. +5
    -3
      Dockerfile
  2. +4
    -0
      service-disabled/rsyslogd/finish
  3. +0
    -0
      service-disabled/rsyslogd/log/run
  4. +3
    -0
      service-disabled/rsyslogd/run
  5. +4
    -0
      service/logger/finish
  6. +10
    -0
      service/logger/run
  7. +2
    -1
      service/postfix/finish
  8. +7
    -3
      service/postfix/run
  9. +0
    -3
      service/rsyslogd/finish

+ 5
- 3
Dockerfile View File

@@ -3,10 +3,12 @@ MAINTAINER Andrey Arapov <andrey.arapov@nixaid.com>

RUN apk update && \
apk upgrade && \
apk add tzdata rsyslog postfix runit ca-certificates
apk add postfix runit socklog tzdata ca-certificates && \
rm -rf /etc/service

# tzdata - for passing TZ environment variable.
# rsyslog - to log postfix service into /var/log/maillog file.
# socklog - collect all logs which come to /dev/log.

COPY service /etc/service/
COPY service /etc/service
ENTRYPOINT runsvdir -P /etc/service
#ENTRYPOINT chpst -Unobody socklog unix /dev/log & postfix start-fg

+ 4
- 0
service-disabled/rsyslogd/finish View File

@@ -0,0 +1,4 @@
#!/bin/sh

echo "${PWD##*/}: Exitted with $1 (signal: $2)"
[ $1 -ne 0 ] && ( echo "${PWD##*/}: rc != 0, sleeping for 5 seconds ..."; sleep 5 )

service/rsyslogd/log/run → service-disabled/rsyslogd/log/run View File


service/rsyslogd/run → service-disabled/rsyslogd/run View File

@@ -1,3 +1,6 @@
#!/bin/sh

echo "${PWD##*/}: started."

touch /var/log/maillog
exec /usr/sbin/rsyslogd -n 2>&1

+ 4
- 0
service/logger/finish View File

@@ -0,0 +1,4 @@
#!/bin/sh

echo "${PWD##*/}: Exitted with $1 (signal: $2)"
[ $1 -ne 0 ] && ( echo "${PWD##*/}: rc != 0, sleeping for 5 seconds ..."; sleep 5 )

+ 10
- 0
service/logger/run View File

@@ -0,0 +1,10 @@
#!/bin/sh
# Collect all logs which come to /dev/log
exec 2>&1

echo "${PWD##*/}: started."

set -x
exec chpst -Unobody socklog unix /dev/log
# exec socklog unix /dev/log
# exec socat UNIX-LISTEN:/dev/log,reuseaddr,fork -

+ 2
- 1
service/postfix/finish View File

@@ -1,3 +1,4 @@
#!/bin/sh

[ $1 -ne 0 ] && ( echo "${PWD##*/}: Exitted with $1 (signal: $2)"; sleep 5 )
echo "${PWD##*/}: Exitted with $1 (signal: $2)"
[ $1 -ne 0 ] && ( echo "${PWD##*/}: rc != 0, sleeping for 5 seconds ..."; sleep 5 )

+ 7
- 3
service/postfix/run View File

@@ -1,5 +1,7 @@
#!/bin/sh

echo "${PWD##*/}: started."

# WORKAROUND:
# postfix has to be aware of the DNS servers
# without this workaround it uses 127.0.0.1:53 for some unknown (yet) reason...
@@ -13,6 +15,8 @@ set -e
postfix check 2>&1

# run Postfix
# exec /usr/lib/postfix/master 2>&1
# after postfix 3.3.0 use postfix start-fg command
exec postfix start-fg 2>&1
exec /usr/lib/postfix/master 2>&1

# Do not use 'postfix start-fg' command since it does not handle the signals,
# e.g. if you do 'sv restart postfix', postfix/master will NOT receive the
# SIGTERM signal.

+ 0
- 3
service/rsyslogd/finish View File

@@ -1,3 +0,0 @@
#!/bin/sh

[ $1 -ne 0 ] && ( echo "${PWD##*/}: Exitted with $1 (signal: $2)"; sleep 5 )

Loading…
Cancel
Save