all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* User-Level services
@ 2019-02-03 15:16 Reza Alizadeh Majd
  2019-02-04 20:21 ` John Soo
  0 siblings, 1 reply; 7+ messages in thread
From: Reza Alizadeh Majd @ 2019-02-03 15:16 UTC (permalink / raw)
  To: help-guix

Hi everyone, 

Is it possible to define a shepherd service based on user login sessions in Guix? 
I want to run an application as a daemon that is responsible for serving its services, separately for each user. 

Thanks, 
Reza

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

* Re: User-Level services
  2019-02-03 15:16 User-Level services Reza Alizadeh Majd
@ 2019-02-04 20:21 ` John Soo
  2019-02-09  8:48   ` Chris Marusich
  0 siblings, 1 reply; 7+ messages in thread
From: John Soo @ 2019-02-04 20:21 UTC (permalink / raw)
  To: Reza Alizadeh Majd; +Cc: help-guix

Hi Reza,

I’m not sure this is possible right now. I recently tried making a service which would need the x display variable and I got stuck right about when I needed the logged in user. I would love to see it though. 

Does anyone else know?

Thanks,

John

> On Feb 3, 2019, at 7:16 AM, Reza Alizadeh Majd <r.majd@pantherx.org> wrote:
> 
> Hi everyone, 
> 
> Is it possible to define a shepherd service based on user login sessions in Guix? 
> I want to run an application as a daemon that is responsible for serving its services, separately for each user. 
> 
> Thanks, 
> Reza
> 

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

* Re: User-Level services
  2019-02-04 20:21 ` John Soo
@ 2019-02-09  8:48   ` Chris Marusich
  2019-02-09 13:14     ` John Soo
  0 siblings, 1 reply; 7+ messages in thread
From: Chris Marusich @ 2019-02-09  8:48 UTC (permalink / raw)
  To: John Soo; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 649 bytes --]

John Soo <jsoo1@asu.edu> writes:

> Hi Reza,
>
> I’m not sure this is possible right now. I recently tried making a
> service which would need the x display variable and I got stuck right
> about when I needed the logged in user. I would love to see it though.
>
> Does anyone else know?

I don't think there's an easy solution that's integrated into the Guix
System (formerly known as GuixSD).  Instead, the best approach is to use
any of "the usual" methods for starting up user processes.  For example,
you might use the ~/.config/autostart convention:

https://freedesktop.org/wiki/Specifications/autostart-spec/

-- 
Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* Re: User-Level services
  2019-02-09  8:48   ` Chris Marusich
@ 2019-02-09 13:14     ` John Soo
  2019-02-09 17:34       ` nly
  0 siblings, 1 reply; 7+ messages in thread
From: John Soo @ 2019-02-09 13:14 UTC (permalink / raw)
  To: Chris Marusich; +Cc: help-guix

Thanks Chris,

I wasn’t aware of the autostart spec so I took a look. Thanks! After reading it I’m not sure it provides the retry support (among other things) that a user service might provide. I would love to see something closer to an event triggered service than forking once and forgetting.

It would be awesome if the Guix System could provide a way to configure these declaratively, too. I am not saying shepherd would be the mechanism, necessarily either. I just think people - myself included - will probably want this feature. 

Thanks again,

John

> On Feb 9, 2019, at 12:48 AM, Chris Marusich <cmmarusich@gmail.com> wrote:
> 
> John Soo <jsoo1@asu.edu> writes:
> 
>> Hi Reza,
>> 
>> I’m not sure this is possible right now. I recently tried making a
>> service which would need the x display variable and I got stuck right
>> about when I needed the logged in user. I would love to see it though.
>> 
>> Does anyone else know?
> 
> I don't think there's an easy solution that's integrated into the Guix
> System (formerly known as GuixSD).  Instead, the best approach is to use
> any of "the usual" methods for starting up user processes.  For example,
> you might use the ~/.config/autostart convention:
> 
> https://freedesktop.org/wiki/Specifications/autostart-spec/
> 
> -- 
> Chris

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

* Re: User-Level services
  2019-02-09 13:14     ` John Soo
@ 2019-02-09 17:34       ` nly
  2019-02-09 22:25         ` John Soo
  0 siblings, 1 reply; 7+ messages in thread
From: nly @ 2019-02-09 17:34 UTC (permalink / raw)
  To: help-guix

[-- Attachment #1: Type: text/plain, Size: 2354 bytes --]

>I would love to see something closer to an event triggered service than forking once and forgetting.
You can use shepherd and herd commands (without sudo).
For example:
$ shepherd [-c config.scm]
$ herd status

Then configure your `config.scm` as you like. As a default shepherd will use `$XDG_CONFIG_HOME/shepherd/init.scm`, and if the variable is not set then `$HOME/.config/shepherd/init.scm`.

>It would be awesome if the Guix System could provide a way to configure these declaratively, too.
That can be done by generating a text-file in store containing the desired config then symbolic linking it to `$HOME.config/shepherd/init.scm`. This all can be done using guix daemon(declaratively).

Though I am not sure how you can 'autostart' the service at boot time and declaratively?

Cheers
amar

On February 9, 2019 1:14:28 PM UTC, John Soo <jsoo1@asu.edu> wrote:
>Thanks Chris,
>
>I wasn’t aware of the autostart spec so I took a look. Thanks! After
>reading it I’m not sure it provides the retry support (among other
>things) that a user service might provide. I would love to see
>something closer to an event triggered service than forking once and
>forgetting.
>
>It would be awesome if the Guix System could provide a way to configure
>these declaratively, too. I am not saying shepherd would be the
>mechanism, necessarily either. I just think people - myself included -
>will probably want this feature. 
>
>Thanks again,
>
>John
>
>> On Feb 9, 2019, at 12:48 AM, Chris Marusich <cmmarusich@gmail.com>
>wrote:
>> 
>> John Soo <jsoo1@asu.edu> writes:
>> 
>>> Hi Reza,
>>> 
>>> I’m not sure this is possible right now. I recently tried making a
>>> service which would need the x display variable and I got stuck
>right
>>> about when I needed the logged in user. I would love to see it
>though.
>>> 
>>> Does anyone else know?
>> 
>> I don't think there's an easy solution that's integrated into the
>Guix
>> System (formerly known as GuixSD).  Instead, the best approach is to
>use
>> any of "the usual" methods for starting up user processes.  For
>example,
>> you might use the ~/.config/autostart convention:
>> 
>> https://freedesktop.org/wiki/Specifications/autostart-spec/
>> 
>> -- 
>> Chris

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

[-- Attachment #2: Type: text/html, Size: 2948 bytes --]

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

* Re: User-Level services
  2019-02-09 17:34       ` nly
@ 2019-02-09 22:25         ` John Soo
  2019-02-10 18:23           ` Pierre Neidhardt
  0 siblings, 1 reply; 7+ messages in thread
From: John Soo @ 2019-02-09 22:25 UTC (permalink / raw)
  To: nly; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 2919 bytes --]

Hi all,

Thanks for the info. I like the way user shepherd services work so far. I haven’t used it much yet but it seems to mostly do the trick. The only thing I want is the declarative configuration. By “declarative” I mean configured in config.scm. Do you think there could be a chance of adding a services field to the user record type to create a corresponding Shepherd init.scm for user level shepherd services?

- John

> On Feb 9, 2019, at 9:34 AM, nly <nly@disroot.org> wrote:
> 
> >I would love to see something closer to an event triggered service than forking once and forgetting.
> You can use shepherd and herd commands (without sudo).
> For example:
> $ shepherd [-c config.scm]
> $ herd status
> 
> Then configure your `config.scm` as you like. As a default shepherd will use `$XDG_CONFIG_HOME/shepherd/init.scm`, and if the variable is not set then `$HOME/.config/shepherd/init.scm`.
> 
> >It would be awesome if the Guix System could provide a way to configure these declaratively, too.
> That can be done by generating a text-file in store containing the desired config then symbolic linking it to `$HOME.config/shepherd/init.scm`. This all can be done using guix daemon(declaratively).
> 
> Though I am not sure how you can 'autostart' the service at boot time and declaratively?
> 
> Cheers
> amar
> 
>> On February 9, 2019 1:14:28 PM UTC, John Soo <jsoo1@asu.edu> wrote:
>> Thanks Chris,
>> 
>> I wasn’t aware of the autostart spec so I took a look. Thanks! After reading it I’m not sure it provides the retry support (among other things) that a user service might provide. I would love to see something closer to an event triggered service than forking once and forgetting.
>> 
>> It would be awesome if the Guix System could provide a way to configure these declaratively, too. I am not saying shepherd would be the mechanism, necessarily either. I just think people - myself included - will probably want this feature. 
>> 
>> Thanks again,
>> 
>> John
>> 
>>> On Feb 9, 2019, at 12:48 AM, Chris Marusich <cmmarusich@gmail.com> wrote:
>>> 
>>> John Soo <jsoo1@asu.edu> writes:
>>> 
>>>> Hi Reza,
>>>> 
>>>> I’m not sure this is possible right now. I recently tried making a
>>>> service which would need the x display variable and I got stuck right
>>>> about when I needed the logged in user. I would love to see it though.
>>>> 
>>>> Does anyone else know?
>>> 
>>> I don't think there's an easy solution that's integrated into the Guix
>>> System (formerly known as GuixSD).  Instead, the best approach is to use
>>> any of "the usual" methods for starting up user processes.  For example,
>>> you might use the ~/.config/autostart convention:
>>> 
>>> https://freedesktop.org/wiki/Specifications/autostart-spec/
>>> 
>>> -- 
>>> Chris
>> 
> 
> -- 
> Sent from my Android device with K-9 Mail. Please excuse my brevity.

[-- Attachment #2: Type: text/html, Size: 3888 bytes --]

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

* Re: User-Level services
  2019-02-09 22:25         ` John Soo
@ 2019-02-10 18:23           ` Pierre Neidhardt
  0 siblings, 0 replies; 7+ messages in thread
From: Pierre Neidhardt @ 2019-02-10 18:23 UTC (permalink / raw)
  To: John Soo; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 308 bytes --]

Hi,

The question of user services has been brought up a couple of times before.

I've started a new discussion on guix-devel
(https://lists.gnu.org/archive/html/guix-devel/2019-02/msg00128.html) and
hopefully we will get to the bottom of it this time!

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

end of thread, other threads:[~2019-02-10 18:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-03 15:16 User-Level services Reza Alizadeh Majd
2019-02-04 20:21 ` John Soo
2019-02-09  8:48   ` Chris Marusich
2019-02-09 13:14     ` John Soo
2019-02-09 17:34       ` nly
2019-02-09 22:25         ` John Soo
2019-02-10 18:23           ` Pierre Neidhardt

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.