Skip to content

Commit 8782abf

Browse files
Merge pull request #4765 from ggiguash/usr-lib-systemd-usage
USHIFT-5533: Switch to using immutable filesystem for installing systemd drop-ins
2 parents b92cc00 + 41cffbb commit 8782abf

14 files changed

+21
-21
lines changed

docs/config/Containerfile.bootc-embedded-rhel9

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ done < "${IMAGE_LIST_FILE}"
3838
EOF
3939

4040
RUN chmod 755 /usr/bin/microshift-copy-images && \
41-
mkdir -p /etc/systemd/system/microshift.service.d
41+
mkdir -p /usr/lib/systemd/system/microshift.service.d
4242

43-
RUN cat > /etc/systemd/system/microshift.service.d/microshift-copy-images.conf <<EOF
43+
RUN cat > /usr/lib/systemd/system/microshift.service.d/microshift-copy-images.conf <<EOF
4444
[Service]
4545
ExecStartPre=/usr/bin/microshift-copy-images
4646
EOF

docs/config/Containerfile.bootc-rhel9

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ RUN firewall-offline-cmd --zone=public --add-port=80/tcp && \
3333

3434
# Create a systemd unit to recursively make the root filesystem subtree
3535
# shared as required by OVN images
36-
RUN cat > /etc/systemd/system/microshift-make-rshared.service <<'EOF'
36+
RUN cat > /usr/lib/systemd/system/microshift-make-rshared.service <<'EOF'
3737
[Unit]
3838
Description=Make root filesystem shared
3939
Before=microshift.service

docs/contributor/image_mode.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -734,8 +734,8 @@ Add the following command to the MicroShift image build procedure to create a
734734
```
735735
# Install systemd configuration drop-ins to fix potential permission problems
736736
# when upgrading from older rpm-ostree commits to Image Mode container layers
737-
RUN mkdir -p /etc/systemd/system/ovsdb-server.service.d && \
738-
cat > /etc/systemd/system/ovsdb-server.service.d/microshift-ovsdb-ownership.conf <<'EOF'
737+
RUN mkdir -p /usr/lib/systemd/system/ovsdb-server.service.d && \
738+
cat > /usr/lib/systemd/system/ovsdb-server.service.d/microshift-ovsdb-ownership.conf <<'EOF'
739739
# The openvswitch database files must be owned by the appropriate user and its
740740
# primary group. Note that the user and its group may be overwritten too, so
741741
# they need to be recreated in this case.

okd/src/microshift-okd-multi-build.Containerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,5 @@ RUN if [ -n "$EMBED_CONTAINER_IMAGES" ] ; then \
7979

8080
# Create a systemd unit to recursively make the root filesystem subtree
8181
# shared as required by OVN images
82-
COPY ./packaging/imagemode/systemd/microshift-make-rshared.service /etc/systemd/system/microshift-make-rshared.service
82+
COPY ./packaging/imagemode/systemd/microshift-make-rshared.service /usr/lib/systemd/system/microshift-make-rshared.service
8383
RUN systemctl enable microshift-make-rshared.service

okd/src/microshift-okd-run.Containerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ RUN ${OKD_CONFIG_SCRIPT} && rm -rf ${OKD_CONFIG_SCRIPT}
3030

3131
# Create a systemd unit to recursively make the root filesystem subtree
3232
# shared as required by OVN images
33-
COPY ./packaging/imagemode/systemd/microshift-make-rshared.service /etc/systemd/system/microshift-make-rshared.service
33+
COPY ./packaging/imagemode/systemd/microshift-make-rshared.service /usr/lib/systemd/system/microshift-make-rshared.service
3434
RUN systemctl enable microshift-make-rshared.service

packaging/imagemode/Containerfile.repobase

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ ConditionVirtualization=container\n\
3030
Type=oneshot\n\
3131
ExecStart=/usr/bin/mount --make-rshared /\n\
3232
[Install]\n\
33-
WantedBy=multi-user.target\n' > /etc/systemd/system/microshift-make-rshared.service && \
33+
WantedBy=multi-user.target\n' > /usr/lib/systemd/system/microshift-make-rshared.service && \
3434
systemctl enable microshift-make-rshared.service

packaging/imagemode/Containerfile.repourl

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ RUN firewall-offline-cmd --zone=public --add-port=22/tcp && \
3939

4040
# Create a systemd unit to recursively make the root filesystem subtree
4141
# shared as required by OVN images
42-
COPY ./systemd/microshift-make-rshared.service /etc/systemd/system/microshift-make-rshared.service
42+
COPY ./systemd/microshift-make-rshared.service /usr/lib/systemd/system/microshift-make-rshared.service
4343
RUN systemctl enable microshift-make-rshared.service

packaging/imagemode/Containerfile.rhocp

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ RUN firewall-offline-cmd --zone=public --add-port=22/tcp && \
2121

2222
# Create a systemd unit to recursively make the root filesystem subtree
2323
# shared as required by OVN images
24-
COPY ./systemd/microshift-make-rshared.service /etc/systemd/system/microshift-make-rshared.service
24+
COPY ./systemd/microshift-make-rshared.service /usr/lib/systemd/system/microshift-make-rshared.service
2525
RUN systemctl enable microshift-make-rshared.service

test/image-blueprints-bootc/layer1-base/group2/rhel96-bootc-crel-isolated.containerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ RUN --mount=type=secret,id=pullsecret,dst=/run/secrets/pull-secret.json \
2727
# In this case, it is not necessary to update /etc/containers/storage.conf with
2828
# the additional store path.
2929
# See https://issues.redhat.com/browse/RHEL-75827
30-
RUN mkdir -p /etc/systemd/system/microshift.service.d
31-
COPY --chmod=644 ./bootc-images/microshift-copy-images.conf /etc/systemd/system/microshift.service.d/microshift-copy-images.conf
30+
RUN mkdir -p /usr/lib/systemd/system/microshift.service.d
31+
COPY --chmod=644 ./bootc-images/microshift-copy-images.conf /usr/lib/systemd/system/microshift.service.d/microshift-copy-images.conf
3232

3333
# Configure firewall
3434
RUN firewall-offline-cmd --zone=public --add-port=22/tcp && \

test/image-blueprints-bootc/layer2-source/group1/rhel96-bootc-source.containerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ RUN firewall-offline-cmd --zone=public --add-port=22/tcp && \
3535

3636
# Install systemd configuration drop-ins to fix potential permission problems
3737
# when upgrading from older ostree commits to bootc container layers
38-
RUN mkdir -p /etc/systemd/system/ovsdb-server.service.d
39-
COPY --chmod=644 ./bootc-images/microshift-ovsdb-ownership.conf /etc/systemd/system/ovsdb-server.service.d/microshift-ovsdb-ownership.conf
38+
RUN mkdir -p /usr/lib/systemd/system/ovsdb-server.service.d
39+
COPY --chmod=644 ./bootc-images/microshift-ovsdb-ownership.conf /usr/lib/systemd/system/ovsdb-server.service.d/microshift-ovsdb-ownership.conf

test/image-blueprints-bootc/layer2-source/group2/rhel96-bootc-source-ai-model-serving.containerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ RUN --mount=type=secret,id=pullsecret,dst=/run/secrets/pull-secret.json \
7171
# In this case, it is not necessary to update /etc/containers/storage.conf with
7272
# the additional store path.
7373
# See https://issues.redhat.com/browse/RHEL-75827
74-
RUN mkdir -p /etc/systemd/system/microshift.service.d
75-
COPY --chmod=644 ./bootc-images/microshift-copy-images.conf /etc/systemd/system/microshift.service.d/microshift-copy-images.conf
74+
RUN mkdir -p /usr/lib/systemd/system/microshift.service.d
75+
COPY --chmod=644 ./bootc-images/microshift-copy-images.conf /usr/lib/systemd/system/microshift.service.d/microshift-copy-images.conf
7676

7777
# Create test data
7878
COPY --chmod=755 ./bootc-images/ai-model-serving-test-data.sh /tmp/ai-model-serving-test-data.sh

test/image-blueprints-bootc/layer2-source/group2/rhel96-bootc-source-isolated.containerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ RUN --mount=type=secret,id=pullsecret,dst=/run/secrets/pull-secret.json \
3030
# In this case, it is not necessary to update /etc/containers/storage.conf with
3131
# the additional store path.
3232
# See https://issues.redhat.com/browse/RHEL-75827
33-
RUN mkdir -p /etc/systemd/system/microshift.service.d
34-
COPY --chmod=644 ./bootc-images/microshift-copy-images.conf /etc/systemd/system/microshift.service.d/microshift-copy-images.conf
33+
RUN mkdir -p /usr/lib/systemd/system/microshift.service.d
34+
COPY --chmod=644 ./bootc-images/microshift-copy-images.conf /usr/lib/systemd/system/microshift.service.d/microshift-copy-images.conf

test/image-blueprints-bootc/layer2-source/group3/cos9-bootc-source-isolated.containerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ RUN --mount=type=secret,id=pullsecret,dst=/run/secrets/pull-secret.json \
1313
# In this case, it is not necessary to update /etc/containers/storage.conf with
1414
# the additional store path.
1515
# See https://issues.redhat.com/browse/RHEL-75827
16-
RUN mkdir -p /etc/systemd/system/microshift.service.d
17-
COPY --chmod=644 ./bootc-images/microshift-copy-images.conf /etc/systemd/system/microshift.service.d/microshift-copy-images.conf
16+
RUN mkdir -p /usr/lib/systemd/system/microshift.service.d
17+
COPY --chmod=644 ./bootc-images/microshift-copy-images.conf /usr/lib/systemd/system/microshift.service.d/microshift-copy-images.conf

test/kickstart-templates/includes/post-bootc-container-tweaks.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Create a systemd unit to recursively make the root filesystem subtree
22
# shared as required by OVN images
3-
cat > /etc/systemd/system/microshift-make-rshared.service <<'EOF'
3+
cat > /usr/lib/systemd/system/microshift-make-rshared.service <<'EOF'
44
[Unit]
55
Description=Make root filesystem shared
66
Before=microshift.service

0 commit comments

Comments
 (0)