wait for dovecot
This commit is contained in:
parent
1d5e24f541
commit
96a1815b6a
|
|
@ -1,12 +1,10 @@
|
|||
[program:sieve-sync]
|
||||
command=/usr/bin/python3 /scripts/sync.py
|
||||
# Wichtig: stdout_logfile schickt die Logs an den Docker Log Stream
|
||||
# Damit sehen Sie die Logs via "docker logs <container>"
|
||||
# Das "-u" ist entscheidend für sofortige Logs!
|
||||
command=/usr/bin/python3 -u /scripts/sync.py
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
autostart=true
|
||||
autorestart=true
|
||||
startsecs=5
|
||||
# Hier werden die ENV Vars des Containers automatisch an das Script vererbt!
|
||||
startsecs=5
|
||||
|
|
@ -108,7 +108,23 @@ def sync():
|
|||
|
||||
print(f'✓ {email}')
|
||||
|
||||
def wait_for_dovecot():
|
||||
"""Wartet, bis der Dovecot Auth Socket verfügbar ist."""
|
||||
# Der Pfad zum Socket, über den doveadm kommuniziert
|
||||
socket_path = '/var/run/dovecot/auth-userdb'
|
||||
|
||||
print("⏳ Warte auf Dovecot Start...")
|
||||
while not os.path.exists(socket_path):
|
||||
print(f" ... Socket {socket_path} noch nicht da. Schlafe 5s.")
|
||||
time.sleep(5)
|
||||
|
||||
print("✅ Dovecot ist bereit!")
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
# 1. Erst warten, bis Dovecot da ist, sonst hagelt es Fehler beim Start
|
||||
wait_for_dovecot()
|
||||
|
||||
# Pfad zur Cron-Definition (nur der String, z.B. "*/5 * * * *")
|
||||
CRON_FILE = '/etc/sieve-schedule'
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue