From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Soo Subject: Re: User-Level services Date: Sat, 9 Feb 2019 14:25:10 -0800 Message-ID: <4EA9FA75-5D8C-43C1-96C7-ABEBA603866C@asu.edu> References: <1549206990.3483392.1649820064.4E571E9E@webmail.messagingengine.com> <87k1i973g9.fsf@gmail.com> Mime-Version: 1.0 (1.0) Content-Type: multipart/alternative; boundary=Apple-Mail-16523291-4C6E-4A32-89B4-B44794D77646 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([209.51.188.92]:43311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gsb3x-0000I5-9t for help-guix@gnu.org; Sat, 09 Feb 2019 17:25:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gsb3p-0003hl-2m for help-guix@gnu.org; Sat, 09 Feb 2019 17:25:26 -0500 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:45104) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gsb3k-0003dm-IS for help-guix@gnu.org; Sat, 09 Feb 2019 17:25:18 -0500 Received: by mail-pf1-x444.google.com with SMTP id j3so3361214pfi.12 for ; Sat, 09 Feb 2019 14:25:14 -0800 (PST) In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: nly Cc: help-guix@gnu.org --Apple-Mail-16523291-4C6E-4A32-89B4-B44794D77646 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi all, Thanks for the info. I like the way user shepherd services work so far. I ha= ven=E2=80=99t used it much yet but it seems to mostly do the trick. The only= thing I want is the declarative configuration. By =E2=80=9Cdeclarative=E2=80= =9D 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 S= hepherd init.scm for user level shepherd services? - John > On Feb 9, 2019, at 9:34 AM, nly wrote: >=20 > >I would love to see something closer to an event triggered service than f= orking once and forgetting. > You can use shepherd and herd commands (without sudo). > For example: > $ shepherd [-c config.scm] > $ herd status >=20 > Then configure your `config.scm` as you like. As a default shepherd will u= se `$XDG_CONFIG_HOME/shepherd/init.scm`, and if the variable is not set then= `$HOME/.config/shepherd/init.scm`. >=20 > >It would be awesome if the Guix System could provide a way to configure t= hese 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 a= ll can be done using guix daemon(declaratively). >=20 > Though I am not sure how you can 'autostart' the service at boot time and d= eclaratively? >=20 > Cheers > amar >=20 >> On February 9, 2019 1:14:28 PM UTC, John Soo wrote: >> Thanks Chris, >>=20 >> I wasn=E2=80=99t aware of the autostart spec so I took a look. Thanks! Af= ter reading it I=E2=80=99m not sure it provides the retry support (among oth= er things) that a user service might provide. I would love to see something c= loser to an event triggered service than forking once and forgetting. >>=20 >> It would be awesome if the Guix System could provide a way to configure t= hese declaratively, too. I am not saying shepherd would be the mechanism, ne= cessarily either. I just think people - myself included - will probably want= this feature.=20 >>=20 >> Thanks again, >>=20 >> John >>=20 >>> On Feb 9, 2019, at 12:48 AM, Chris Marusich wrote= : >>>=20 >>> John Soo writes: >>>=20 >>>> Hi Reza, >>>>=20 >>>> I=E2=80=99m not sure this is possible right now. I recently tried makin= g 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. >>>>=20 >>>> Does anyone else know? >>>=20 >>> 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: >>>=20 >>> https://freedesktop.org/wiki/Specifications/autostart-spec/ >>>=20 >>> --=20 >>> Chris >>=20 >=20 > --=20 > Sent from my Android device with K-9 Mail. Please excuse my brevity. --Apple-Mail-16523291-4C6E-4A32-89B4-B44794D77646 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Hi a= ll,

Thanks for the info. I l= ike the way user shepherd services work so far. I haven=E2=80=99t used it mu= ch yet but it seems to mostly do the trick. The only thing I want is the dec= larative configuration. By =E2=80=9Cdeclarative=E2=80=9D I mean configured i= n config.scm. Do you think there could be a chance of adding a services fiel= d to the user record type to create a corresponding Shepherd init.scm for us= er level shepherd services?

- John

On Feb 9, 2019, at 9:34 AM, nly <nly@disroot.org> wrote:

>I would love to see something cl= oser to an event triggered service than forking once and forgetting.
You c= an use shepherd and herd commands (without sudo).
For example:
$ sheph= erd [-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 c= onfigure these declaratively, too.
That can be done by generating a text-= file in store containing the desired config then symbolic linking it to `$HO= ME.config/shepherd/init.scm`. This all can be done using guix daemon(declara= tively).

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

Cheers
amar

On February 9, 2019 1:14:28 PM UTC, John Soo <jsoo1@asu.edu> wrote:
Thanks Chris,

I wasn=E2=80=99t aware of the aut= ostart spec so I took a look. Thanks! After reading it I=E2=80=99m not sure i= t provides the retry support (among other things) that a user service might p= rovide. I would love to see something closer to an event triggered service t= han forking once and forgetting.

It would be awesome if the Guix Syst= em could provide a way to configure these declaratively, too. I am not sayin= g 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 <cm= marusich@gmail.com> wrote:

John Soo <jsoo1@asu.edu> writes:

Hi Reza,

I=E2=80=99m not sure this is possible righ= t now. I recently tried making a
service which would need the x display v= ariable and I got stuck right
about when I needed the logged in user. I w= ould 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.
= --Apple-Mail-16523291-4C6E-4A32-89B4-B44794D77646--