<div dir="ltr">Uggh systemd; yggh<div><br></div><div>cheers</div><div>James</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><span style="border-collapse:collapse;color:rgb(136,136,136);font-size:13px"><br><font face="arial, sans-serif">James Mills / prologic</font><br><br><font face="arial, sans-serif"></font><font face="'courier new', monospace">E: <a href="mailto:prologic@shortcircuit.net.au" style="color:rgb(0,0,204)" target="_blank">prologic@shortcircuit.net.au</a></font></span><div><span style="font-family:'courier new',monospace;color:rgb(136,136,136);font-size:13px">W: </span><a href="http://prologic.shortcircuit.net.au" style="font-family:'courier new',monospace;font-size:13px;color:rgb(0,0,204)" target="_blank">prologic.shortcircuit.net.au</a><br></div></div></div>
<br><div class="gmail_quote">On Tue, Dec 29, 2015 at 4:14 AM, Kim Holviala <span dir="ltr"><<a href="mailto:kim@holviala.com" target="_blank">kim@holviala.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I just came back from Porto (Portugal) last night and it was nice and sunny +18C there :D<br>
<br>
Currently coding systemd support for Gophernicus, and god damn that sucker refuses to understand my unit files, and apparently there are no working inetd-like unit file examples on the intertubes. Did I mention I hate systemd? So far it was just a bad feeling but now I have first-hand experience...<br>
<br>
<br>
<br>
- kim<br>
<br>
<br>
<br>
<br>
> On 29 Dec 2015, at 11:30, Martin Kukac <<a href="mailto:logout128@gmail.com">logout128@gmail.com</a>> wrote:<br>
><br>
><br>
> Weather status: +4C here, which is a lot colder than just a week ago, when we had +14C, but it's probably more than we will have next week, as forecast says that new year will start with -4C and less :-)<br>
><br>
> I'm glad that Gophernicus will be systemd-compliant, because lack of systemd support would probably not kill systemd but Gophernicus. It's a weird world we live in...<br>
><br>
> Martin<br>
><br>
> On 12/29/2015 08:43 AM, Kim Holviala wrote:<br>
>> Howdy,<br>
>><br>
>> Offtopic: -10C here and car was completely frozen this morning :D<br>
>><br>
>> I just checked the Gopherniucs code, and it first parses and fixes the selector and then does a chdir() to that selector directory before continuing. So chdir() is always done, even for requests that don't need it - the original reason was security; if chdir() fails then we don't have proper access rights and we can die() with proper error message.<br>
>><br>
>> And I think I'll reverse my stand on systemd - even if I personally loathe it, without support for systemd Gophernicus is as good as dead because no one can use it.<br>
>><br>
>><br>
>><br>
>> - Kim<br>
>><br>
>><br>
>><br>
>>> On 29 Dec 2015, at 09:30, Mateusz Viste <<a href="mailto:mateusz@viste.fr">mateusz@viste.fr</a>> wrote:<br>
>>><br>
>>> Done:<br>
>>><br>
>>> <a href="http://sourceforge.net/p/motsognir/code/HEAD/tree/trunk/" rel="noreferrer" target="_blank">http://sourceforge.net/p/motsognir/code/HEAD/tree/trunk/</a><br>
>>><br>
>>> ("Download snapshot")<br>
>>><br>
>>> This latest version should solve both your troubles:<br>
>>> - it makes gophermaps resolve relative paths to dynamic subgophermap (ie. you can use now =./script.php entries in your gophermaps)<br>
>>> - when executing a CGI/PHP script, it makes sure to set the 'working directory' to either where the parent gophermap is (if called from within a gophermap), or where the script itself is.<br>
>>><br>
>>> I hope you will find these changes useful.<br>
>>><br>
>>> cheers,<br>
>>> Mateusz<br>
>>><br>
>>><br>
>>><br>
>>> On 29/12/2015 06:26, Mateusz Viste wrote:<br>
>>>> Oh, sorry, I missed the fact that your problem was two-fold :)<br>
>>>> Indeed, my latest patch is simply setting the current working directory<br>
>>>> for executed scripts, but the gophermap still needs to find them by<br>
>>>> their absolute path.<br>
>>>><br>
>>>> I will add this today, so gophermaps will be able to locate scripts<br>
>>>> using their relative path.<br>
>>>><br>
>>>> BTW, in the special case that a script is called by a gophermap (as<br>
>>>> opposed to being called by the user agent directly), I believe it would<br>
>>>> make more sense to set the current working directory to where the<br>
>>>> gophermap is, not where the script is. What do you think?<br>
>>>><br>
>>>> say, I have a gophermap in /mystuff, that calls the inline script<br>
>>>> /cgi-bin/output.cgi - in this case, I'd rather expect the current<br>
>>>> working directory of the script to be set to /mystuff, instead of<br>
>>>> /cgi-bin/. Do you agree on this?<br>
>>>><br>
>>>> Mateusz<br>
>>>><br>
>>>><br>
>>>><br>
>>>><br>
>>>> On 28/12/2015 22:58, Martin Kukac wrote:<br>
>>>>> Hello Mateusz,<br>
>>>>><br>
>>>>> thanks a lot, that solved one part of my original question. Indeed PHP<br>
>>>>> scripts now have working directory set to the same directory they are<br>
>>>>> saved in. How about the gophermap itself? When I use = to insert result<br>
>>>>> of executed script, I have to specify the complete path.<br>
>>>>><br>
>>>>> It's not a big deal, it just would be more friendly if Motsognir was by<br>
>>>>> default searching in the same directory, where the gophermap is (when I<br>
>>>>> use =./somescript.php).<br>
>>>>><br>
>>>>> Thanks.<br>
>>>>><br>
>>>>> Martin<br>
>>>>><br>
>>>>> On 12/28/2015 08:07 PM, Mateusz Viste wrote:<br>
>>>>>> Hello Martin,<br>
>>>>>><br>
>>>>>> It's done. Now Motsognir will run CGI and PHP scripts from within the<br>
>>>>>> directory where the given script resides. You will find the most recent<br>
>>>>>> release on Motsognir's SVN, but you can just as well simply fetch the<br>
>>>>>> tarball from sourceforge's interface:<br>
>>>>>> <a href="http://sourceforge.net/p/motsognir/code/HEAD/tree/trunk/" rel="noreferrer" target="_blank">http://sourceforge.net/p/motsognir/code/HEAD/tree/trunk/</a><br>
>>>>>><br>
>>>>>> ("Download snapshot")<br>
>>>>>><br>
>>>>>> I didn't release a new "official" version for that yet, since maybe some<br>
>>>>>> other minor things will go in it.<br>
>>>>>><br>
>>>>>> Let me know if you have any troubles deploying this latest version.<br>
>>>>>><br>
>>>>>> Mateusz<br>
>>>>>><br>
>>>>>><br>
>>>>>><br>
>>>>>><br>
>>>>>> On 28/12/2015 16:33, Martin Kukac wrote:<br>
>>>>>>> Thanks a lot! This will actually be the very first time I will update<br>
>>>>>>> already installed gopher server :-)<br>
>>>>>>><br>
>>>>>>> At the moment I can't tell any more suggestions, but that may change as<br>
>>>>>>> I will progress in modyfying gophermaps.<br>
>>>>>>><br>
>>>>>>> Martin<br>
>>>>>>><br>
>>>>>>> On 12/28/2015 04:06 PM, Mateusz Viste wrote:<br>
>>>>>>>> Hi Martin,<br>
>>>>>>>><br>
>>>>>>>> Nice to hear you use Motsognir!<br>
>>>>>>>><br>
>>>>>>>> The current path (pwd) is changed to / when Motsognir daemonize<br>
>>>>>>>> itself,<br>
>>>>>>>> and it is never changed. It is not a bug - it's a (lack of) feature ;)<br>
>>>>>>>><br>
>>>>>>>> Switching the "current directory" to the script's location just before<br>
>>>>>>>> executing it sounds like a harmless thing to do, and it would<br>
>>>>>>>> definitely<br>
>>>>>>>> make your life easier. I will write a patch for that today, and let<br>
>>>>>>>> you<br>
>>>>>>>> know when it's ready.<br>
>>>>>>>><br>
>>>>>>>> By any means, let me know should you see any other other perfectible<br>
>>>>>>>> points in Motsognir, or need help with some particular items, I'll be<br>
>>>>>>>> happy to help.<br>
>>>>>>>><br>
>>>>>>>> cheers,<br>
>>>>>>>> Mateusz<br>
>>><br>
>>><br>
>>><br>
>>> _______________________________________________<br>
>>> Gopher-Project mailing list<br>
>>> <a href="mailto:Gopher-Project@lists.alioth.debian.org">Gopher-Project@lists.alioth.debian.org</a><br>
>>> <a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/gopher-project" rel="noreferrer" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/gopher-project</a><br>
>>><br>
><br>
><br>
><br>
> _______________________________________________<br>
> Gopher-Project mailing list<br>
> <a href="mailto:Gopher-Project@lists.alioth.debian.org">Gopher-Project@lists.alioth.debian.org</a><br>
> <a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/gopher-project" rel="noreferrer" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/gopher-project</a><br>
><br>
<br>
<br>
_______________________________________________<br>
Gopher-Project mailing list<br>
<a href="mailto:Gopher-Project@lists.alioth.debian.org">Gopher-Project@lists.alioth.debian.org</a><br>
<a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/gopher-project" rel="noreferrer" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/gopher-project</a><br>
</blockquote></div><br></div>