Skip to content

DLPX-89763 DLPX-86523 delphix-platform changes #477

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

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
3 changes: 2 additions & 1 deletion debian/postinst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -eux
#
# Copyright 2018, 2021 Delphix
# Copyright 2018, 2025 Delphix
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -55,6 +55,7 @@ configure)
systemctl enable auditd.service
systemctl enable delphix.target
systemctl enable delphix-platform.service
systemctl enable delphix-legacy-link.service
systemctl enable delphix-rpool-upgrade.service
systemctl enable systemd-networkd.service
systemctl enable iscsi-name-init.service
Expand Down
42 changes: 42 additions & 0 deletions debian/preinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash -eux
#
# Copyright 2025 Delphix
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

case $1 in
upgrade)
# Home directories were previously mounted under /export/home,
# and this was changed to /home. This is the upgrade logic that
# updates the /etc/fstab file to reflect that change.
# Home directories will be mounted in both /export/home and /home
# until the system is rebooted to ensure that running processes
# referencing the old /export/home paths continue to function
# while also enabling new logins under /home to work.
fs_tab=/etc/fstab

if grep -q "\/export\/home" "$fs_tab"; then
sed -i 's|/export/home|/home|g' "$fs_tab"
mount /home
fi

passwd_file=/etc/passwd
if grep -q "\/export\/home" "$passwd_file"; then
sed -i 's/\/export\/home/\/home/g' /etc/passwd
fi

;;
esac

exit 0
45 changes: 45 additions & 0 deletions files/common/lib/systemd/system/delphix-legacy-link.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#
# Copyright 2025 Delphix
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

[Unit]
Description=Create /export/home symlink to /home after platform setup
After=delphix-platform.service
Requires=delphix-platform.service

[Service]
Type=oneshot
ExecStart=/bin/bash -c " \
if [ ! -L /export/home ]; then \
echo 'Ensuring /export/home is a symlink to /home...'; \
if mountpoint -q /export/home; then \
echo '/export/home is a mountpoint, unmounting...'; \
umount /export/home || { echo 'Failed to unmount /export/home'; exit 1; }; \
fi; \
if [ -e /export/home ]; then \
echo 'Removing existing /export/home directory...'; \
rm -rf /export/home; \
fi; \
if [ ! -d /export ]; then \
mkdir /export; \
fi; \
if [ -d /export ]; then \
echo 'Creating symlink: /export/home -> /home'; \
ln -s /home /export/home; \
fi; \
fi"

[Install]
WantedBy=delphix.target
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2018, 2023 Delphix
# Copyright 2018, 2025 Delphix
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -22,7 +22,7 @@
# it below; otherwise that task will fail.
#
- file:
path: /export/home
path: /home
state: directory
mode: 0755

Expand All @@ -35,7 +35,7 @@
shell: /bin/bash
create_home: yes
comment: Delphix User
home: /export/home/delphix
home: /home/delphix

#
# In order for this locale to be used (e.g. by virtualization) we need
Expand Down Expand Up @@ -689,7 +689,7 @@

- name: Source bash completion
blockinfile:
dest: "/export/home/delphix/.bashrc"
dest: "/home/delphix/.bashrc"
block: |
. /etc/bash_completion.d/systemctl
. /etc/bash_completion.d/zfs
Expand Down
Loading