guix-devel
[Top][All Lists]
Advanced

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

trying to write my own herd service


From: Adam Kandur
Subject: trying to write my own herd service
Date: Sat, 5 Nov 2022 02:21:23 +0300

Hi guix!
I tried to write my own herd service, that's what i did
```
(define (my-daemon-shepherd-service _)
  (list (shepherd-service
         (documentation "")
         (provision '(go-github-com-KefirTheAutomator-daemon))
         (requirement '(networking))
         (start #~(make-forkexec-constructor
                   (list
                    (string-append
#$go-github-com-KefirTheAutomator-daemon "/bin/daemon")
                    " -pidFile=/var/run/my-daemon.pid"
                    " -logFile=/var/log/my-daemon.log")))
         (stop #~(make-kill-destructor)))))

(define my-daemon-service-type
  (service-type (name 'my-daemon)
                (extensions
                 (list (service-extension shepherd-root-service-type
                                          my-daemon-shepherd-service)))
                (default-value #f)
                (description "")))
```
(go-github-com-KefirTheAutomator-daemon is my dummy daemon that just
creates a process and writes to it's log file).

This was pulled from my channel, but when I am trying to start the
services, it turns of and disables
```
user@workstation ~$ sudo herd status go-github-com-KefirTheAutomator-daemon
Status of go-github-com-KefirTheAutomator-daemon:
  It is stopped.
  It is disabled.
  Provides (go-github-com-KefirTheAutomator-daemon).
  Requires (networking).
  Conflicts with ().
  Will be respawned.
  Last respawned on Sat Nov 05 02:14:33+0300 2022.

```

Can anyone help me to find out what is wrong, I didn't find any
recommendations on writing herd services?



reply via email to

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