Commit Graph

108 Commits

Author SHA1 Message Date
Justin McWilliams
d03b2ba11f Merging forced_install_after_date branch to trunk.
This adds Force Install Notifications support to the MSU GUI, and logouthelper support to managedsoftwareupdate/launchd. Documentation on using the pkginfo force_install_after_date key to come....

This merge also includes localization fixes and on-the-fly updating of the MSU GUI when managedsoftwareupdate runs in the background while the GUI is open, changing InstallInfo.

With this merge, the Munki version is increased to 0.8.0 and MSU GUI version to 3.2.


git-svn-id: http://munki.googlecode.com/svn/trunk@1270 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-08-04 19:23:19 +00:00
Justin McWilliams
0e858b098a Munki should output and log preflight output, both stdout and stderr, and should output and log postflight return codes if != 0 (even though it doesn't perform any different actions).
git-svn-id: http://munki.googlecode.com/svn/trunk@1269 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-08-04 18:35:36 +00:00
John Randolph
20867d6c9e merge in changes from /branches/force_install_after_date/
git-svn-id: http://munki.googlecode.com/svn/trunk@1207 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-06-03 18:55:30 +00:00
Greg Neagle
b33739f931 Updated copyright info printed when managedsoftwareupdate runs.
git-svn-id: http://munki.googlecode.com/svn/trunk@1204 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-05-27 16:37:43 +00:00
Justin McWilliams
81e560d696 oops, fixing indentation ;/
git-svn-id: http://munki.googlecode.com/svn/trunk@1120 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-04-15 21:51:56 +00:00
Justin McWilliams
1687e8be9b Display "Performing postflight tasks...." before running an existing postflight script, to explain the delay between "No changes to managed software are available." and the script exiting.
git-svn-id: http://munki.googlecode.com/svn/trunk@1119 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-04-15 21:50:18 +00:00
Justin McWilliams
f17935640c Enhancement of r1103, cleaning up how getIdleSeconds() works.
git-svn-id: http://munki.googlecode.com/svn/trunk@1104 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-04-11 15:32:13 +00:00
Justin McWilliams
53d16dd778 Fix but in getIdleSeconds() where ioreg output is split, but there are inconsistent number of whitespaces.
I ran into a machine where "parts" was:  ['|', '|', '"HIDIdleTime"', '=', '1458195167613966'], and since parts[3] is "=" getIdleSeconds() was crashing trying to convert it to int().

So return int(int(parts[3])/1000000000) should really be parts[4] on this machine, but this may be inconsistent on different machines?

# /usr/sbin/ioreg -c IOHIDSystem -d 4 | grep Idle
   | |     "HIDIdleTime" = 1458351496253133

So let's just use regex to parse the integer out of the line more safely.



git-svn-id: http://munki.googlecode.com/svn/trunk@1103 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-04-09 15:10:46 +00:00
Justin McWilliams
e84453eb5f s/forced_(un)install/unattended_(un)install/g
s/only_forced/only_unattended/g

Change forced_* pkginfo key names to more accurately describe what's happening, since they're not "forced" in the true sense of the word.

Admins should include both forced_* and unattended_* keys in their pkginfos while migrating to client releases after this change, to ensure both old and new clients have desired pkg push agressiveness :(


git-svn-id: http://munki.googlecode.com/svn/trunk@1098 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-04-08 16:23:45 +00:00
Justin McWilliams
3f3a3b4dfd utils.runExternalScript should return stderr, and preflight/postflight stderr should be displayed and logged if return != 0
git-svn-id: http://munki.googlecode.com/svn/trunk@1092 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-04-04 21:38:33 +00:00
John Randolph
b6cb650938 add
--applesuspkgsonly
--munkipkgsonly

options to managedsoftwareupdate to override which packages it looks at



git-svn-id: http://munki.googlecode.com/svn/trunk@1084 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-03-22 22:00:49 +00:00
Greg Neagle
7390b94f46 Minor change to notifyUserOfUpdates() in managedsoftwareupdate.
git-svn-id: http://munki.googlecode.com/svn/trunk@1013 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-01-27 23:01:34 +00:00
Greg Neagle
a853f78c9f Update copyright dates across the board.
git-svn-id: http://munki.googlecode.com/svn/trunk@1010 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-01-25 18:22:14 +00:00
Greg Neagle
abe3d2a1de appleupdates.py now creates its own .dist files to manage installation of downloaded Apple Software Updates, replacing the earlier technique of just installing the individual packages in filename order.
In most invocations of subprocess.Popen, change the bufsize from 1 to -1, which changes from line-buffered to "big" buffers.

Other minor changes to align with the appleupdates,py changes and some pylint-recommended cleanup.

git-svn-id: http://munki.googlecode.com/svn/trunk@995 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-01-14 19:11:05 +00:00
Greg Neagle
739df8dcd8 Defensive coding around munkicommon.display_error and munkicommon.display_warning to avoid a KeyError if munkicommon.report is missing the Errors or Warnings keys.
Similar defensive coding in installer.py for the InstallResults and RemovalResults keys.

Safer report initialization in managedsoftwareupdate.



git-svn-id: http://munki.googlecode.com/svn/trunk@993 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-01-04 19:33:25 +00:00
Greg Neagle
769e8dab91 Reworked reports to show more relevant data on ManagedInstalls. install-only munki sessions also carry over data from the previous run so the report is more complete.
git-svn-id: http://munki.googlecode.com/svn/trunk@980 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-12-15 21:34:25 +00:00
Justin McWilliams
f098fb9d1d Typo fix: s/Perfoming/Performing/ in preflight task MSU notification.
git-svn-id: http://munki.googlecode.com/svn/trunk@978 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-12-15 18:13:56 +00:00
Greg Neagle
681acae624 Add MCX support, based on code contribution from Dan Roque.
Other minor clean-ups.

git-svn-id: http://munki.googlecode.com/svn/trunk@973 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-12-13 20:11:22 +00:00
Rob Middleton
f87284d4d4 Remove tmpdir at expected exits of managedsoftwareupdate. tmpdir is created by global line in munkicommon: "tmpdir = tempfile.mkdtemp()". More fiddly to make the change so tmpdir only created where there is demand for it.
git-svn-id: http://munki.googlecode.com/svn/trunk@972 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-12-12 09:11:22 +00:00
Rob Middleton
1ff5d190fa applesoftwareupdatesonly is not global / not in this scope
git-svn-id: http://munki.googlecode.com/svn/trunk@929 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-11-26 08:52:00 +00:00
Rob Middleton
32b7e37066 Fix to functionality added in r818. On GUI auto run, do forced installs, then prompt user if either munki updates still availalbe, or any apple updates available.
git-svn-id: http://munki.googlecode.com/svn/trunk@928 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-11-25 02:03:29 +00:00
Greg Neagle
5be8b5ed84 If running a preflight script, call munkicommon.display_status so we tickle the munkistatus socket before it times out.
git-svn-id: http://munki.googlecode.com/svn/trunk@922 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-11-18 22:25:00 +00:00
Greg Neagle
7e9f255085 Fixed idle check logic when running in 'checkandinstallatstartup' mode.
git-svn-id: http://munki.googlecode.com/svn/trunk@872 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-26 20:38:27 +00:00
Greg Neagle
b901118418 Fix doc string formatting.
Re-check idle time when running in "checkandinstallatstartup" mode so we maximize our chances of getting all the updates done when bootstrapping.

git-svn-id: http://munki.googlecode.com/svn/trunk@869 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-26 18:52:06 +00:00
Justin McWilliams
099112f56e Fixing mistakes introduced in r865 for warning output on lines 462 and 667.
git-svn-id: http://munki.googlecode.com/svn/trunk@867 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-26 17:25:33 +00:00
Justin McWilliams
7afec5b605 Better implementation of r863; move verifyFileOnlyWritableByMunkiAndRoot() and runExternalScript() to new munkilib utils module that is 100% free of ObjC-dependant Python.
git-svn-id: http://munki.googlecode.com/svn/trunk@865 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-26 16:32:48 +00:00
Justin McWilliams
93adfde71f managedsoftwareupdate:
- if import of Python module with ObjC binding fails, call "report_broken_client" script where admins can setup desired reporting/notification.


git-svn-id: http://munki.googlecode.com/svn/trunk@863 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-26 13:49:40 +00:00
Justin McWilliams
aacad21154 verifyFileOnlyWritableByMunkiAndRoot()
For gid verification, instead of only checking file gid to match current user oir hardcoded 80, check current user's gid, admin's gid, and wheel's gid all dynamically looked up.


git-svn-id: http://munki.googlecode.com/svn/trunk@862 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-26 13:24:06 +00:00
Justin McWilliams
9a566d108e Move verifyFileOnlyWritableByMunkiAndRoot() from munkicommon to managesoftwareupdate, so it can be used without importing munkicommon.py.
This is in prep of a upcoming notification feature that cannot depend on ObjC Py bindings.  Alternatively, if we want to share such code, we can create a common/util module for only Pure-Python code, and doc that it should not contain any ObjC imports.


git-svn-id: http://munki.googlecode.com/svn/trunk@861 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-26 13:15:13 +00:00
MagerValp
35563cb6e0 Changed ManagedInstallReport.plist timestamps to ISO 8601 format, with timezone information.
git-svn-id: http://munki.googlecode.com/svn/trunk@852 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-25 14:48:03 +00:00
Greg Neagle
131d3873c9 Added some additional logging and info messages, all logoutinstall-type installs (including 'checkandinstallatstartup') now do not check for system idle, but just install.
git-svn-id: http://munki.googlecode.com/svn/trunk@831 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-20 16:57:48 +00:00
Greg Neagle
b78ba8e03c More cleanup -- replacing print statements with calls to munkicommon.display_* methods.
git-svn-id: http://munki.googlecode.com/svn/trunk@820 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-19 17:15:41 +00:00
Greg Neagle
fbb20c5ac5 Tweaks to what gets printed to stdout and stderr during a run; overall effect is to make managedsoftwareupdate quieter by default.
git-svn-id: http://munki.googlecode.com/svn/trunk@819 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-19 17:03:28 +00:00
Greg Neagle
e2ca3f8c78 If there are GUI users and we have forced_* items, recheck munkiUpdatesAvailable() before trying to notifiy the user so we don't notify if we have nothing left to do.
git-svn-id: http://munki.googlecode.com/svn/trunk@818 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-19 04:00:57 +00:00
Greg Neagle
ab3900dffa Missed a place to check the new munkicommon.pref('AppleSoftwareUpdatesOnly')...
git-svn-id: http://munki.googlecode.com/svn/trunk@815 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-18 21:40:06 +00:00
Justin McWilliams
07876be714 First iteration of forced installs/uninstalls.
If pkginfo key forced_(un)install is set to <true/>, (un)installs will run immediately after downloading without any notification the user.  If further non-forced installs are remaining MSU.app will appear after all forced-installs are finished.

This needs documentation about how risky it is; should only be used for simple packages that are known to be safely installed while app is running. More features will come in the future making it safer to use on other packages.



git-svn-id: http://munki.googlecode.com/svn/trunk@814 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-18 21:20:11 +00:00
Justin McWilliams
7f44c0c40e - s/unattended/forced/
- separate forced_installs and forced_uninstalls, so they one can be forced while the other is not.
 - move status output enabling to the only place it's necessary; --auto at login window.
 - move forced install run to top of "GUI user exists" conditional instead of two places within.  (Greg, please verify this is okay).



git-svn-id: http://munki.googlecode.com/svn/branches/unattended-installs@813 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-18 19:08:39 +00:00
Justin McWilliams
dc5c2e373d Run forced/unattended updates before checking if the user should be notified; notify them afterwards if any remaining attended installs remain.
1) disable status output (GUI)
2) run unattended installs
3) reenable status output (GUI)
4) notify user or remaining installs (if LastModifiedDate is happy)

Also, change logging a little to make it easier to see difference between regular install run and unattended run.


git-svn-id: http://munki.googlecode.com/svn/branches/unattended-installs@812 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-18 17:59:06 +00:00
Greg Neagle
c27ba9a3d2 When "AppleSoftwareUpdatesOnly" is True, no need to set "InstallAppleSoftwareUpdates"
git-svn-id: http://munki.googlecode.com/svn/trunk@811 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-18 17:31:50 +00:00
Greg Neagle
14b3241f4d Add support for running the munki tools without a munki repo to install Apple Software Updates only.
git-svn-id: http://munki.googlecode.com/svn/trunk@810 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-18 17:26:37 +00:00
Justin McWilliams
fedb392b9b First iteration of forced/unattended/silent installs.
Notes:
 - Needs documentation about how risky this is, and how it should only be used
for simple packages that are known to be safely installed while app is running.
 - If notification is popped up, it will contain the unattended install; if
notification is not due to be popped up the unattended install will be installed
immediately.
  - Only works in --auto mode (which is what launchd execs); I will test more tomorrow with manual runs, as we may be able to do this before --installonly too.



git-svn-id: http://munki.googlecode.com/svn/branches/unattended-installs@809 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-18 00:25:18 +00:00
Justin McWilliams
41ccc6c3ef Reload preferences from ManagedInstalls.plist after preflight execution in case preflight changed any preferences.
git-svn-id: http://munki.googlecode.com/svn/trunk@754 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-09-13 23:05:56 +00:00
Justin McWilliams
51cb83d350 managedsoftwareupdate: Use single quotes for all non-doctstring and non-heredoc strings.
git-svn-id: http://munki.googlecode.com/svn/trunk@746 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-09-10 03:44:55 +00:00
Justin McWilliams
eeb5bdcb9d Make some global consts for ManagedInstalls(.plist) paths. Replace single-quoted docstrings with double-quotes to standardize across codebase.
git-svn-id: http://munki.googlecode.com/svn/trunk@743 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-09-10 01:05:37 +00:00
Justin McWilliams
1ca7fc80e8 Merge: Verify permissions of preflight and postflight scripts are secure before; skip execution of insecure skips but continue Munki run.
git-svn-id: http://munki.googlecode.com/svn/trunk@738 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-09-09 21:42:27 +00:00
Greg Neagle
6e308faf40 Misc cleanups
git-svn-id: http://munki.googlecode.com/svn/trunk@732 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-09-07 23:18:47 +00:00
Justin McWilliams
1465884431 pylint cleanup and docstring updates for managedsoftwareupdate.
git-svn-id: http://munki.googlecode.com/svn/trunk@729 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-09-07 19:28:27 +00:00
Greg Neagle
121ecb0484 munkicommon: pylint cleanup, better handling of items in the pkgutil database that don't have a version number (I didn't know this was possible!).
appleupdates: pylint cleanup; provide installed_size data for Managed Software Update display

managedsoftwareupdate: move "Checking for available Apple Software Updates..." message to appleupdates.checkForSoftwareUpdates()

makepkginfo: fix installer_item_size determination when we add up the contents of a directory (was bytes, now Kbytes like everything else)

git-svn-id: http://munki.googlecode.com/svn/trunk@725 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-09-07 18:04:40 +00:00
Greg Neagle
86cbaee5da If the user clicks the Stop button during an update check, don't check for Apple Software Updates.
git-svn-id: http://munki.googlecode.com/svn/trunk@694 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-08-27 15:11:02 +00:00
Greg Neagle
255271ed6e Fixed use of new munki pref "SuppressUserNotification" in managedsoftwareupdate
git-svn-id: http://munki.googlecode.com/svn/trunk@664 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-08-14 18:22:46 +00:00