services: agetty: Call default-serial-port only when starting.

* gnu/services/base.scm (agetty-shepherd-service): Call default-serial-port
only when starting.
This commit is contained in:
Danny Milosavljevic 2018-03-08 09:50:07 +01:00
parent 770986d541
commit c32e3ddedd
No known key found for this signature in database
GPG Key ID: E71A35542C30BAA5
1 changed files with 112 additions and 109 deletions

View File

@ -937,8 +937,10 @@ to use as the tty. This is primarily useful for headless systems."
;; mingetty-shepherd-service). ;; mingetty-shepherd-service).
(requirement '(user-processes host-name udev)) (requirement '(user-processes host-name udev))
(start #~(let ((tty #$(default-serial-port))) (start #~(lambda args
(if tty (let ((defaulted-tty #$(or tty (default-serial-port))))
(apply
(if defaulted-tty
(make-forkexec-constructor (make-forkexec-constructor
(list #$(file-append util-linux "/sbin/agetty") (list #$(file-append util-linux "/sbin/agetty")
#$@extra-options #$@extra-options
@ -1042,14 +1044,15 @@ to use as the tty. This is primarily useful for headless systems."
#$@(if login-pause? #$@(if login-pause?
#~("--login-pause") #~("--login-pause")
#~()) #~())
#$(or tty (default-serial-port)) defaulted-tty
#$@(if baud-rate #$@(if baud-rate
#~(#$baud-rate) #~(#$baud-rate)
#~()) #~())
#$@(if term #$@(if term
#~(#$term) #~(#$term)
#~())))) #~())))
(const #f))) ; never start. (const #f)) ; never start.
args))))
(stop #~(make-kill-destructor))))))) (stop #~(make-kill-destructor)))))))
(define agetty-service-type (define agetty-service-type