File: StartUpdateProcess.m

package info (click to toggle)
psychtoolbox-3 3.0.9%2Bsvn2579.dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 63,408 kB
  • sloc: ansic: 73,310; cpp: 11,139; objc: 3,129; sh: 1,669; python: 382; php: 272; makefile: 172; java: 113
file content (55 lines) | stat: -rw-r--r-- 2,170 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
function wasRunning = StartUpdateProcess

% wasRunning = StartUpdateProcess
%
% OS X: ___________________________________________________________________
%
% If the OS X update process is running then just return 1.  Otherwise
% start the update process and return 0.   
%
% Because the update process runs as root, StartUpdateProcess requires a
% password be entered.
%
% Note that StartUpdateProcess first checks to be sure that the update
% process is running before launching one, so there is no danger of it
% starting an additional update process if one is already running
%
% OS 9: ___________________________________________________________________
%
% StartUpdateProcess does not exist in OS 9. 
%
% WINDOWS: ________________________________________________________________
% 
% StartUpdateProcess does not exist in Windows.
% 
% _________________________________________________________________________
%
% see also: IsUpdateRunning, Rush, Priority

% HISTORY
% 1/8/04    awi     Wrote it.
% 7/15/04   awi     Improved documentation.     


%first check to see if the update process is running
wasRunning=IsUpdateRunning;
if wasRunning>1
    % This should never happen.
    warning('More than one update process is running.  There should be only one.');
    return;
elseif wasRunning==1
    return;
else % it was not running
%     fprintf('The OS X system update process has been halted to prevent interruption of MATLAB during "Rush" and "Priority" commands.\n');
%     fprintf('If the update process is not running then the Psychtoolbox automatically restarts the update process when MATLAB\n');
%     fprintf('exits.  Starting the MATLAB process requires the system administrator password.  To restart update process, enter\n');
%     fprintf('the system administrator password at the prompt.  You can also start the update process by entering at the\n');
%     fprintf('Terminal shell prompt:\n');
%     fprintf('\tsudo update\n');
%     fprintf('From the shell you can check to see if the update process is running by issueing the command:\n');
%     fprintf('\tps -awx | grep update\n');
%     fprintf('\n');
    unix('sudo /usr/sbin/update');
end