-
Notifications
You must be signed in to change notification settings - Fork 41
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
JamfPackageUploader.py: Share does not dismount when Jamf Admin running #35
Comments
Hi @jazzace Note that with on-premises setups, there is a difference between checking that package metadata exists on the Jamf server and whether the package actually exists on the distribution point. We have to treat the two separately. The share should be getting unmounted. The two options (package replaced vs not replaced) both have an unmount command attached to them. See https://github.com/autopkg/grahampugh-recipes/blob/master/JamfUploaderProcessors/JamfPackageUploader.py#L585-L618 I cannot see a pathway that would skip that step. If it is not unmounting for you, I wonder if there's something preventing it? I guess it needs more verbosity at the unmount. |
I did a test and I do see the unmount:
(albeit some of the outputs needs to be decoded to string). |
I made slight adjustments to the mount/unmount functions to see if it makes any difference. See/try the
By the way, you can choose to update the metadata anyway and continue the recipe If desired. |
OK, I'll start with the mea culpa. I ran a different recipe using the release version and the dismount did not occur on the initial upload. So my error had nothing to do with whether it was replacing an existing package or not. I was using Jamf Admin to verify what JamfPackageUploader was doing. If I had Jamf Admin open, the mount would occur but the dismount would not (nor would it be reported in the output). If I closed Jamf Admin, the behaviour was as expected. I haven't tested your changed code; should I? Or should we just close this (incorrectly named) issue? |
Never mind, I did the testing. The only difference is that the new code reports the dismount that never occurs (or is ineffective). So this is a straightforward conflict with Jamf Admin. Probably just something to document and close. |
I guess we can close it? I'll run the amended version with n my scheduled run tonight and if nothings broken as a result I will merge it tomorrow. But you did bring up an issue I had been thinking about. What if your computer already has the folder mounted? Should the processor check for this and not attempt to mount it again (if that's even possible to check), and also not unmount it? I don't believe JSSImporter does. At present, I plumped for not forcing the unmount. |
Is it incorrectly reporting that the dismount occurred when it didn't? |
Release version: does not (reliably) report dismount (as per excerpt above).
and SMB share stays mounted in the Finder. Doing some more testing… |
I'm not certain why, but if I go back to the release version, I am now getting reports of the dismount (even when it actually fails). So I'm going to assume the lack of the dismount report was a transient issue. Nevertheless, I have narrowed the case for the conflict with Jamf Admin. Steps to reproduce:
Result: Recipe runs, mounts Distribution Point, which shows up in the Finder but does not dismount.
Result: "No file or directory" error (see run excerpt):
Result: Runs properly. Distribution point SMB share mounts and dismounts silently (i.e. nothing shows up in the Finder, unlike after Step 2). I've re-titled this issue for clarity. At least the case has narrowed. |
I have added a note to the wiki (https://github.com/grahampugh/jamf-upload/wiki/JamfUploader-AutoPkg-Processors) to point out the conflict. I'll keep this open as an enhancement to at some point see if there's a way to detect that the FileShare is already mounted. |
When running the processor JamfPackageUploader, if the pkg already exists and the
replace_pkg
variable is set to False (as it is by default), the SMB server will remain mounted.Excerpt from successful run:
Run when package already exists:
Based on the fact that the processor already knows the package exists before it mounts it using AppleScript, the solution should probably be to not mount the share at all should the package exist and the replace_pkg variable not be set.
The text was updated successfully, but these errors were encountered: