scripts: housekeeping & cleanup setup (2/2) (#3123)

This commit is contained in:
Georg Lauterbach 2023-02-28 10:25:23 +01:00 committed by GitHub
parent 9ead9a54ac
commit dfc2b39308
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 152 additions and 160 deletions

View file

@ -28,7 +28,7 @@ function _setup
_prepare_for_change_detection
}
function _early_setup_supervisor
function _early_supervisor_setup
{
SUPERVISOR_LOGLEVEL="${SUPERVISOR_LOGLEVEL:-warn}"
@ -78,19 +78,6 @@ function _setup_file_permissions
chmod 640 /var/log/mail/freshclam.log
}
function _setup_run_user_patches
{
local USER_PATCHES='/tmp/docker-mailserver/user-patches.sh'
if [[ -f ${USER_PATCHES} ]]
then
_log 'debug' 'Applying user patches'
/bin/bash "${USER_PATCHES}"
else
_log 'trace' "No optional '${USER_PATCHES}' provided"
fi
}
function _setup_timezone
{
[[ -n ${TZ} ]] || return 0
@ -113,11 +100,26 @@ function _setup_timezone
return 1
fi
}
function _setup_apply_fixes_after_configuration
{
_log 'trace' 'Removing leftover PID files from a stop/start'
find /var/run/ -not -name 'supervisord.pid' -name '*.pid' -delete
touch /dev/shm/supervisor.sock
_log 'debug' 'Checking /var/mail permissions'
_chown_var_mail_if_necessary || _shutdown 'Failed to fix /var/mail permissions'
}
function _run_user_patches
{
local USER_PATCHES='/tmp/docker-mailserver/user-patches.sh'
if [[ -f ${USER_PATCHES} ]]
then
_log 'debug' 'Applying user patches'
/bin/bash "${USER_PATCHES}"
else
_log 'trace' "No optional '${USER_PATCHES}' provided"
fi
}