Skip to content
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

Auto-unmount repos in pre-install #1456

Merged
merged 1 commit into from
Aug 20, 2019
Merged

Auto-unmount repos in pre-install #1456

merged 1 commit into from
Aug 20, 2019

Conversation

alameenshah
Copy link
Contributor

Mac installer pkg would now automatically unmount all repositories registered for auto mount

Fixes #1124

Mac installer pkg would now automatically unmount all repositories
registered for auto mount

Fixes #1124
@alameenshah
Copy link
Contributor Author

/azp run PR - Mac - Build and Unit Test

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

if [ -f "${GVFSBINPATH}" ]; then
unmountCmd="${GVFSBINPATH} service --unmount-all"
echo $unmountCmd
eval $unmountCmd || exit 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to double check will the eval print any errors that come up from the call?
This follows the format of the other commands and lgtme.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it does.

@@ -34,7 +34,7 @@

function GetBlockingProcesses()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this get called before or after preinstall?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before preinstall.

This is the order - Distribution.xml::InstallationCheck, preinstall, postinstall.

@Ignas
Copy link

Ignas commented Oct 3, 2019

I think this will fail if you are running installer as root with a clean env (like using Munki or just sudo install) and should rather be:

for username in $(ps -Ac -o user,command | grep -iw "loginwindow" | awk '{print $1}'); do
    USER_HOME=$(eval echo "~$username")
    HOME="${USER_HOME}" gvfs service --unmount-all
done

Same as the service restart commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Installer should unmount first before installing
5 participants