unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Webservices and Shepherd
@ 2017-04-02  9:44 Thomas Sigurdsen
  2017-04-03 13:50 ` Ludovic Courtès
  2017-04-03 15:56 ` Alex Kost
  0 siblings, 2 replies; 3+ messages in thread
From: Thomas Sigurdsen @ 2017-04-02  9:44 UTC (permalink / raw)
  To: help-guix@gnu.org

Hi Guix!

I'm sending two threads with the same intro, read below the line for the
questions.

I've been playing around with guixsd on my day-to-day work laptop for a month
or so now and have to say I'm thoroughly happy about how everything is put
together and mostly _just works_.

I'll note that I'm still very much learning guile and scheme. But the manual
(https://www.gnu.org/software/guile/manual/) is amazing.

-------------------------------------------------------------------------------------------------

I will, over the coming week or so, begin setting up a server (for web pages,
file sharing and hopefully email).

Webservices: Is it preferred to put their "program files" in package
definitions and telling shepherd how to run them in services?

Are there any examples of a guixsd server config with multiple web services
out there?


And when it comes to shepherd: I've seen a few configs where shepherd is
running as a user in addition to root. It looks like this is a good way to
separate webservices and similar, maybe even giving them separate users. But
does it mean shepherd is running multiple instances, increasing overhead and
difficulty of management (as in how do I know which shepherd I'm talking to
and so on)?

My entire configuration with homemade modules can be found at:
https://notabug.org/thomassgn/guixsd-configuration

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Webservices and Shepherd
  2017-04-02  9:44 Webservices and Shepherd Thomas Sigurdsen
@ 2017-04-03 13:50 ` Ludovic Courtès
  2017-04-03 15:56 ` Alex Kost
  1 sibling, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2017-04-03 13:50 UTC (permalink / raw)
  To: Thomas Sigurdsen; +Cc: help-guix@gnu.org

Thomas Sigurdsen <thomas.sigurdsen@gmail.com> skribis:

> I will, over the coming week or so, begin setting up a server (for web pages,
> file sharing and hopefully email).
>
> Webservices: Is it preferred to put their "program files" in package
> definitions and telling shepherd how to run them in services?
>
> Are there any examples of a guixsd server config with multiple web services
> out there?

Did you look at “info "(guix)Web Services"”?
(<https://gnu.org/software/guix/manual/html_node/Web-Services.html> is
an older, less complete version of that.)

GuixSD has a service definition for nginx, which aims to make it easy to
deploy nginx.  A simple example can be seen in this test:

  https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/tests/web.scm

For more complex nginx configuration, you can let it use a native nginx
config file instead of the Scheme config.

I haven’t tried complex web service config, but I think Chris Baines
Cc’d has and might be able to help.

> And when it comes to shepherd: I've seen a few configs where shepherd is
> running as a user in addition to root. It looks like this is a good way to
> separate webservices and similar, maybe even giving them separate users. But
> does it mean shepherd is running multiple instances, increasing overhead and
> difficulty of management (as in how do I know which shepherd I'm talking to
> and so on)?

For system services like nginx, the service definition can just tell the
Shepherd running as PID 1 to start the service under a separate UID.
For instance, nginx may run as the ‘nginx’ user.

Running shepherd as a user is only useful if you plan to have per-user
services.  For instance, I run privoxy and an mcron instance like this.

HTH!

Ludo’.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Webservices and Shepherd
  2017-04-02  9:44 Webservices and Shepherd Thomas Sigurdsen
  2017-04-03 13:50 ` Ludovic Courtès
@ 2017-04-03 15:56 ` Alex Kost
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Kost @ 2017-04-03 15:56 UTC (permalink / raw)
  To: Thomas Sigurdsen; +Cc: help-guix@gnu.org

Thomas Sigurdsen (2017-04-02 11:44 +0200) wrote:

> Hi Guix!

Hello!

[...]
> And when it comes to shepherd: I've seen a few configs where shepherd is
> running as a user in addition to root. It looks like this is a good way to
> separate webservices and similar, maybe even giving them separate users. But
> does it mean shepherd is running multiple instances, increasing overhead and
> difficulty of management (as in how do I know which shepherd I'm talking to
> and so on)?

Yes, I mean "yes" to multiple instances: the root's Shepherd can't
handle user services, you need to start another (user) Shepherd for
that.  Knowing which instance you are talking to is easy:

- when you run "herd" command as root, it talks to the root's Shepherd
  (on GuixSD its socket file is "/var/run/shepherd/socket");

- when you run "herd" as user, it talks to the user running instance
  (its default socket is "~/.config/shepherd/run/socket").

-- 
Alex

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-03 15:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-02  9:44 Webservices and Shepherd Thomas Sigurdsen
2017-04-03 13:50 ` Ludovic Courtès
2017-04-03 15:56 ` Alex Kost

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).