Skip to content

Commit 4cf8711

Browse files
committed
DLPX-89763 DLPX-86523 delphix-platform changes
PR URL: https://www.github.com/delphix/delphix-platform/pull/521
1 parent 7fcc2e7 commit 4cf8711

File tree

4 files changed

+98
-4
lines changed

4 files changed

+98
-4
lines changed

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

debian/preinst

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash -eux
2+
#
3+
# Copyright 2025 Delphix
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
case $1 in
19+
upgrade)
20+
# Home directories were previously mounted under /export/home,
21+
# and this was changed to /home. This is the upgrade logic that
22+
# updates the /etc/fstab file to reflect that change.
23+
# Home directories will be mounted in both /export/home and /home
24+
# until the system is rebooted to ensure that running processes
25+
# referencing the old /export/home paths continue to function
26+
# while also enabling new logins under /home to work.
27+
fs_tab=/etc/fstab
28+
auto_master=/etc/auto.master
29+
30+
if grep -q "\/export\/home" "$fs_tab"; then
31+
sed -i 's|/export/home|/home|g' "$fs_tab"
32+
mount /home
33+
fi
34+
35+
if [[ -e $auto_master ]]; then
36+
if grep -q "\/home\s+auto_home\s+-nobrowse" "$auto_master"; then
37+
sed -i 's|/home auto_home -nobrowse|#/home auto_home -nobrowse|g' "$auto_master"
38+
systemctl restart autofs
39+
fi
40+
fi
41+
42+
passwd_file=/etc/passwd
43+
if grep -q "\/export\/home" "$passwd_file"; then
44+
sed -i 's/\/export\/home/\/home/g' /etc/passwd
45+
fi
46+
47+
;;
48+
esac
49+
50+
exit 0
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

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# it below; otherwise that task will fail.
2323
#
2424
- file:
25-
path: /export/home
25+
path: /home
2626
state: directory
2727
mode: 0755
2828

@@ -35,7 +35,7 @@
3535
shell: /bin/bash
3636
create_home: yes
3737
comment: Delphix User
38-
home: /export/home/delphix
38+
home: /home/delphix
3939

4040
#
4141
# In order for this locale to be used (e.g. by virtualization) we need
@@ -689,7 +689,7 @@
689689
690690
- name: Source bash completion
691691
blockinfile:
692-
dest: "/export/home/delphix/.bashrc"
692+
dest: "/home/delphix/.bashrc"
693693
block: |
694694
. /etc/bash_completion.d/systemctl
695695
. /etc/bash_completion.d/zfs

0 commit comments

Comments
 (0)