[Nix-dev] lighttpd service

Alexander Foremny alexanderforemny at googlemail.com
Thu Jun 7 21:54:55 CEST 2012


Thanks for the notification. I rebased my Git repositories after I
wrote the last mail and apparently forgot to push my local branch. It
is working, but support through options in configuration.nix is very
basic. I'll gladly maintain a more sophisticated Nix expression but I
don't know how (and if) this is possible.

I'll try for tomorrow to push my local branches to GitHub.

2012/6/7 Kirill Elagin <kirelagin at gmail.com>:
> Hi!
>
> So, what is the fate of your work? I'm also interested in lighttpd service
> but can't see anything in your github repo.
>
> --
> Кирилл Елагин
>
>
>
> 2012/6/2 Alexander Foremny <alexanderforemny at googlemail.com>
>>
>> Hello,
>>
>> with Rickard's help I created a very simple Nix expression for
>> Lighttpd. The changes can be found in my Git repository [1]. I've had
>> some trouble with fetching upstream/master and merging it. But I think
>> everything is in order now except some bogus commit messages.
>>
>> I'd appreciate comments on the Nix expression and wanted to ask if
>> this could be merged into upstream. Should I file a pull request as
>> soon as this patch is agreed upon?
>>
>> I don't quite know how to progress further from here. Lighttpd's
>> configuration appears to be really complex due to conditionals [2] and
>> as far as I can tell it wouldn't make sense to model this as
>> configuration options.
>>
>> However, would you like to see (limited) virtual host support in the
>> Nix expression? Some first ideas are in the lighttpd branch [3].
>>
>> Regards,
>> Alexander Foremny
>>
>> [1] https://github.com/aforemny/nixos/tree/lighttpd-simple
>> [2] http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:Configuration
>> [3] https://github.com/aforemny/nixos/tree/lighttpd
>>
>> 2012/6/2 Alexander Foremny <alexanderforemny at googlemail.com>:
>> > Great! This is working for me, too. Thank you very much.
>> >
>> > 2012/5/31 Rickard Nilsson <rickard.nilsson at telia.com>:
>> >> Hi Alexander,
>> >>
>> >> I have no troubles running av minimal lighttpd on NixOS. I can start
>> >> and
>> >> stop it with upstart. My configuration looks like this:
>> >>
>> >> let
>> >>
>> >>   root = "/srv/www";
>> >>   httpPort = 3000;
>> >>
>> >>   httpConf = writeText "webserver.conf" ''
>> >>     server.document-root = "${root}"
>> >>     server.port = ${httpPort}
>> >>   '';
>> >>
>> >> in {
>> >>
>> >>   jobs.webserver = {
>> >>     path = [ lighttpd ];
>> >>     exec = "lighttpd -D -f ${httpConf}";
>> >>   };
>> >>
>> >> }
>> >>
>> >>
>> >> Regards,
>> >>   Rickard Nilsson
>> >>
>> >>
>> >> Den 2012-05-27 16:03:50 skrev Alexander Foremny
>> >> <alexanderforemny at googlemail.com>:
>> >>
>> >>> Hello,
>> >>>
>> >>> I am still trying to get a minimal Nix expression for Lighttpd to
>> >>> work. However, I cannot get the upstart job to behave well. The Nix
>> >>> expression for the service so far is available on GitHub [1].
>> >>>
>> >>> I also uploaded the generated upstart job file [2].
>> >>>
>> >>> What's strange is that starting / stopping the upstart job seems to
>> >>> hang forever. For instance
>> >>>
>> >>>> # initctl status lighttpd
>> >>>> lighttpd stop/waiting
>> >>>> # initctl start lighttpd
>> >>>> [ here it hangs forever ]
>> >>>
>> >>> In another terminal I can see that Lighttpd in fact is successfully
>> >>> started by upstart.
>> >>>
>> >>>> # initctl status lighttpd
>> >>>> lighttpd start/spawned, process 4803
>> >>>
>> >>> ps reports that the PID inferred by upstart is correct. I then Ctrl-C
>> >>> out of the hanging initctl start lighttpd. However, trying to initctl
>> >>> stop the lighttpd job it hangs again without any output. A strace
>> >>> gives the following last lines.
>> >>>
>> >>>> # strace initctl stop lighttpd
>> >>>> recvmsg(3, 0xbffe2b9c, MSG_CMSG_CLOEXEC) = -1 EAGAIN (Resource
>> >>>> temporarily unavailable)
>> >>>> clock_gettime(CLOCK_MONOTONIC, {1782, 252572560}) = 0
>> >>>> poll([{fd=3, events=POLLIN}], 1, -1
>> >>>
>> >>> However, this time the Lighttpd server process is not being terminated
>> >>> by upstart! I tried increasing upstart's log verbosity without gaining
>> >>> any additional insight.
>> >>>
>> >>> Does anyone of you have an idea of what's going on? Any help would
>> >>> greatly be appreciated.
>> >>>
>> >>> Regards,
>> >>> Alexander Foremny
>> >>>
>> >>> [1]
>> >>>
>> >>> https://github.com/aforemny/nixos/blob/master/modules/services/web-servers/lighttpd/default.nix
>> >>> [2] https://gist.github.com/2814308
>> >>>
>> >>> 2012/5/24 Nicolas Pierron <nicolas.b.pierron at gmail.com>:
>> >>>> Hi,
>> >>>>
>> >>>> On Tue, May 22, 2012 at 3:13 PM, Alexander Foremny
>> >>>> <alexanderforemny at googlemail.com> wrote:
>> >>>>> I am trying to write a service module for lighttpd. I came up with a
>> >>>>> minimal example [1] which is giving me the following error upon
>> >>>>> rebuilding my system.
>> >>>>
>> >>>> Nice.  I would be happy to see that.
>> >>>>
>> >>>>> How can I make my option services.lighttpd known to NixOS?
>> >>>>
>> >>>> Every NixOS file, even your configuration.nix is a module, this means
>> >>>> that you don't have to build against a custom version of NixOS unless
>> >>>> you want to modify some of its files.  If you just want to *add* a
>> >>>> new
>> >>>> module, I will recommend you to use the "require" or "imports"
>> >>>> attribute in your configuration.nix.
>> >>>>
>> >>>> So your /etc/nixos/configuration.nix should look like:
>> >>>>
>> >>>> {
>> >>>>  require = [
>> >>>>    lighttpd/default.nix
>> >>>>  ];
>> >>>>
>> >>>> …
>> >>>>
>> >>>> }
>> >>>>
>> >>>> The syntax of module is documented in the wiki[1] for more detail.
>> >>>>
>> >>>> [1] http://nixos.org/wiki/NixOS:Modules
>> >>>>
>> >>>> --
>> >>>> Nicolas Pierron
>> >>>> http://www.linkedin.com/in/nicolasbpierron - http://nbp.name/
>> >>> _______________________________________________
>> >>> nix-dev mailing list
>> >>> nix-dev at lists.science.uu.nl
>> >>> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>> >> _______________________________________________
>> >> nix-dev mailing list
>> >> nix-dev at lists.science.uu.nl
>> >> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>> _______________________________________________
>> nix-dev mailing list
>> nix-dev at lists.science.uu.nl
>> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
>


More information about the nix-dev mailing list