-
Notifications
You must be signed in to change notification settings - Fork 44
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| #!/bin/bash | ||
| # | ||
| # Copyright (c) 2025 by Delphix. All rights reserved. | ||
| # | ||
|
|
||
| # | ||
| # This script ensures that the /export/home is a symlink | ||
| # to /home. | ||
| # | ||
|
|
||
|
|
||
| # If /export/home is already a symlink to /home, do nothing | ||
| if [ -L /export/home ]; then | ||
| echo '/export/home is already exists. Nothing to do.' | ||
| exit 0 | ||
| fi | ||
|
|
||
| # if /export/home and /home both are mounted - Dont do anything | ||
| # Since during the next boot /export/home will not be mounted | ||
| # Since /export/home is there all tests will be passes | ||
| if mountpoint -q /export/home; then | ||
| echo '/export/home is still mounted. Check if /home is also mounted' | ||
| if mountpoint -q /home; then | ||
| echo '/home is also mounted. Since during the next boot /export/home will not be mounted, exiting safely.' | ||
| exit 0 | ||
| else | ||
| echo '/home is not mounted. Aborting!!' | ||
| exit 1 | ||
| fi | ||
| fi | ||
|
|
||
| # /export/home is not mounted, check if /home is mounted | ||
| # Check if /home is mounted | ||
justsanjeev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if mountpoint -q /home; then | ||
| echo "/home is mounted. Proceeding with /export/home cleanup." | ||
| # If /export/home exists | ||
| if [ -d /export/home ]; then | ||
| echo "/export/home exists. Attempting to remove it..." | ||
| rmdir /export/home 2>/dev/null | ||
| if [ $? -eq 0 ]; then | ||
| echo "/export/home directory removed successfully." | ||
| else | ||
| echo "/export/home is not empty. Please clean it manually before running this script." | ||
| exit 1 | ||
|
Comment on lines
+43
to
+44
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Part of me thinks that we may end up with customers experiencing upgrade failures due to unexpected files in there (for reasons we haven't anticipated). To harden this part of the migration, perhaps we should move anything that's still in here elsewhere (with output identifying that we did this) and move on with removing the directory. |
||
| fi | ||
| fi | ||
| else | ||
| echo "/home is not mounted. Aborting to avoid risk of data loss." | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Ensure /export exists | ||
| mkdir -p /export | ||
|
|
||
| # Create symlink | ||
| echo "Creating symlink: /export/home -> /home" | ||
| ln -s /home /export/home | ||
| if [ $? -eq 0 ]; then | ||
| echo "Symlink created successfully." | ||
| else | ||
| echo "Failed to create symlink. Please check permissions and try again." | ||
| exit 1 | ||
| fi | ||
Uh oh!
There was an error while loading. Please reload this page.