feat: add log-file entry to thinkfan-service-configuration in (radix services linux)
parent
50a545303f
commit
d9a1fc0018
|
@ -8,26 +8,36 @@
|
|||
#:export (thinkfan-configuration
|
||||
make-thinkfan-configuration
|
||||
thinkfan-configuration?
|
||||
|
||||
thinkfan-configuration-requirement
|
||||
thinkfan-configuration-pid-file
|
||||
thinkfan-configuration-config-file
|
||||
thinkfan-configuration-log-file
|
||||
thinkfan-configuration-respawn
|
||||
thinkfan-configuration-extra-options
|
||||
|
||||
thinkfan-shepherd-service
|
||||
thinkfan-service-type))
|
||||
|
||||
(define-record-type* <thinkfan-configuration>
|
||||
thinkfan-configuration make-thinkfan-configuration
|
||||
thinkfan-configuration?
|
||||
(requirement thinkfan-configuration-requirement ;list of symbols
|
||||
(requirement thinkfan-configuration-requirement ; list of symbols
|
||||
(default '(user-processes)))
|
||||
(pid-file thinkfan-configuration-pid-file ;string
|
||||
(pid-file thinkfan-configuration-pid-file ; string
|
||||
(default "/var/run/thinkfan.pid"))
|
||||
(config-file thinkfan-configuration-config-file ;#f | file-like
|
||||
(default (local-file "/etc/thinkfan.conf")))
|
||||
(respawn? thinkfan-configuration-respawn? ;boolean
|
||||
(config-file thinkfan-configuration-config-file ; string
|
||||
(default "/etc/thinkfan.conf"))
|
||||
(log-file thinkfan-configuration-log-file ; string
|
||||
(default "/var/log/thinkfan.log"))
|
||||
(respawn? thinkfan-configuration-respawn? ; boolean
|
||||
(default #t))
|
||||
(extra-options thinkfan-configuration-extra-options ;list of strings
|
||||
(extra-options thinkfan-configuration-extra-options ; list of strings
|
||||
(default '())))
|
||||
|
||||
(define (thinkfan-shepherd-service config)
|
||||
(match-record config <thinkfan-configuration>
|
||||
(requirement pid-file config-file respawn? extra-options)
|
||||
(requirement pid-file config-file log-file respawn? extra-options)
|
||||
(list (shepherd-service
|
||||
(provision '(thinkfan))
|
||||
(documentation
|
||||
|
@ -35,12 +45,10 @@
|
|||
(requirement requirement)
|
||||
(start #~(make-forkexec-constructor
|
||||
(list (string-append #$thinkfan-next "/sbin/thinkfan")
|
||||
#$@(if config-file
|
||||
#~((string-append "-c" #$config-file))
|
||||
#~())
|
||||
(string-append "-c" #$config-file)
|
||||
#$@extra-options)
|
||||
#:pid-file #$pid-file
|
||||
#:log-file "/var/log/thinkfan.log"))
|
||||
#:log-file #$log-file))
|
||||
(stop #~(make-kill-destructor))
|
||||
(one-shot? #t)
|
||||
(respawn? respawn?)))))
|
||||
|
|
Loading…
Reference in New Issue