From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1680076784; bh=epfi3FbC1G1TpIYCSDr32nIS53K+Rz548175VZfFpO8=; h=From:To:Cc:Subject:Date; b=ZLTTe6UZMC8q86U27z2QzP5rOPsBh16bWfPmDW1eJoLHANX1kGjahAnDDE381FX48 E0q8BRt/5XsZD7aCTQyf/9vkYgph2R1tEgIxTqol9AgQ4IkINtDkloEVOKOLzV05Hq 0/jSxSMz2dNBLOcDCd7NPtYDZK4UX+zHJSTih0h8aTOC7R+qXryY2huH90gpQaxfVE QFVVIxJK6O8VXI6qLRtsFEVD9Kab9wzIl49tC8t3vnsCKj0g1voYQ37bNt0Hkj8DLB 7r3NzvYYkK/1stqR2SPGXl1JmiuZG+BXIFhJbMlN7QRSCs6hPqqLTVJAhnYvikl3BR 073vOH9Q0tf2g== Received: from localhost.localdomain (unknown [182.253.88.211]) by gnuweeb.org (Postfix) with ESMTPSA id 716E72413E2; Wed, 29 Mar 2023 07:59:41 +0000 (UTC) From: Ammar Faizi To: GNU/Weeb Mailing List Cc: Muhamad Hazmi Alfarizqi , Muhamad Hazmi Alfarizqi , Alviro Iskandar Setiawan , Arthur Lapz , Ammar Faizi Subject: [PATCH a001 v1 0/7] server-a001 updates Date: Wed, 29 Mar 2023 14:59:25 +0700 Message-Id: <20230329075932.492885-1-ammarfaizi2@gnuweeb.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Server-a001 updates. There are 7 patches in this series. Everyone who was involved in the recent changes is CC'ed. 1. Use nginx from Ubuntu for simplicity. Using custom nginx package has different directory structures. It confuses me when migrating the old data to this new docker container. Just use the nginx that Ubuntu provides. 2. Add vmail storage directory. vmail will contain the mailbox data for each user. It should be mounted from the host to make the backup process easy and won't be destroyed when the container is dead. 3. Dockerfile: Upgrade the Ubuntu version to 22.04. Ubuntu 22.04 (jammy) has been released, upgrade the base image. 4. Dockerfile: Set the default main user to "ubuntu". The usual main user name on a ubuntu server is "ubuntu". Adjust it to that. 5. Add an installer script to simplify the docker image installation. 6. Create a simple init program. Using "tail -f /dev/null" as the init program is wrong because it doesn't handle the SIGCHLD signal, resulting many zombie processes like these: Zs [master] Z [qmgr] Zs [dovecot] Z [anvil] Z [log] Z [config] Z [tlsmgr] Z [stats] Z [imap-login] Z [imap] Z [imap-login] Z [imap] Z [imap-login] Z [imap] Z [pickup] Zs [dovecot] Z [anvil] Z [log] Z [config] Z [imap-login] Z [stats] Z [imap] Create a simple init program that ignores SIGCHLD so that the zombie processes are gone. 7. docker-entrypoint: Properly set directory ownership and mode When the container is restarted, the ownership and mode of the mounted directories might have changed. Ensure we correct them properly at initialization. While in there, also change "service rsyslog start" with directly invoke "/usr/sbin/rsyslogd". Using Ubuntu 22.04 can't start it using service: # service rsyslog start rsyslog: unrecognized service Signed-off-by: Ammar Faizi --- Ammar Faizi (7): Use nginx from Ubuntu for simplicity start.sh: Add vmail storage directory Dockerfile: Upgrade the Ubuntu version to 22.04 (jammy) Dockerfile: Set the default main user to "ubuntu" Add an installer script Create a simple init program docker-entrypoint: Properly set directory ownership and mode .gitignore | 1 + Dockerfile | 29 ++++++++++++----------------- apt-sources/nginx.list | 2 -- docker-entrypoint.sh | 15 ++++++++++++--- init.c | 15 +++++++++++++++ install.sh | 5 +++++ start.sh | 6 +++++- 7 files changed, 50 insertions(+), 23 deletions(-) delete mode 100644 apt-sources/nginx.list create mode 100644 init.c create mode 100755 install.sh base-commit: dff27b4c7f105d30824fc3b54ef40f7870332a50 -- Ammar Faizi