rekahsoft: Forward logs to logs.home.rekahsoft.ca for all vms

This commit is contained in:
Collin J. Doering 2023-03-28 23:02:40 -04:00
parent 81708f110b
commit 94ad8297ab
Signed by: rekahsoft
GPG Key ID: 7B4DEB93212B3022
1 changed files with 34 additions and 0 deletions

View File

@ -18,6 +18,36 @@
(define %automation-user "auto")
(define %guix-key (local-file "../../../.pubkeys/guix-coordinator-key.pub"))
(define %syslog-configuration
(plain-file "syslog.conf"
"
# Log all error messages, authentication messages of
# level notice or higher and anything of level err or
# higher to the console.
# Don't log private authentication messages!
*.alert;auth.notice;authpriv.none -/dev/console
# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none -/var/log/messages
# Log \"debug\"-level entries and nothing else.
*.=debug -/var/log/debug
# Same, in a different place.
*.info;mail.none;authpriv.none -/dev/tty12
# The authpriv file has restricted access.
# 'fsync' the file after each line (hence the lack of a leading dash).
authpriv.* /var/log/secure
# Log all the mail messages in one place.
mail.* -/var/log/maillog
# Forward all logs to remote syslog server
* @logs.home.rekahsoft.ca:514
"))
;; Services need to be exposed this way so they can be overriden via guix's special
;; record inheritance. Otherwise, if trying to directly use an operating-system's
;; services, an error will be recieved about an abiguous-service called 'system.
@ -39,6 +69,10 @@
(service elogind-service-type))
(modify-services
%base-services
(syslog-service-type
config => (syslog-configuration
(inherit config)
(config-file %syslog-configuration)))
(guix-service-type
config => (guix-configuration
(inherit config)