Skip to content

Update entrypoint script to ensure directory permissions for gvm#324

Merged
bjoernricks merged 2 commits into
greenbone:mainfrom
ahmedtouahria:main
Jan 5, 2026
Merged

Update entrypoint script to ensure directory permissions for gvm#324
bjoernricks merged 2 commits into
greenbone:mainfrom
ahmedtouahria:main

Conversation

@ahmedtouahria
Copy link
Copy Markdown
Contributor

@ahmedtouahria ahmedtouahria commented Jan 5, 2026

What

This PR ensures that the directories /var/lib/openvas and /var/lib/gvm exist and have the correct ownership and permissions before the container drops privileges to the gvm user.

Specifically, it:

  • Creates /var/lib/openvas and /var/lib/gvm if they do not exist.
  • Sets ownership to gvm:gvm.
  • Sets permissions to 775 to allow group write access.

This logic is executed as root before calling gosu gvm, ensuring that gvm has proper access to required lock/state directories at runtime.

The changes were verified by running the container with a fresh volume and confirming that no permission errors occur and services start normally.

Why

When running the container with fresh or mounted volumes, these directories may not exist or may be owned by root, causing permission errors when OpenVAS/GVM attempts to create lock or state files.

This leads to startup failures or unexpected behavior unless users manually create and chown these directories.

Ensuring the directories exist and are writable by gvm improves:

  • Out-of-the-box usability
  • Compatibility with fresh Docker volumes
  • Reliability in containerized and orchestrated environments (Docker, Kubernetes, etc.)

References

N/A

Checklist

  • Tests

@ahmedtouahria ahmedtouahria requested review from a team as code owners January 5, 2026 09:20
@greenbonebot greenbonebot enabled auto-merge (rebase) January 5, 2026 09:20
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 5, 2026

Conventional Commits Report

😢 No conventional commits found.

👉 Learn more about the conventional commits usage at Greenbone.

Comment thread .docker/entrypoint.sh Outdated
@bjoernricks bjoernricks disabled auto-merge January 5, 2026 09:25
@bjoernricks bjoernricks enabled auto-merge (squash) January 5, 2026 09:27
@bjoernricks bjoernricks merged commit 6eb4a2b into greenbone:main Jan 5, 2026
24 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants