all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Features of installing package that works as service
@ 2018-11-27  9:38 znavko
  2018-11-27 14:25 ` Joshua Branson
  2018-11-27 17:04 ` Tonton
  0 siblings, 2 replies; 6+ messages in thread
From: znavko @ 2018-11-27  9:38 UTC (permalink / raw)
  To: Help Guix

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

Hello, Guix Help! I think GuixSD is cute, but manual is so incomprehensible https://www.gnu.org/software/guix/manual/en/guix.html <https://www.gnu.org/software/guix/manual/en/guix.html> 

I want to clear all possible options when I install packages that work as services.
For example, can get postgresql by typing by non-root user `$ guix package -i postgresql` and run it? How to run it?

Can I install postgresql and run it only when I need?

Do I need install it only from defining service in config.scm and typing `# guix system reconfigure config.scm` ?

Manual "6.2.15 Defining Services" has lot of variables and I do not know where to find them definitions.

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

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

* Re: Features of installing package that works as service
  2018-11-27  9:38 Features of installing package that works as service znavko
@ 2018-11-27 14:25 ` Joshua Branson
  2018-11-28  6:31   ` znavko
       [not found]   ` <<87a7luwqa8.fsf@fastmail.com>
  2018-11-27 17:04 ` Tonton
  1 sibling, 2 replies; 6+ messages in thread
From: Joshua Branson @ 2018-11-27 14:25 UTC (permalink / raw)
  To: help-guix

<znavko@tutanota.com> writes:

> Hello, Guix Help! I think GuixSD is cute, but manual is so incomprehensible https://www.gnu.org/software/guix/manual/en/guix.html 

Have you read the entire manual?  I know I haven't.  Before your
complain that the manual is difficult to understand, be sure that you
read all of it.  There's lots of good details in the manual. :)

>
> I want to clear all possible options when I install packages that work as services.
> For example, can get postgresql by typing by non-root user `$ guix package -i postgresql` and run it? How to run it?

If you intend to run it yourself, you can run that command.  But you
don't want to actually run guix package -i postgresql.

>
> Can I install postgresql and run it only when I need?
>
> Do I need install it only from defining service in config.scm and typing `# guix system reconfigure config.scm` ?

Basically yes.

https://www.gnu.org/software/guix/manual/en/guix.html#Database-Services

The (gnu services databases) module provides the following services. 

So your config would look a little like:

(use-modules (gnu services database))

...

;; your postgresql service definition here.
;; I think the below is correct, but I'm not certain.

(services (cons* 
(service postgresql-service-type)
%base-services
))

>
> Manual "6.2.15 Defining Services" has lot of variables and I do not know where to find them definitions.

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

* Re: Features of installing package that works as service
  2018-11-27  9:38 Features of installing package that works as service znavko
  2018-11-27 14:25 ` Joshua Branson
@ 2018-11-27 17:04 ` Tonton
  1 sibling, 0 replies; 6+ messages in thread
From: Tonton @ 2018-11-27 17:04 UTC (permalink / raw)
  To: znavko; +Cc: help-guix

Welcome to Guix!

On Tue, 27 Nov 2018 10:38:22 +0100 (CET)
<znavko@tutanota.com> wrote:

> Hello, Guix Help! I think GuixSD is cute, but manual is so incomprehensible
> https://www.gnu.org/software/guix/manual/en/guix.html
> <https://www.gnu.org/software/guix/manual/en/guix.html> 

Parts of the manual may be a bit difficult, but I think we're trying to make
it good and understandable for everyone. If you have suggestions I encourage
you to send them in an email, or even better as a documentation patch.

> 
> I want to clear all possible options when I install packages that work as
> services. For example, can get postgresql by typing by non-root user `$
> guix package -i postgresql` and run it? How to run it?
> 
> Can I install postgresql and run it only when I need?

Yes and yes. You can add it as a service in your config.scm and then stop and
start it when needed. Or you can run it as a package like you describe here.

> 
> Do I need install it only from defining service in config.scm and typing `#
> guix system reconfigure config.scm` ?
> 
> Manual "6.2.15 Defining Services" has lot of variables and I do not know
> where to find them definitions.

Defining packages and services is next level (it's not very difficult, but
not something you should need for regular systems). Look at the sections
under "System Configuration" sepcifically the pages under Services.

HTH
Tonton

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

* Re: Features of installing package that works as service
  2018-11-27 14:25 ` Joshua Branson
@ 2018-11-28  6:31   ` znavko
       [not found]   ` <<87a7luwqa8.fsf@fastmail.com>
  1 sibling, 0 replies; 6+ messages in thread
From: znavko @ 2018-11-28  6:31 UTC (permalink / raw)
  Cc: Help Guix

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

Thank you, Joshua Branson!
Your code helped me a bit

(use-modules  (gnu services databases) )
(services (cons*  (service postgresql-service-type)
%desktop-services))

After `guix reconfigure /etc/config.scm` and reboot postgresql server is running:
# herd status | grep postgre
 + postgres

The only one change I want to do. Please, how to disable auto-start of postgresql? I need it sometimes and want to start it manually only. I think there should be some guile function like '(service postgresql-service-type (config no-autostart))', but qwant search does not give the answer. 
I've read 'start' and 'stop' options here https://www.gnu.org/software/guix/manual/en/guix.html#Shepherd-Services <https://www.gnu.org/software/guix/manual/en/guix.html#Shepherd-Services> 
and here
https://www.gnu.org/software/shepherd/manual/shepherd.html#index-Configuration-file <https://www.gnu.org/software/shepherd/manual/shepherd.html#index-Configuration-file>
 and tried to find out here http://git.savannah.gnu.org/cgit/guix.git/tree/gnu/services/databases.scm <http://git.savannah.gnu.org/cgit/guix.git/tree/gnu/services/databases.scm>
But I did not get the answer for those 10 minutes I've spend there.
I tried with no success:
(service postgresql-service-type (unstartable '()) )
(service postgresql-service-type (config (unstartable '()) )(service postgresql-service-type (let (unstartable '())) )

Please, how to do this?


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

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

* Re: Features of installing package that works as service
       [not found]     ` <LSO-zSI--3-1@tutanota.com-LSO2Gyh----1>
@ 2018-11-28  7:05       ` znavko
  2018-11-29 12:08         ` Joshua Branson
  0 siblings, 1 reply; 6+ messages in thread
From: znavko @ 2018-11-28  7:05 UTC (permalink / raw)
  Cc: Help Guix

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

Hello, Guix Help! guix understands this config, but still I have avahi-daemon and ntpd services. They are not started, I want delete them at all. How to do that?

;;this is znavko's cute config

(use-modules (gnu) (gnu system nss)
             (gnu services desktop)
             (srfi srfi-1) ;;for remove function
             (gnu services networking) ;;for remove ntp
             (gnu services avahi) ;;for remove avahi
             (gnu services xorg)
             (gnu services databases);;for postgres
)
(use-service-modules desktop)
(use-package-modules certs gnome)

(operating-system (host-name "antelope") (timezone "Europe/Moscow") (locale "en_US.utf8")
  (bootloader (bootloader-configuration
                (bootloader grub-bootloader)
                (target "/dev/sda")))
  (file-systems (cons (file-system
                        (device "/dev/sda1") (mount-point "/") (type "ext4"))
                      %base-file-systems))
  (swap-devices '("/dev/sda2"))

  (users (cons* (user-account (name "bob") (group "users")
                (supplementary-groups '("wheel" "netdev" "audio" "video"))
                (home-directory "/home/bob"))
                (user-account (name "alice") (group "users")
                (supplementary-groups '("wheel" "netdev" "audio" "video"))
                (home-directory "/home/alice"))
                (user-account (name "mom") (group "users")
                (supplementary-groups '("wheel" "netdev" "audio" "video"))
                (home-directory "/home/mom"))
               %base-user-accounts))

  ;; This is where we specify system-wide packages.
  (packages (cons* nss-certs         ;for HTTPS access
                   gvfs              ;for user mounts
                   %base-packages))

  (services (cons*  ;;(tor-service)
                    (service postgresql-service-type)
                    (xfce-desktop-service)

                    (modify-services      
                        (remove (lambda (service)
                            (eq? (service-kind service) 
                                ntp-service-type avahi-service))

                            %desktop-services
                        );end of remove
                        (elogind-service-type
                            c => (elogind-configuration
                                (handle-lid-switch 'ignore)))
                    );;end of modify desktop-srvices

  ));;end of services

  ;; Allow resolution of '.local' host names with mDNS.
  (name-service-switch %mdns-host-lookup-nss))

  

# herd status
Started:
...
 + xorg-server
Stopped:
 - avahi-daemon
 - networking
 - ntpd
 - swap-/dev/sda2
 - term-auto
 - user-homes
 - wpa-supplicant
  
How delete at all avahi-daemon and ntpd?

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

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

* Re: Features of installing package that works as service
  2018-11-28  7:05       ` znavko
@ 2018-11-29 12:08         ` Joshua Branson
  0 siblings, 0 replies; 6+ messages in thread
From: Joshua Branson @ 2018-11-29 12:08 UTC (permalink / raw)
  To: help-guix

<znavko@tutanota.com> writes:

I'm not sure what's wrong here.  As far as I can understand you code
makes sense and should remove the services that you don't want.  


You've probably seen this bit of code here:
https://www.gnu.org/software/guix/manual/en/guix.html#Base-Services

(remove (lambda (service)
          (eq? (service-kind service) avahi-service-type))
        %desktop-services)

Which is what you have written down.

I'm at a loss.  I wish I knew what was wrong with wrote you have
written.

Joshua

> Hello, Guix Help! guix understands this config, but still I have avahi-daemon and ntpd services. They are not started, I want delete them at all. How to do
> that?
>
> ;;this is znavko's cute config
>
> (use-modules (gnu) (gnu system nss)
>              (gnu services desktop)
>              (srfi srfi-1) ;;for remove function
>              (gnu services networking) ;;for remove ntp
>              (gnu services avahi) ;;for remove avahi
>              (gnu services xorg)
>              (gnu services databases);;for postgres
> )
> (use-service-modules desktop)
> (use-package-modules certs gnome)
>
> (operating-system (host-name "antelope") (timezone "Europe/Moscow") (locale "en_US.utf8")
>   (bootloader (bootloader-configuration
>                 (bootloader grub-bootloader)
>                 (target "/dev/sda")))
>   (file-systems (cons (file-system
>                         (device "/dev/sda1") (mount-point "/") (type "ext4"))
>                       %base-file-systems))
>   (swap-devices '("/dev/sda2"))
>
>   (users (cons* (user-account (name "bob") (group "users")
>                 (supplementary-groups '("wheel" "netdev" "audio" "video"))
>                 (home-directory "/home/bob"))
>                 (user-account (name "alice") (group "users")
>                 (supplementary-groups '("wheel" "netdev" "audio" "video"))
>                 (home-directory "/home/alice"))
>                 (user-account (name "mom") (group "users")
>                 (supplementary-groups '("wheel" "netdev" "audio" "video"))
>                 (home-directory "/home/mom"))
>                %base-user-accounts))
>
>   ;; This is where we specify system-wide packages.
>   (packages (cons* nss-certs         ;for HTTPS access
>                    gvfs              ;for user mounts
>                    %base-packages))
>
>   (services (cons*  ;;(tor-service)
>                     (service postgresql-service-type)
>                     (xfce-desktop-service)
>
>                     (modify-services      
>                         (remove (lambda (service)
>                             (eq? (service-kind service) 
>                                 ntp-service-type avahi-service))
>
>                             %desktop-services
>                         );end of remove
>                         (elogind-service-type
>                             c => (elogind-configuration
>                                 (handle-lid-switch 'ignore)))
>                     );;end of modify desktop-srvices
>
>   ));;end of services
>
>   ;; Allow resolution of '.local' host names with mDNS.
>   (name-service-switch %mdns-host-lookup-nss))
>
> # herd status
> Started:
> ...
>  + xorg-server
> Stopped:
>  - avahi-daemon
>  - networking
>  - ntpd
>  - swap-/dev/sda2
>  - term-auto
>  - user-homes
>  - wpa-supplicant
>
> How delete at all avahi-daemon and ntpd?

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

end of thread, other threads:[~2018-11-29 12:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-27  9:38 Features of installing package that works as service znavko
2018-11-27 14:25 ` Joshua Branson
2018-11-28  6:31   ` znavko
     [not found]   ` <<87a7luwqa8.fsf@fastmail.com>
     [not found]     ` <LSO-zSI--3-1@tutanota.com-LSO2Gyh----1>
2018-11-28  7:05       ` znavko
2018-11-29 12:08         ` Joshua Branson
2018-11-27 17:04 ` Tonton

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.