Skip to content

Commit

Permalink
DLPX-89763 DLPX-86523 delphix-platform changes
Browse files Browse the repository at this point in the history
  • Loading branch information
justsanjeev committed Sep 2, 2024
1 parent ade7e87 commit 28b9cce
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 3 deletions.
44 changes: 44 additions & 0 deletions debian/preinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash -eux
#
# Copyright 2024 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)
# Checking the fstab file if the /export/home entry
# is present in the /etc/fstab, In case of container
# upgrade the file is already changed by the
# container-upgrade script and we dont need to do
# it again.
fs_tab=/etc/fstab
auto_master=/etc/auto.master

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

if [[ -e $auto_master ]]
then
if grep -q "\/home\s+auto_home\s+-nobrowse" "$auto_master"
then
sed -i 's|/home auto_home -nobrowse|#/home auto_home -nobrowse|g' "$auto_master"
systemctl restart autofs
fi
fi
;;
esac
exit 0
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 28b9cce

Please sign in to comment.