[squeak-dev] [almost fixed] Re: Using squeak rfb/vnc server with unix server stuff

tim Rowledge tim at rowledge.org
Thu Sep 12 20:34:51 UTC 2019



> On 2019-09-11, at 6:59 PM, Chris Muller <ma.chris.m at gmail.com> wrote:
> 
> Heh, that's funny.  :)  Recall, daemontools simply runs the "run" script in the service directory, so what happens if you try running it in the foreground tty?
> 
>    sudo ./log/run

Hmm, well it complains about the non-existence of user 'multilog', which tallies with a suggestion I found online to run
 `ps -aux | grep readproctitle`
which resulted in the barely readable -

root       386  0.0  0.0   1668   304 ?        S    Sep11   1:13 readproctitle service errors: ...start service/run: file does not exist supervise: fatal: unable to start supervise/run: file does not exist supervise: fatal: unable to start service/run: file does not exist setuidgid: fatal: unknown account multilog supervise: fatal: unable to start supervise/run: file does not exist setuidgid: fatal: unknown account multilog supervise: fatal: unable to start service/run: file does not exist 

The first weird bit in this is that since multilog is a program and not a user account we have to suspect some aspect of the script ie
"exec setuidgid $WHOAMI multilog t ./main"
from ./log/run

The weird bit *here* is that your configsvc script is clearly expecting to create the log/run script with the $WHOAMI already substituted (in my case with 'pi'). The next line in configsvc correctly uses the $WHOAMI value to set the file ownership. 

It looks like the export of the configsvc script is not doing what is expected and missing quotes around the $WHOAMI. Indeed if I manually surround the $WHOAMI with single quotes it now magically creates a correct log/run file. As best I can tell, fixing SSRepository>configsvc solves this particular issue. See a) below.

OK, part b) Why is there not yet a visible log in log/main even after making the multilog stuff run without whining?
From man multilog it seems that 
mulitilog t ./main
is supposed to handle auto-rotated log files named 'current' in the directory .log/main and stick a timestamp in front of each entry.
Ah; good old file caching nonsense. Simply using
FileStream stdout nextPutAll: 'hello2'; cr
is not good enough.
FileStream stdout nextPutAll: 'hello2'; cr; flush
actually flushes  something to the log file. Hooray.

We still have a problem with `ps -aux | grep readproctitle` claiming - 
supervise/run: file does not exist
It's not the most helpful error message I've ever seen since it doesn't give a full path but if we assume it refers to the 'supervise' directory within the squeaksource working directory then yeah, there is no run file. Is there supposed to be? I'm not getting a clear picture from whacking google around.

Time for a break. My brains are melting.

tim
----------------------
a) fix for 
SSRepository>configsvc
	"One time setup creates daemontools service and starts it."
	^ '#!/bin/bash
WHOAMI=`whoami`

echo creating rotated log/main directory...
mkdir -p log/main
chmod o-rwx log/main

echo --- generate log/run script
echo ''#!/bin/bash
exec 2>&1
exec setuidgid ''$WHOAMI'' multilog t ./main'' > $PWD/log/run
sudo chown -R $WHOAMI log
sudo chmod 750 log/run

echo --- create Repository if not already existing...
./vm/bin/squeak -vm display=none ss.image configsvc.st $1 $WHOAMI > configsvc.out 2>&1

echo installing daemon, it will start...
sudo ln -s $PWD /etc/service/`basename $PWD`
sleep 7
sudo svstat /service/`basename $PWD`' ->
		[ Smalltalk runAndQuit:
			[ : whoami | SSRepository
				ensureRepositoryIfNoneCreateNewNamed: 'Personal SqueakSource'
				administeredBy: whoami ] 
{it's just the doubled-up single quotes around $WHOAMI}

--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Fractured Idiom:- HASTE CUISINE - Fast French food




More information about the Squeak-dev mailing list