GNU/Weeb Mailing List <[email protected]>
 help / color / mirror / Atom feed
From: Ammar Faizi <[email protected]>
To: GNU/Weeb Mailing List <[email protected]>
Cc: Muhamad Hazmi Alfarizqi <[email protected]>,
	Muhamad Hazmi Alfarizqi <[email protected]>,
	Alviro Iskandar Setiawan <[email protected]>,
	Arthur Lapz <[email protected]>,
	Ammar Faizi <[email protected]>
Subject: [PATCH a001 v1 7/7] docker-entrypoint: Properly set directory ownership and mode
Date: Wed, 29 Mar 2023 14:59:32 +0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

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 <[email protected]>
---
 docker-entrypoint.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh
index d741061731ecc64f..963e249bc601102b 100755
--- a/docker-entrypoint.sh
+++ b/docker-entrypoint.sh
@@ -2,11 +2,20 @@
 
 chown -v root:root /var/keys
 
-service rsyslog start
+chown -R opendkim:opendkim /var/keys/dkim
+chmod -R 700 /var/keys/dkim
+
+chown -R vmail:vmail /var/vmail
+chmod -R u+rw,g+rw,o= /var/vmail
+
+chown -R mysql:mysql /var/lib/mysql
+chmod -R u+rw,g+rw,o= /var/lib/mysql
+
+/usr/sbin/rsyslogd
+
 service ssh start
-service nginx start
 service mysql start
-
+service nginx start
 service postfix start
 service dovecot start
 service opendkim start
-- 
Ammar Faizi


  parent reply	other threads:[~2023-03-29  8:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-29  7:59 [PATCH a001 v1 0/7] server-a001 updates Ammar Faizi
2023-03-29  7:59 ` [PATCH a001 v1 1/7] Use nginx from Ubuntu for simplicity Ammar Faizi
2023-03-29  7:59 ` [PATCH a001 v1 2/7] start.sh: Add vmail storage directory Ammar Faizi
2023-03-29  7:59 ` [PATCH a001 v1 3/7] Dockerfile: Upgrade the Ubuntu version to 22.04 (jammy) Ammar Faizi
2023-03-29  7:59 ` [PATCH a001 v1 4/7] Dockerfile: Set the default main user to "ubuntu" Ammar Faizi
2023-03-29  7:59 ` [PATCH a001 v1 5/7] Add an installer script Ammar Faizi
2023-03-29  7:59 ` [PATCH a001 v1 6/7] Create a simple init program Ammar Faizi
2023-03-29  7:59 ` Ammar Faizi [this message]
2023-03-29 19:36 ` [PATCH a001 v1 0/7] server-a001 updates Alviro Iskandar Setiawan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox