Skip to content

Commit c771668

Browse files
authored
[DPE-9032] chore: adapt rock to non-root setup (#33)
In non-root mode, this is required for `pebble` in order to be able to call `exec` commands, otherwise we face such errors: ops.pebble.APIError: cannot call exec: home directory "/home/kafka" does not exist This PR also amends some missing permissions on `connect` and `cruise-control` directories.
1 parent 0bcea77 commit c771668

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

rockcraft.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,13 @@ parts:
5151
# making core dirs
5252
mkdir -p $CRAFT_PART_INSTALL/var/lib/pebble/default/
5353
mkdir -p $CRAFT_PART_INSTALL/var/lib/kafka/
54-
mkdir -p $CRAFT_PART_INSTALL/var/log/kafka/
5554
mkdir -p $CRAFT_PART_INSTALL/opt/kafka/
5655
mkdir -p $CRAFT_PART_INSTALL/etc/kafka/
56+
mkdir -p $CRAFT_PART_INSTALL/etc/connect/
57+
mkdir -p $CRAFT_PART_INSTALL/etc/cruise-control/
58+
mkdir -p $CRAFT_PART_INSTALL/var/log/kafka/
5759
mkdir -p $CRAFT_PART_INSTALL/var/log/connect/
60+
mkdir -p $CRAFT_PART_INSTALL/var/log/cruise-control/
5861
organize:
5962
bin: opt/kafka/bin/
6063
libs: opt/kafka/libs/
@@ -66,13 +69,16 @@ parts:
6669
# Create a user in the $CRAFT_OVERLAY chroot
6770
# This user is the same as the one in the snap
6871
groupadd -R $CRAFT_OVERLAY -g 584792 kafka
69-
useradd -R $CRAFT_OVERLAY -M -r -g kafka -u 584792 kafka
72+
useradd -R $CRAFT_OVERLAY -m -r -g kafka -u 584792 kafka
7073
override-prime: |
7174
craftctl default
7275
# Give permission ot the required folders
7376
install -d -o 584792 -g 584792 -m 770 \
7477
opt/kafka \
7578
var/lib/kafka \
76-
var/log/kafka \
7779
etc/kafka \
78-
var/log/connect
80+
etc/connect \
81+
etc/cruise-control \
82+
var/log/kafka \
83+
var/log/connect \
84+
var/log/cruise-control

0 commit comments

Comments
 (0)