Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
ssh_scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sofiane Bendoukha
ssh_scripts
Commits
596d82d2
Commit
596d82d2
authored
5 years ago
by
Mathis Rosenhauer
Browse files
Options
Downloads
Patches
Plain Diff
start-vnc: CLI option for server options
parent
7c776d32
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
start-vnc
+21
-20
21 additions, 20 deletions
start-vnc
with
21 additions
and
20 deletions
start-vnc
+
21
−
20
View file @
596d82d2
...
...
@@ -68,13 +68,14 @@ SVNC_USERNAME="$(id -un)"
#
# If your local vnc client is not in the search path or named
# differently (e.g. TurboVNC, macOS), then change this parameter.
SVNC_
VNCVIEWER
=
"vncviewer"
SVNC_
CLIENT
=
"vncviewer"
#
Resolution of remote desktop window
#
Server options
#
# This is just the initial resolution. Resizing the vncviewer window
# later should also work.
SVNC_GEOMETRY
=
"1920x1200"
# More options for the vncserver. TurboVNC on A Mac may produce
# a 'javax.net.ssl.SSLHandshakeException' in this case adding
# ' -securitytypes none' to SVNC_SERVER_OPTIONS may help.
SVNC_SERVER_OPTIONS
=
"-geometry1920x1200"
# Session run time in minutes
SVNC_RUNTIME
=
240
...
...
@@ -96,7 +97,7 @@ SVNC_CONSTRAINT=""
# implementation of ssh which dosen't support public key auth among other
# things.
#
# readonly SVNC_
VNC
_OPTIONS="-extssh"
# readonly SVNC_
CLIENT
_OPTIONS="-extssh"
# Frontend host
#
...
...
@@ -150,9 +151,9 @@ Available values for OPTION include:
-A acctcode acctcode of job
-C list constraint for feature selection
-g geometry initial geometry of vnc window
-n nodes number of nodes
-q qos job qos
-s options addidtional options for vncserver
-t time job runtime
-u username use username for login
-v path path to vncviewer program
...
...
@@ -172,25 +173,25 @@ ssh_frontend () {
parse_options
()
{
local
option
while
getopts
'A:C:
g:
n:q:t:u:v:x:'
option
;
do
while
getopts
'A:C:n:q:
s:
t:u:v:x:'
option
;
do
case
${
option
}
in
A
)
SVNC_ACCTCODE
=
"
$OPTARG
"
;;
C
)
SVNC_CONSTRAINT
=
"
$OPTARG
"
;;
g
)
SVNC_GEOMETRY
=
"
$OPTARG
"
;;
n
)
SVNC_NODES
=
"
$OPTARG
"
;;
q
)
SVNC_QOS
=
"
$OPTARG
"
;;
s
)
SVNC_SERVER_OPTIONS
=
"
$OPTARG
"
;;
t
)
SVNC_RUNTIME
=
"
$OPTARG
"
;;
u
)
SVNC_USERNAME
=
"
$OPTARG
"
;;
v
)
SVNC_
VNCVIEWER
=
"
$OPTARG
"
v
)
SVNC_
CLIENT
=
"
$OPTARG
"
;;
x
)
SVNC_
VNC
_OPTIONS
=
"
$OPTARG
"
x
)
SVNC_
CLIENT
_OPTIONS
=
"
$OPTARG
"
;;
?
)
usage
exit
1
...
...
@@ -200,12 +201,12 @@ parse_options () {
readonly
SVNC_ACCTCODE
readonly
SVNC_CONSTRAINT
readonly
SVNC_
GEOMETRY
readonly
SVNC_
SERVER_OPTIONS
readonly
SVNC_QOS
readonly
SVNC_RUNTIME
readonly
SVNC_USERNAME
readonly
SVNC_
VNCVIEWER
readonly
SVNC_
VNC
_OPTIONS
readonly
SVNC_
CLIENT
readonly
SVNC_
CLIENT
_OPTIONS
if
[[
-z
${
SVNC_ACCTCODE
}
]]
;
then
printf
"ERROR: Please specify an acctcode.
\n\n
"
>
&2
...
...
@@ -246,7 +247,7 @@ ${sbatch_resources}
#SBATCH --parsable
#SBATCH --dkrzepilog=0
cd
\$
{HOME}
/opt/TurboVNC/bin/vncserver -fg -
geometry "
${
SVNC_GEOMETRY
}
" -localhost -securitytypes none
/opt/TurboVNC/bin/vncserver -fg -
localhost
${
SVNC_SERVER_OPTIONS
}
EOF
}
...
...
@@ -292,15 +293,15 @@ main () {
-Nf
\
"
${
SVNC_USERNAME
}
@
${
vnc_host
}
.dkrz.de"
;
local
vnc
_options
vnc
_options
=
"
${
SVNC_
VNC
_OPTIONS
:-}
"
local
client
_options
client
_options
=
"
${
SVNC_
CLIENT
_OPTIONS
:-}
"
if
[[
${
SVNC_PASSWORD
}
=
"true"
]]
;
then
echo
"Fetching password from frontend."
ssh_frontend
"cat .vnc/passwd"
>
vnc_passwd
vnc
_options+
=
" -passwd vnc_passwd"
client
_options+
=
" -passwd vnc_passwd"
fi
echo
"Connecting vncviewer to
${
vnc_host
}
.dkrz.de"
"
${
SVNC_
VNCVIEWER
}
"
${
vnc
_options
}
:
${
vnc_display
}
"
${
SVNC_
CLIENT
}
"
${
client
_options
}
:
${
vnc_display
}
}
main
"
$@
"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment