[squeak-dev] Squeak/Seaside on a no-GUI remote host

Ragnar Hojland Espinosa ragnar at ragnar-hojland.com
Fri Jul 4 20:24:56 UTC 2008


On Fri, Jul 4, 2008 at 10:00 PM, John Chandler <morph at growler.net> wrote:
> I have shell (ssh) access to a Debian host that has a DNS-able
> address, but no X-server.  The little I've done in Squeak has all been
> from the GUI, which depends on X or a similar console GUI, which I
> don't have access to.  I mean, *theoretically,* I could run X, but I
> seriously doubt I could get it to display on my machine, which lives
> on a private net in a residential setting.
>
> It must be possible to develop for Squeak/Seaside under these
> conditions, but it's not clear to me what the best way would be.
> Clues?

What I do when I have a remote image that needs to be taken care of is
run Xvnc on the server and then just vnc. But as I mostly do seaside I
develop locally and when I'm done I put the changes on a ftp server
through monticello. I have this in the image as a class method:

updateFromRepository
	| repository fileNames sortedFileNames lastVersion |

	repository _ MCFtpRepository
		host: 'hostname:portnumber'
		directory: 'mc-trunk'
		user: 'username'
		password: 'password'.
	fileNames _ repository allFileNames.

	sortedFileNames _ fileNames asSortedCollection sortBlock: [ :a :b |
		(('Surveyor-RHE.*.mcz' match: a) and: ['Surveyor-RHE.*.mcz' match: b])
			ifTrue: [ ((a subStrings: '.') second asInteger) > ((b subStrings:
'.') second asInteger) ]
			ifFalse: [ a > b ]  ].
	
	lastVersion _ sortedFileNames detect: [:ea | 'Surveyor-RHE.*.mcz'
match: ea ] ifNone: [ ^ nil "umm... we are headless..." ].
	repository readStreamForFileNamed: lastVersion do: [ :s |
MczInstaller installStream: s reset ]


and then, I have an update-sv.sq file with:

SVMain updateFromRepository notNil
       ifTrue: [SVConnectionPool initialize. (SmalltalkImage current)
snapshot: true andQuit: true ]
       ifFalse: [ (SmalltalkImage current) snapshot: false andQuit: true ].


and an update-sv.sh file with:

#!/bin/bash
killall vncserver vncconfig squeak Xvnc
sleep 2
killall -KILL vncserver vncconfig squeak Xvnc
rm -f /tmp/.X1-lock -R /tmp/.X11-unix/X1 -R

cp base/surveyor.* .
vncserver
TSPRE=`ls --full-time --numeric surveyor.2.image | awk '{ print $6 " " $7 }'`
./squeak -memory 115m -mmap 115m -nosound -display :1 surveyor.2.image
/usr/local/squeak/update-sv.sq
TSPOST=`ls --full-time --numeric surveyor.2.image | awk '{ print $6 " " $7 }'`

if [ "$TSPRE" = "$TSPOST" ];
then
        echo Update failed.
else
        echo "Update successful; remember to restart it."
fi

killall -KILL vncserver vncconfig Xvnc
rm -f /tmp/.X1-lock /tmp/.X11-unix/X1 -R


So the bash script copies a base image, calls the squeak script that
in turn looks for the biggest monticello version in the respository,
applies it, and the bash script does a bit of a check.

Yes, It's rather rough and crude and may eat servers for lunch :)
-- 
Ragnar



More information about the Squeak-dev mailing list