mirror of
https://gitlab.univ-nantes.fr/glicid-public/guix-glicid.git
synced 2025-04-29 21:58:36 +02:00
adding rsyslog service
This commit is contained in:
parent
a5267c68d5
commit
a706564483
1 changed files with 56 additions and 0 deletions
56
glicid/services/logging.scm
Normal file
56
glicid/services/logging.scm
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
(define-module (glicid services rsyslog)
|
||||||
|
#:use-module (gnu packages logging)
|
||||||
|
#:use-module (gnu services)
|
||||||
|
#:use-module (gnu services shepherd)
|
||||||
|
#:use-module (guix)
|
||||||
|
#:use-module (guix records)
|
||||||
|
#:use-module (ice-9 match)
|
||||||
|
#: export (
|
||||||
|
rsyslog-configuration
|
||||||
|
rsyslog-configuration?
|
||||||
|
rsyslog-shepherd-service
|
||||||
|
rsyslog-service-type
|
||||||
|
))
|
||||||
|
|
||||||
|
(define-record-type*
|
||||||
|
<rsyslog-configuration>
|
||||||
|
rsyslog-configuration make-rsyslog-configuration
|
||||||
|
rsyslog-configuration?
|
||||||
|
(rsyslog-pkg rsyslog-pkg (default rsyslog))
|
||||||
|
(pid-file pid-file (default "/var/run/rsyslog/rsyslog.pid"))
|
||||||
|
(config-file config-file (default (file-append rsyslog "/etc/rsyslog/rsyslog.conf")))
|
||||||
|
(log-file log-file (default "/var/log/rsyslog.log")))
|
||||||
|
|
||||||
|
(define rsyslog-shepherd-service
|
||||||
|
(match-lambda
|
||||||
|
(($ <rsyslog-configuration> rsyslog-pkg logflags pid-file config-file log-file)
|
||||||
|
(list
|
||||||
|
(shepherd-service
|
||||||
|
(provision '(rsyslog))
|
||||||
|
(documentation "Run rsyslog.")
|
||||||
|
(requirement '(user-processes))
|
||||||
|
(respawn? #t)
|
||||||
|
(start #~(make-forkexec-constructor
|
||||||
|
(list
|
||||||
|
#$(file-append pkg "/sbin/rsyslog")
|
||||||
|
"-f" #$config-file
|
||||||
|
"-n"
|
||||||
|
)
|
||||||
|
#:pid-file #$pid-file
|
||||||
|
#:log-file #$log-file ))
|
||||||
|
(stop #~(make-kill-destructor)))))))
|
||||||
|
|
||||||
|
|
||||||
|
(define %rsyslog-activation
|
||||||
|
#~(begin
|
||||||
|
(mkdir-p "/var/run/rsyslog")
|
||||||
|
(mkdir-p "/var/lib/rsyslog")
|
||||||
|
#t ))
|
||||||
|
|
||||||
|
(define rsyslog-service-type
|
||||||
|
(service-type
|
||||||
|
(name 'rsyslog)
|
||||||
|
(extensions (list
|
||||||
|
(service-extension shepherd-root-service-type rsyslog-shepherd-service)
|
||||||
|
(service-extension activation-service-type (const %rsyslog-activation))))
|
||||||
|
(description "Run @uref{https://www.rsyslog.org, rsyslog} community developped LDAP software.")))
|
Loading…
Add table
Reference in a new issue