Commit ce17c12c authored by Toilal's avatar Toilal Committed by Joshua Tauberer

Use netcat to check if mailinabox webservice is available

[JT added installing netcat-openbsd in system.sh]
parent 5edaeb8c
...@@ -42,8 +42,5 @@ EOF ...@@ -42,8 +42,5 @@ EOF
chmod +x /etc/cron.daily/mailinabox-statuschecks chmod +x /etc/cron.daily/mailinabox-statuschecks
# Start it. Remove the api key file first so that start.sh # Start it.
# can wait for it to be created to know that the management
# server is ready.
rm -f /var/lib/mailinabox/api.key
restart_service mailinabox restart_service mailinabox
...@@ -103,7 +103,8 @@ source setup/management.sh ...@@ -103,7 +103,8 @@ source setup/management.sh
source setup/munin.sh source setup/munin.sh
# Ping the management daemon to write the DNS and nginx configuration files. # Ping the management daemon to write the DNS and nginx configuration files.
while [ ! -f /var/lib/mailinabox/api.key ]; do until nc -z -w 4 localhost 10222
do
echo Waiting for the Mail-in-a-Box management daemon to start... echo Waiting for the Mail-in-a-Box management daemon to start...
sleep 2 sleep 2
done done
......
...@@ -36,13 +36,14 @@ apt_get_quiet upgrade ...@@ -36,13 +36,14 @@ apt_get_quiet upgrade
# * cron: Runs background processes periodically. # * cron: Runs background processes periodically.
# * ntp: keeps the system time correct # * ntp: keeps the system time correct
# * fail2ban: scans log files for repeated failed login attempts and blocks the remote IP at the firewall # * fail2ban: scans log files for repeated failed login attempts and blocks the remote IP at the firewall
# * netcat-openbsd: `nc` command line networking tool
# * git: we install some things directly from github # * git: we install some things directly from github
# * sudo: allows privileged users to execute commands as root without being root # * sudo: allows privileged users to execute commands as root without being root
# * coreutils: includes `nproc` tool to report number of processors # * coreutils: includes `nproc` tool to report number of processors
# * bc: allows us to do math to compute sane defaults # * bc: allows us to do math to compute sane defaults
apt_install python3 python3-dev python3-pip \ apt_install python3 python3-dev python3-pip \
wget curl git sudo coreutils bc \ netcat-openbsd wget curl git sudo coreutils bc \
haveged unattended-upgrades cron ntp fail2ban haveged unattended-upgrades cron ntp fail2ban
# Allow apt to install system updates automatically every day. # Allow apt to install system updates automatically every day.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment