Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

packaging: don't assume /var/lib/alloy exists when running chown #724

Merged
merged 2 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ Main (unreleased)
- The log level of `finished node evaluation` log lines has been decreased to
'debug'. (@tpaschalis)

- Update post-installation scripts for DEB/RPM packages to ensure
`/var/lib/alloy` exists before configuring its permissions and ownership.
(@rfratto)

v1.0.0 (2024-04-09)
-------------------

Expand Down
7 changes: 5 additions & 2 deletions packaging/deb/control/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ case "$1" in
usermod -a -G systemd-journal "$ALLOY_USER"
fi

chown $ALLOY_USER:$ALLOY_GROUP /var/lib/alloy
chmod 770 /var/lib/alloy
if [ ! -d /var/lib/alloy ]; then
mkdir /var/lib/alloy
chown $ALLOY_USER:$ALLOY_GROUP /var/lib/alloy
chmod 770 /var/lib/alloy
fi

if [ ! -d /var/lib/alloy/data ]; then
mkdir /var/lib/alloy/data
Expand Down
7 changes: 5 additions & 2 deletions packaging/rpm/control/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ if [ "$1" -eq 1 ] ; then

add_to_logging_groups

chown $ALLOY_USER:$ALLOY_GROUP /var/lib/alloy
chmod 770 /var/lib/alloy
if [ ! -d /var/lib/alloy ]; then
mkdir /var/lib/alloy
chown $ALLOY_USER:$ALLOY_GROUP /var/lib/alloy
chmod 770 /var/lib/alloy
fi

if [ ! -d /var/lib/alloy/data ]; then
mkdir /var/lib/alloy/data
Expand Down
Loading