Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
05ba0daf
Commit
05ba0daf
authored
Jun 19, 2013
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use interactive vnc shell to run system upgrade
System upgrade almost always requires user input.
parent
03d19bdc
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
69 additions
and
71 deletions
+69
-71
APT.pm
PVE/API2/APT.pm
+0
-51
Nodes.pm
PVE/API2/Nodes.pm
+19
-1
Utils.js
www/manager/Utils.js
+0
-1
VNCConsole.js
www/manager/VNCConsole.js
+21
-6
Workspace.js
www/manager/Workspace.js
+9
-1
APT.js
www/manager/node/APT.js
+13
-7
Config.js
www/manager/node/Config.js
+7
-4
No files found.
PVE/API2/APT.pm
View file @
05ba0daf
...
...
@@ -60,7 +60,6 @@ __PACKAGE__->register_method({
my
$res
=
[
{
id
=>
'
update
'
},
{
id
=>
'
upgrade
'
},
{
id
=>
'
changelog
'
},
];
...
...
@@ -254,56 +253,6 @@ __PACKAGE__->register_method({
}});
__PACKAGE__
->
register_method
({
name
=>
'
upgrade
',
path
=>
'
upgrade
',
method
=>
'
POST
',
description
=>
"
Install the newest versions of all packages (apt-get dist-upgrade).
",
permissions
=>
{
check
=>
['
perm
',
'
/nodes/{node}
',
[
'
Sys.Modify
'
]],
},
protected
=>
1
,
proxyto
=>
'
node
',
parameters
=>
{
additionalProperties
=>
0
,
properties
=>
{
node
=>
get_standard_option
('
pve-node
'),
},
},
returns
=>
{
type
=>
'
string
',
},
code
=>
sub
{
my
(
$param
)
=
@_
;
my
$rpcenv
=
PVE::RPCEnvironment::
get
();
my
$authuser
=
$rpcenv
->
get_user
();
my
$realcmd
=
sub
{
my
$upid
=
shift
;
my
$cmd
=
['
apt-get
',
'
dist-upgrade
',
'
--assume-yes
'];
push
@$cmd
,
'
-o
',
'
Dpkg::Options::=--force-confdef
';
push
@$cmd
,
'
-o
',
'
Dpkg::Options::=--force-confold
';
print
"
starting apt-get dist-upgrade
\n
";
$ENV
{
DEBIAN_FRONTEND
}
=
'
noninteractive
';
PVE::Tools::
run_command
(
$cmd
);
&
$update_pve_pkgstatus
();
return
;
};
return
$rpcenv
->
fork_worker
('
aptupgrade
',
undef
,
$authuser
,
$realcmd
);
}});
__PACKAGE__
->
register_method
({
name
=>
'
changelog
',
path
=>
'
changelog
',
...
...
PVE/API2/Nodes.pm
View file @
05ba0daf
...
...
@@ -576,6 +576,12 @@ __PACKAGE__->register_method ({
additionalProperties
=>
0
,
properties
=>
{
node
=>
get_standard_option
('
pve-node
'),
upgrade
=>
{
type
=>
'
boolean
',
description
=>
"
Run 'apt-get dist-upgrade' instead of normal shell.
",
optional
=>
1
,
default
=>
0
,
},
},
},
returns
=>
{
...
...
@@ -597,6 +603,8 @@ __PACKAGE__->register_method ({
raise_perm_exc
("
realm != pam
")
if
$realm
ne
'
pam
';
raise_perm_exc
('
user != root@pam
')
if
$param
->
{
upgrade
}
&&
$user
ne
'
root@pam
';
my
$node
=
$param
->
{
node
};
my
$authpath
=
"
/nodes/
$node
";
...
...
@@ -619,7 +627,17 @@ __PACKAGE__->register_method ({
my
$remcmd
=
$remip
?
['
/usr/bin/ssh
',
'
-t
',
$remip
]
:
[]
;
my
$shcmd
=
$user
eq
'
root@pam
'
?
[
"
/bin/bash
",
"
-l
"
]
:
[
"
/bin/login
"
];
my
$shcmd
;
if
(
$user
eq
'
root@pam
')
{
if
(
$param
->
{
upgrade
})
{
$shcmd
=
[
'
/bin/bash
',
'
-l
',
'
-c
',
'
apt-get dist-upgrade; /bin/bash
'
];
}
else
{
$shcmd
=
[
'
/bin/bash
',
'
-l
'
];
}
}
else
{
$shcmd
=
[
'
/bin/login
'
];
}
my
$timeout
=
10
;
...
...
www/manager/Utils.js
View file @
05ba0daf
...
...
@@ -503,7 +503,6 @@ Ext.define('PVE.Utils', { statics: {
download
:
[
''
,
gettext
(
'
Download
'
)
],
vzdump
:
[
''
,
gettext
(
'
Backup
'
)
],
aptupdate
:
[
''
,
gettext
(
'
Update package database
'
)
],
aptupgrade
:
[
''
,
gettext
(
'
System upgrade
'
)
],
startall
:
[
''
,
gettext
(
'
Start all VMs and Containers
'
)
],
stopall
:
[
''
,
gettext
(
'
Stop all VMs and Containers
'
)
]
},
...
...
www/manager/VNCConsole.js
View file @
05ba0daf
...
...
@@ -417,6 +417,8 @@ Ext.define('PVE.Shell', {
extend
:
'
PVE.VNCConsole
'
,
alias
:
[
'
widget.pveShell
'
],
ugradeSystem
:
false
,
// set to true to run "apt-get dist-upgrade"
initComponent
:
function
()
{
var
me
=
this
;
...
...
@@ -432,24 +434,37 @@ Ext.define('PVE.Shell', {
var
applet
=
Ext
.
getDom
(
me
.
appletID
);
applet
.
sendRefreshRequest
();
}
},
}
];
if
(
!
me
.
ugradeSystem
)
{
// we dont want to restart the upgrade script
tbar
.
push
([
{
text
:
gettext
(
'
Reload
'
),
handler
:
function
()
{
me
.
reloadApplet
();
}
},
}]);
}
tbar
.
push
([
{
text
:
gettext
(
'
Shell
'
),
handler
:
function
()
{
PVE
.
Utils
.
openConoleWindow
(
'
shell
'
,
undefined
,
me
.
nodename
);
}
}
];
]);
Ext
.
apply
(
me
,
{
tbar
:
tbar
,
url
:
"
/nodes/
"
+
me
.
nodename
+
"
/vncshell
"
});
if
(
me
.
ugradeSystem
)
{
me
.
params
=
{
upgrade
:
1
};
}
me
.
callParent
();
}
});
www/manager/Workspace.js
View file @
05ba0daf
...
...
@@ -141,12 +141,20 @@ Ext.define('PVE.ConsoleWorkspace', {
toplevel
:
true
};
}
else
if
(
consoleType
===
'
shell
'
)
{
me
.
title
=
"
node '
"
+
param
.
node
;
me
.
title
=
"
node '
"
+
param
.
node
+
"
'
"
;
content
=
{
xtype
:
'
pveShell
'
,
nodename
:
param
.
node
,
toplevel
:
true
};
}
else
if
(
consoleType
===
'
upgrade
'
)
{
me
.
title
=
Ext
.
String
.
format
(
gettext
(
'
System upgrade on node {0}
'
),
"
'
"
+
param
.
node
+
"
'
"
);
content
=
{
xtype
:
'
pveShell
'
,
nodename
:
param
.
node
,
ugradeSystem
:
true
,
toplevel
:
true
};
}
else
{
content
=
{
border
:
false
,
...
...
www/manager/node/APT.js
View file @
05ba0daf
...
...
@@ -80,15 +80,21 @@ Ext.define('PVE.node.APT', {
var
upgrade_btn
=
new
PVE
.
button
.
Button
({
text
:
gettext
(
'
Upgrade
'
),
dangerous
:
true
,
confirmMsg
:
function
(
rec
)
{
return
gettext
(
'
Are you sure you want to upgrade this node?
'
);
},
handler
:
function
(){
PVE
.
Utils
.
checked_command
(
function
()
{
apt_command
(
'
upgrade
'
);
});
disabled
:
!
(
PVE
.
UserName
&&
PVE
.
UserName
===
'
root@pam
'
),
handler
:
function
()
{
PVE
.
Utils
.
checked_command
(
function
()
{
var
url
=
Ext
.
urlEncode
({
console
:
'
upgrade
'
,
node
:
nodename
});
var
nw
=
window
.
open
(
"
?
"
+
url
,
'
_blank
'
,
"
innerWidth=745,innerheight=427
"
);
nw
.
focus
();
});
}
});
var
show_changelog
=
function
(
rec
)
{
if
(
!
rec
||
!
rec
.
data
||
!
(
rec
.
data
.
ChangeLogUrl
&&
rec
.
data
.
Package
))
{
return
;
...
...
www/manager/node/Config.js
View file @
05ba0daf
...
...
@@ -144,14 +144,17 @@ Ext.define('PVE.node.Config', {
itemId
:
'
support
'
,
xtype
:
'
pveNodeSubscription
'
,
nodename
:
nodename
},
{
}
]);
if
(
caps
.
nodes
[
'
Sys.Console
'
])
{
me
.
items
.
push
([{
title
:
gettext
(
'
Updates
'
),
itemId
:
'
apt
'
,
xtype
:
'
pveNodeAPT
'
,
nodename
:
nodename
}]);
}
]);
me
.
callParent
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment