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

View File

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