Skip to content

[FR]: misc-stack.sh should append directories only when relevant services are enabled #2602

@polarathene

Description

@polarathene

Feature Request

Context

Despite some features like CLAM AV being disabled by default, we do copy over that data anyway during startup if it doesn't exist:

if [[ ${ONE_DIR} -eq 1 ]] && [[ -d ${STATEDIR} ]]
then
_log 'debug' "Consolidating all state onto ${STATEDIR}"
FILES=(
spool/postfix
lib/postfix
lib/amavis
lib/clamav
lib/spamassassin
lib/fail2ban
lib/postgrey
lib/dovecot
)
for FILE in "${FILES[@]}"
do
DEST="${STATEDIR}/${FILE//\//-}"
FILE="/var/${FILE}"

During a test setup with 3 instances of DMS, this had each instance use 220 MB of storage just for ClamAV which I had not enabled, so it was unexpected.

Is your Feature Request related to a Problem?

Yes, but isn't likely to be an issue for most users / deployments. It only matters if you're low on disk space and have multiple containers running for some reason and choose to persist some state with a /var/mail-state/ volume bind mount.

Describe the Solution you'd like

Not persisting / copying over state that isn't relevant.

Are you going to implement it?

Maybe, otherwise anyone is welcome to take a shot before I get around to it 😅

I am raising the issue as a personal reminder and awareness for which could be a small improvement, instead of burying it in my own todo list 😅

Metadata

Metadata

Assignees

Labels

area/scriptskind/improvementImprove an existing feature, configuration file or the documentationmeta/help wantedThe OP requests help from others - chime in! :Dpriority/lowstale-bot/ignoreIndicates that this issue / PR shall not be closed by our stale-checking CI

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions