help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Defining service: service does not take effect after rebooting


From: Hebi Li
Subject: Defining service: service does not take effect after rebooting
Date: Mon, 16 Sep 2019 13:45:58 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Hi Guix,

I'm defining a service, and the service works. However, when I reboot
the system, the service does not work, and I have to reconfigure the
system to make it work again. The detailed steps I'm following are as
attacked below. Is there anything I'm missing?

Thanks,
Hebi

--------

The detailed steps are as follows.  I'm defining a simple one-shot
service that creates a file /tmp/hello:

        (define (hello-shepherd-service config)
          (list (shepherd-service
                 (provision '(hello))
                 (requirement '())
                 (start #~(make-forkexec-constructor
                           (list "touch" "/tmp/hello")))
                 (one-shot? #t)
                 (auto-start? #f)
                 (respawn? #f))))

        (define hello-service-type
          (service-type
           (name 'hello)
           (extensions
            (list (service-extension shepherd-root-service-type 
hello-shepherd-service)))
           (default-value '())))

I add this service to my config.scm:

        (services
           (append
            (list
             (service hello-service-type))
            %desktop-services))

Then I reconfigure the system:

        sudo -E guix system reconfigure config.scm

Then *reboot*. After rebooting, I start the service via:

        sudo herd start hello

However, there is no /tmp/hello created. Then I reconfigure the system again:

        sudo -E guix system reconfigure config.scm

Now, I start the service

        sudo herd start hello

And the file /tmp/hello shows up.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]