mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-07-10 01:15:00 +02:00
scripts: housekeeping & cleanup setup (2/2) (#3123)
This commit is contained in:
parent
9ead9a54ac
commit
dfc2b39308
8 changed files with 152 additions and 160 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue