Skip to content

Ensure tgadmin runtime log and data dirs are created in postinst#19

Merged
Al-Muhandis merged 1 commit intomainfrom
codex/create-/var/log/tgadmin-directory
Mar 26, 2026
Merged

Ensure tgadmin runtime log and data dirs are created in postinst#19
Al-Muhandis merged 1 commit intomainfrom
codex/create-/var/log/tgadmin-directory

Conversation

@Al-Muhandis
Copy link
Copy Markdown
Owner

Motivation

  • Prevent the daemon from failing at startup when /var/log/tgadmin or /var/lib/tgadmin do not exist by creating those runtime directories during package installation and assigning correct owner/group and permissions.

Description

  • Add LOG_DIR and DATA_DIR variables to debian/DEBIAN/postinst.
  • Add ensure_runtime_directories() which creates the log and data directories with install -d -m 0750 -o "${SERVICE_USER}" -g "${SERVICE_GROUP}" ... so the service user owns them and they are not world-readable.
  • Call ensure_runtime_directories during the configure path after ensure_service_account and before systemd drop-in configuration.

Testing

  • Ran bash -n debian/DEBIAN/postinst to validate the maintainer script syntax, which succeeded.

Codex Task

@Al-Muhandis Al-Muhandis merged commit 95ef3c1 into main Mar 26, 2026
2 checks passed
@Al-Muhandis Al-Muhandis deleted the codex/create-/var/log/tgadmin-directory branch March 27, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant