Skip to content

Commit 7f3a3d1

Browse files
authored
Fix Issue #2148: loadups fail on WSL1 with Xvnc server errors - fixed by adding new flag to medley script, use this flag in loadup script (#2163)
* Fix Issue #2155 (loadup -f -b -x fails can't find full.sysout). Reordered loadup so that the sysouts are copied to loadups before loadup-aux and loadup-db are run, and that the product of loadup-aux are copied to loadups before loadup-db is run -- all to make sure that the right prerequisites are available in loadups when needed. Also forced a run of loadup-aux if full.sysout is newer than exports.all when -db is specified. * Fix Issue 2148 - loadups fail on WSL1 with Xvnc server error. Root cause of 2148 is that certain Medley sessions in loadups run very quickly - less that a second or 2. This causes the medley script to improperly detect an Xvnc server error. Fixed by adding a cli flag --automation that forces the medley script to skip the check for Xvnc server errors. Changed loadup script to call medley with this flag set. Also add a cl flag to loadup --forcevnc that forces loadup to use vnc even on WSL2. This is intended for testing purposes only.
1 parent 30af8ea commit 7f3a3d1

File tree

10 files changed

+47
-4
lines changed

10 files changed

+47
-4
lines changed

docs/man-page/man_medley.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,15 @@ <h2>Flags</h2>
284284
<p>On Windows/Cygwin installations, <em>FILE</em> is specified in the
285285
Medley file system, not the host Windows file system.</p>
286286
</dd>
287+
<dt>-am, –automation</dt>
288+
<dd>
289+
<p>Useful only when using –vnc (and always on WSL1). When calling medley
290+
as part of an automation script, often Medley will run for a very short
291+
time (&lt; a couple of seconds). This can cause issues with medley code
292+
that detects Xvnc server failures. Setting this flag notifies Medley
293+
that very short Medley sessions are possible and the Xvnc error
294+
detection needs to be adjusted accordingly.</p>
295+
</dd>
287296
</dl>
288297
<h2>Other Options</h2>
289298
<dl>

docs/man-page/medley.1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,15 @@ environment variable LDEREPEATCM.
386386
On Windows/Cygwin installations, \f[I]FILE\f[R] is specified in the
387387
Medley file system, not the host Windows file system.
388388
.RE
389+
.TP
390+
-am, \[en]automation
391+
Useful only when using \[en]vnc (and always on WSL1).
392+
When calling medley as part of an automation script, often Medley will
393+
run for a very short time (< a couple of seconds).
394+
This can cause issues with medley code that detects Xvnc server
395+
failures.
396+
Setting this flag notifies Medley that very short Medley sessions are
397+
possible and the Xvnc error detection needs to be adjusted accordingly.
389398
.SS Other Options
390399
.PP
391400
\

docs/man-page/medley.1.gz

176 Bytes
Binary file not shown.

docs/man-page/medley.1.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ specified in the Medley file system, not the host Windows file system.
216216
If the given value is "-", Medley will start up without using REM&#46;CM file.
217217

218218
There is no default Medley REM&#46;CM file.
219-
219+
220220
On Windows/Cygwin installations, *FILE* is
221221
specified in the Medley file system, not the host Windows file system.
222222

@@ -254,10 +254,15 @@ for the parameter will be reset to the default value - which in the case of *Hos
254254

255255
-cc \[*FILE* | -], \-\-repeat \[*FILE* | -]
256256
: Run Medley once. And then as long as *FILE* exists and is greater then zero length, repeatedly run Medley using *FILE* as the REM&#46;CM file that Medley reads and executes at startup. Each run of Medley can change the contents of *FILE* to effect the subsequent run of Medley. To end the cycle, Medley needs to delete *FILE*. WIthin Medley, *FILE* can be found as the value of the environment variable LDEREPEATCM.
257-
257+
258258
On Windows/Cygwin installations, *FILE* is
259259
specified in the Medley file system, not the host Windows file system.
260260

261+
-am, --automation
262+
: Useful only when using --vnc (and always on WSL1). When calling medley as part of an automation script, often Medley
263+
will run for a very short time (< a couple of seconds). This can cause issues with medley code that detects Xvnc server failures.
264+
Setting this flag notifies Medley that very short Medley sessions are possible and the Xvnc error detection needs to be adjusted accordingly.
265+
261266

262267
Other Options
263268
-------------

scripts/loadups/loadup

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@ main() {
157157
# internal
158158
noendmsg=true
159159
;;
160+
--forcevnc)
161+
# internal - for testing
162+
# WSL only -otherwise warning msg from medley
163+
force_vnc="+"
164+
;;
160165
-z | -man | --man )
161166
if [ "$(uname)" = "Darwin" ]
162167
then

scripts/loadups/loadup-setup.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ loadup_finish () {
161161
exit ${exit_code}
162162
}
163163

164+
force_vnc="-"
164165
run_medley () {
165166
/bin/sh "${MEDLEYDIR}/scripts/medley/medley.command" \
166167
--config - \
@@ -171,6 +172,8 @@ run_medley () {
171172
--rem.cm "${cmfile}" \
172173
--greet "${initfile}" \
173174
--sysout "$1" \
175+
--automation \
176+
--vnc "${force_vnc}" \
174177
"$2" "$3" "$4" "$5" "$6" "$7" ;
175178
exit_code=$?
176179
}

scripts/medley/medley.command

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,8 @@ flags:
586586
587587
-x - | --logindir - : use MEDLEYDIR/logindir as LOGINDIR in Medley
588588
589+
-am | --automation : this call to medley is being used in automation, adjust timings. Relevant in -vnc case only.
590+
589591
-cm FILE | --rem.cm FILE : use FILE as the REM.CM when starting up Medley. FILE must be absolute pathname.
590592
591593
-cm - | --rem.cm - : do not use an REM.CM. Negate any prior setting, e.g., from config file.
@@ -638,6 +640,7 @@ pixelscale_arg=""
638640
borderwidth_arg=""
639641
remcm_arg="${LDEREMCM}"
640642
repeat_cm=""
643+
automation=false
641644
642645
# Add marker at end of args so we can accumulate pass-on args in args array
643646
set -- "$@" "--start_of_pass_args"
@@ -915,6 +918,9 @@ do
915918
fi
916919
exit 0
917920
;;
921+
-am | --automation)
922+
automation=true
923+
;;
918924
-nf | -NF | --nofork)
919925
# for use in loadups
920926
case $2 in
@@ -1702,7 +1708,7 @@ do
17021708
"$(ip_addr)":"${VNC_PORT}" \
17031709
>>"${LOG}" 2>&1 &
17041710
wait $!
1705-
if [ $(( $(date +%s) - start_time )) -lt 5 ]
1711+
if [ "${automation}" = false ] && [ $(( $(date +%s) - start_time )) -lt 5 ]
17061712
then
17071713
if [ -z "$(pgrep -f "Xvnc ${DISPLAY}")" ]
17081714
then

scripts/medley/medley_args.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ pixelscale_arg=""
4848
borderwidth_arg=""
4949
remcm_arg="${LDEREMCM}"
5050
repeat_cm=""
51+
automation=false
5152

5253
# Add marker at end of args so we can accumulate pass-on args in args array
5354
set -- "$@" "--start_of_pass_args"
@@ -325,6 +326,9 @@ do
325326
fi
326327
exit 0
327328
;;
329+
-am | --automation)
330+
automation=true
331+
;;
328332
-nf | -NF | --nofork)
329333
# for use in loadups
330334
case $2 in

scripts/medley/medley_usage.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ flags:
115115
116116
-x - | --logindir - : use MEDLEYDIR/logindir as LOGINDIR in Medley
117117
118+
-am | --automation : this call to medley is being used in automation, adjust timings. Relevant in -vnc case only.
119+
118120
-cm FILE | --rem.cm FILE : use FILE as the REM.CM when starting up Medley. FILE must be absolute pathname.
119121
120122
-cm - | --rem.cm - : do not use an REM.CM. Negate any prior setting, e.g., from config file.

scripts/medley/medley_vnc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@
215215
"$(ip_addr)":"${VNC_PORT}" \
216216
>>"${LOG}" 2>&1 &
217217
wait $!
218-
if [ $(( $(date +%s) - start_time )) -lt 5 ]
218+
if [ "${automation}" = false ] && [ $(( $(date +%s) - start_time )) -lt 5 ]
219219
then
220220
if [ -z "$(pgrep -f "Xvnc ${DISPLAY}")" ]
221221
then

0 commit comments

Comments
 (0)