Skip to content

Commit b1e8b82

Browse files
committed
Creating a different service for taking care of soft /export/home -> /home
1 parent 55e6a6f commit b1e8b82

File tree

5 files changed

+47
-23
lines changed

5 files changed

+47
-23
lines changed

Diff for: debian/postinst

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash -eux
22
#
3-
# Copyright 2018, 2021 Delphix
3+
# Copyright 2018, 2025 Delphix
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -55,6 +55,7 @@ configure)
5555
systemctl enable auditd.service
5656
systemctl enable delphix.target
5757
systemctl enable delphix-platform.service
58+
systemctl enable delphix-legacy-link.service
5859
systemctl enable delphix-rpool-upgrade.service
5960
systemctl enable systemd-networkd.service
6061
systemctl enable iscsi-name-init.service

Diff for: debian/preinst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash -eux
22
#
3-
# Copyright 2024 Delphix
3+
# Copyright 2025 Delphix
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#
2+
# Copyright 2025 Delphix
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
[Unit]
18+
Description=Create /export/home symlink to /home after platform setup
19+
After=delphix-platform.service
20+
Requires=delphix-platform.service
21+
22+
[Service]
23+
Type=oneshot
24+
ExecStart=/bin/sh -c '\
25+
echo "Ensuring /export/home is a symlink to /home..."; \
26+
if mountpoint -q /export/home; then \
27+
echo "/export/home is a mountpoint, unmounting..."; \
28+
umount /export/home || { echo "Failed to unmount /export/home"; exit 1; }; \
29+
fi; \
30+
if [ -e /export/home ] && [ ! -L /export/home ]; then \
31+
echo "Removing existing /export/home directory..."; \
32+
rm -rf /export/home; \
33+
fi; \
34+
if [ ! -d /export ]; then \
35+
mkdir /export; \
36+
fi; \
37+
if [ -d /export ] && [ ! -L /export/home ]; then \
38+
echo "Creating symlink: /export/home -> /home"; \
39+
ln -s /home /export/home; \
40+
fi;'
41+
42+
[Install]
43+
WantedBy=delphix.target

Diff for: files/common/lib/systemd/system/delphix-platform.service

-20
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,6 @@ Before=rsync.service docker.service
2424
Type=oneshot
2525
ExecStart=/var/lib/delphix-platform/ansible/apply
2626
ExecStart=/var/lib/delphix-platform/dynamic-debug
27-
28-
# Create /export/home symlink to /home if it doesn't already exist
29-
ExecStartPost=/bin/sh -c '\
30-
echo "Ensuring /export/home is a symlink to /home..."; \
31-
if mountpoint -q /export/home; then \
32-
echo "/export/home is a mountpoint, unmounting..."; \
33-
umount /export/home || { echo "Failed to unmount /export/home"; exit 1; }; \
34-
fi; \
35-
if [ -e /export/home ] && [ ! -L /export/home ]; then \
36-
echo "Removing existing /export/home directory..."; \
37-
rm -rf /export/home; \
38-
fi; \
39-
if [ ! -d /export ]; then \
40-
mkdir /export; \
41-
fi; \
42-
if [ -d /export ] && [ ! -L /export/home ]; then \
43-
echo "Creating symlink: /export/home -> /home"; \
44-
ln -s /home /export/home; \
45-
fi;'
46-
4727
RemainAfterExit=yes
4828

4929
#

Diff for: files/common/var/lib/delphix-platform/ansible/10-delphix-platform/roles/delphix-platform/tasks/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright 2018, 2023 Delphix
2+
# Copyright 2018, 2025 Delphix
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)