Skip to content

Commit 9729af2

Browse files
committed
Removing the softlink loginc from main.yml
1 parent 74091ab commit 9729af2

File tree

3 files changed

+27
-57
lines changed

3 files changed

+27
-57
lines changed

debian/preinst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717

1818
case $1 in
1919
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.
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.
2727
fs_tab=/etc/fstab
2828
auto_master=/etc/auto.master
2929

files/common/lib/systemd/system/delphix-platform.service

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,26 @@ 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+
2747
RemainAfterExit=yes
2848

2949
#

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

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -684,53 +684,3 @@
684684
path: /etc/environment
685685
state: absent
686686
regexp: '^\s*PATH\s*='
687-
688-
#
689-
# Soft link creation in case it doesn't exist
690-
#
691-
- name: Check export
692-
ansible.builtin.stat:
693-
path: /export
694-
register: export_status
695-
696-
- name: Check export home
697-
ansible.builtin.stat:
698-
path: /export/home
699-
when: export_status.stat.exists and export_status.stat.isdir
700-
register: export_home_status
701-
702-
#
703-
# Before deleting the /export/home directory if the
704-
# home data set is mounted on /export/home if its
705-
# mounted remove if first and then go ahead.
706-
#
707-
- name: Check if the path is mounted
708-
ansible.builtin.shell: |
709-
mount | grep /export/home
710-
register: mount_status
711-
ignore_errors: yes
712-
713-
- name: Unmount the path if it is mounted
714-
ansible.builtin.mount:
715-
path: /export/home
716-
state: unmounted
717-
when: mount_status.rc == 0
718-
719-
- name: Delete home directory
720-
ansible.builtin.file:
721-
path: /export/home
722-
state: absent
723-
when: not export_status.stat.exists or export_home_status.stat.exists and export_home_status.stat.isdir
724-
725-
- name: Create export directory
726-
ansible.builtin.file:
727-
path: /export
728-
state: directory
729-
mode: 0755
730-
when: not export_status.stat.exists
731-
732-
- name: Create the soft link
733-
ansible.builtin.file:
734-
src: /home
735-
dest: /export/home
736-
state: link

0 commit comments

Comments
 (0)