services: Add 'rottlog-service-type' to '%base-services'.
* gnu/services/base.scm (%base-services): Add an instance of ROTTLOG-SERVICE-TYPE. * doc/guix.texi (Log Rotation): Mention that it's part of %BASE-SERVICES and change example.
This commit is contained in:
		
							parent
							
								
									11dee1bb8f
								
							
						
					
					
						commit
						0468455e7d
					
				
					 2 changed files with 17 additions and 5 deletions
				
			
		| 
						 | 
					@ -13186,17 +13186,27 @@ their contents in separate files, possibly compressed.  The @code{(gnu
 | 
				
			||||||
services admin)} module provides an interface to GNU@tie{}Rot[t]log, a
 | 
					services admin)} module provides an interface to GNU@tie{}Rot[t]log, a
 | 
				
			||||||
log rotation tool (@pxref{Top,,, rottlog, GNU Rot[t]log Manual}).
 | 
					log rotation tool (@pxref{Top,,, rottlog, GNU Rot[t]log Manual}).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The example below defines an operating system that provides log rotation
 | 
					This service is part of @code{%base-services}, and thus enabled by
 | 
				
			||||||
with the default settings, for commonly encountered log files.
 | 
					default, with the default settings, for commonly encountered log files.
 | 
				
			||||||
 | 
					The example below shows how to extend it with an additional
 | 
				
			||||||
 | 
					@dfn{rotation}, should you need to do that (usually, services that
 | 
				
			||||||
 | 
					produce log files already take care of that):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@lisp
 | 
					@lisp
 | 
				
			||||||
(use-modules (guix) (gnu))
 | 
					(use-modules (guix) (gnu))
 | 
				
			||||||
(use-service-modules admin mcron)
 | 
					(use-service-modules admin)
 | 
				
			||||||
(use-package-modules base idutils)
 | 
					
 | 
				
			||||||
 | 
					(define my-log-files
 | 
				
			||||||
 | 
					  ;; Log files that I want to rotate.
 | 
				
			||||||
 | 
					  '("/var/log/something.log" "/var/log/another.log"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(operating-system
 | 
					(operating-system
 | 
				
			||||||
  ;; @dots{}
 | 
					  ;; @dots{}
 | 
				
			||||||
  (services (cons (service rottlog-service-type)
 | 
					  (services (cons (simple-service 'rotate-my-stuff
 | 
				
			||||||
 | 
					                                  rottlog-service-type
 | 
				
			||||||
 | 
					                                  (list (log-rotation
 | 
				
			||||||
 | 
					                                         (frequency 'daily)
 | 
				
			||||||
 | 
					                                         (files my-log-files))))
 | 
				
			||||||
                  %base-services)))
 | 
					                  %base-services)))
 | 
				
			||||||
@end lisp
 | 
					@end lisp
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2444,6 +2444,8 @@ to handle."
 | 
				
			||||||
        (service guix-service-type)
 | 
					        (service guix-service-type)
 | 
				
			||||||
        (service nscd-service-type)
 | 
					        (service nscd-service-type)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        (service rottlog-service-type)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ;; The LVM2 rules are needed as soon as LVM2 or the device-mapper is
 | 
					        ;; The LVM2 rules are needed as soon as LVM2 or the device-mapper is
 | 
				
			||||||
        ;; used, so enable them by default.  The FUSE and ALSA rules are
 | 
					        ;; used, so enable them by default.  The FUSE and ALSA rules are
 | 
				
			||||||
        ;; less critical, but handy.
 | 
					        ;; less critical, but handy.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue