feat: add log-file entry to thinkfan-service-configuration in (radix services linux)

pull/1/head
anemofilia 2023-09-25 13:56:31 -03:00
parent 50a545303f
commit d9a1fc0018
No known key found for this signature in database
GPG Key ID: 5A8F3D62C87A2B33
1 changed files with 19 additions and 11 deletions

View File

@ -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?)))))