[Vm-dev] Unix socket plugin patch for systemd

Max Leske maxleske at gmail.com
Thu May 2 20:13:45 UTC 2013

> On Thu, May 02, 2013 at 05:22:07PM +0200, Max Leske wrote:
> > 
> > We've created a patch for the unix socket plugin that allows for socket activation via systemd.
> > 
> > This is how it works:
> > 1. tell systemd to link a socket to the vm (e.g. 8080)
> > 2. send a request to the socket
> > 3. systemd will launch the vm and hold the request until the image is connected to the port
> > 4. (here's where the patch comes in) connect to the socket in the image (e.g. by starting WAKom - WAKom startOn: 8080)
> > 
> > The patch is necessary because the primitive would fail when connecting to the socket (the plugin thinks that the socket is already in use).
> > 
> > So here's my question: who is responsible for the plugin or would like to integrate the patch?
> Hi Max,
> You've come to the right place. I'm guessing that your patches involve both the Smalltalk
> (slang) and the platform C code. 

Yes, correct. The (hacky) version right now adds a new type of socket for systemd (now new primitive, maybe you'll want to do that). Then on the image side there's a bit of logic to determine the kind of socket and a consistency check of the systemd environment variable. So all in all it's really quite simple.

> If so, it may be easiest if you just post the patches to the list for starters, and then we can sort out what needs to be done by whom. 

I'll try to post the patches next week.

> Please also let us know which code base you are working with (trunk interpreter VM, Cog, other?).

We use the 4.0.3-2202 interpreter VM and patched the plugin there for now. We also took a look at the newest version from http://gitorious.org/cogvm/blessed/trees/master/platforms/unix/plugins/SocketPlugin and found that there weren't many differences. So we thought to apply the patch to that file. I think it shouldn't be much work to backport the patch to the interpreter VM after that (?).

Actually, now that I think about it, it would probably make more sense to patch the interpreter VM trunk. That makes it easier for us to test before we post it. Anyway, I'll get back to you.

> For more information on contributing to the Unix VM, see Ian's documentation here:
>   http://squeakvm.org/unix/download.html#caveats
>   http://squeakvm.org/cgi-bin/viewvc.cgi/squeak/trunk/platforms/unix/doc/README.Contributing?view=markup
> There are currently several branches of VM development that will be impacted by
> a change to SocketPlugin, so we'll make sure they all get updated appropriately.

That would be awesome!

> Thanks!
> Dave

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20130502/50aa5cce/attachment.htm

More information about the Vm-dev mailing list