<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 03.12.2014, at 19:22, Chris Cunnington &lt;<a href="mailto:brasspen@gmail.com" class="">brasspen@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Dec 3, 2014, at 12:28 PM, Max Leske &lt;<a href="mailto:maxleske@gmail.com" class="">maxleske@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Chris<div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 03.12.2014, at 16:22, Chris Cunnington &lt;<a href="mailto:brasspen@gmail.com" class="">brasspen@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">In July <a href="http://netstyle.ch/" class="">netstyle.ch</a> said some exciting things about systemd and socket activation. [1] I have an observation and a question.&nbsp;</div><div class="">The observation is that to set Real Time Priority pursuant of the README for Cog you need to add the following in your Service or you will not be able to start coglinuxht. [2]&nbsp;</div><div class=""><br class=""></div><div class="">[Service]</div><div class="">LimitRTPRIO=2</div><div class=""><br class=""></div><div class="">The question concerns the code in the systemd.cs file [4] which I don't think can work because it calls a non-existant primitive in the SocketPlugin. I suspect <a href="http://netstyle.ch/" class="">netstyle.ch</a> wrote its patch for a very old virtual machine, one that still used #primitiveSocketCreate3Semaphores, which I don't think exists in contemporary SocketPlugin code. [3] In the image, there remain references to this non-existant primitive. They are employed by code in the systemd.cs file.[4] The culprit is Socket&gt;&gt;initialize: used in Socket class&gt;&gt;newSystemd.&nbsp;</div></div></div></blockquote><div class=""><br class=""></div><div class="">It seems you are right. We did use a Pharo1.3 image with an older VM to test the patch. However, I’m sure that we used the latest version from trunk for the patch (which was 3016 at the time). Also, if I’m not looking in the wrong place, that primitive is still there:&nbsp;<a href="http://squeakvm.org/cgi-bin/viewvc.cgi/squeak/trunk/src/plugins/SocketPlugin/SocketPlugin.c?view=log" class="">http://squeakvm.org/cgi-bin/viewvc.cgi/squeak/trunk/src/plugins/SocketPlugin/SocketPlugin.c?view=log</a>.</div><div class=""><br class=""></div><div class="">Does that resolve the issue? If not, please get back to me and I’ll try to fix the situation.</div></div></div></div></div></blockquote><div class=""><br class=""></div>Hi Max,&nbsp;</div><div class=""><br class=""></div><div class="">Thank you very much for your quick response. I have no doubt that I've made a mistake and will look at it further. I've been at this alone for a while, so I'm sure your feedback will resolve the issue. If not, in about a week, I'd like to ask another question.&nbsp;</div></div></div></blockquote><div><br class=""></div>Sure.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">Thanks to you and the <a href="http://netstyle.ch/" class="">netstyle.ch</a> team for sharing this. It's a lot of fun.&nbsp;</div></div></div></blockquote><div><br class=""></div><div>Thank you. It’s great that its something that people use and that doesn’t just collect virtual dust.</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Chris&nbsp;</div><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><div class=""><br class=""></div><div class="">Cheers,</div><div class="">Max</div></div></div></div></div></blockquote><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><br class=""><blockquote type="cite" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">So, Max, my question is, did you at <a href="http://netstyle.ch/" class="">netstyle.ch</a> find a solution for this?&nbsp;</div><div class="">Does anybody have an idea of how to re-route Socket&gt;&gt;initialize: towards a primitive that actually exists?&nbsp;</div><div class=""><br class=""></div><div class="">Thanks,&nbsp;</div><div class="">Chris&nbsp;</div><div class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">[1]&nbsp;<a href="http://lists.squeakfoundation.org/pipermail/squeak-dev/2014-July/179015.html" class="">http://lists.squeakfoundation.org/pipermail/squeak-dev/2014-July/179015.html</a></div><div class="">[2]&nbsp;<a href="http://www.freedesktop.org/software/systemd/man/systemd.exec.html" class="">http://www.freedesktop.org/software/systemd/man/systemd.exec.html</a></div><div class="">[3]&nbsp;<a href="http://squeakvm.org/cgi-bin/viewvc.cgi/squeak/trunk/platforms/unix/" class="">http://squeakvm.org/cgi-bin/viewvc.cgi/squeak/trunk/platforms/unix/</a></div><div class="">[4] contents of the systemd.cs file [1]:&nbsp;</div><div class=""><div class="">'From Pharo1.3 of 16 June 2011 [Latest update: #13315] on 4 July 2014 at 3:20:20 pm'!</div><div class=""><br class=""></div><div class="">!TcpListener methodsFor: '*systemd' stamp: 'nl 07/04/2014 15:17'!</div><div class="">haveSystemdAssignedPort</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>"LISTEN_FDS is set by systemd if the process/pharo-vm is started via port activation"</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>^ (self primEnvironmentAtSymbol: 'LISTEN_FDS')&nbsp;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>ifNotNilDo: [ :value | value asNumber = 1 ]&nbsp;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>ifNil: [ false]! !</div><div class=""><br class=""></div><div class="">!TcpListener methodsFor: '*systemd' stamp: 'nl 07/04/2014 15:18'!</div><div class="">pvtNewListener: backlogSize&nbsp;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>"Create a new socket that listens on our port. &nbsp;The backlog is how many simultaneous&nbsp;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>connections to accept at the same time</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>Use the socket assigned by systemd if:</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>- the command-line port number is equal to the portNumber to be opened</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>- there is an environment variable LISTEN_FDS with value 1</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>Otherwise use normal port allocation.</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>"</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>| listener |</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>listener := (self haveSystemdAssignedPort</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>ifTrue: [ self socketClass newSystemd ]</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>ifFalse: [ self socketClass newTCP ]).</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>self socketsToDestroy add: listener.</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>self&nbsp;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>bind: listener</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>withBacklogSize: backlogSize.</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>^ listener! !</div><div class=""><br class=""></div><div class="">!TcpListener methodsFor: '*systemd' stamp: 'nl 04/29/2013 14:04'!</div><div class="">primEnvironmentAtSymbol: aSymbol</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>"Copy-paste from UnixOSProcessPlugin: Answer the value of an environment variable in the external OS process."</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>&lt;primitive: 'primitiveEnvironmentAtSymbol' module: 'UnixOSProcessPlugin'&gt;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>^ nil ! !</div><div class=""><br class=""></div><div class="">!Socket class methodsFor: '*systemd' stamp: 'nl 07/04/2014 15:23'!</div><div class="">newSystemd</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>"Create a socket assigned by systemd port activation"</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>| SystemdSocketType |</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>SystemdSocketType := 2.</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>self initializeNetwork.</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>^[ super new initialize: SystemdSocketType ]</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>repeatWithGCIf: [ :socket | socket isValid not ]! !</div></div><div class=""><br class=""></div></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></body></html>