2017-03-09 15:23:02 -06:00
|
|
|
#!@SBINDIR@/openrc-run
|
|
|
|
# Copyright (c) 2017 The OpenRC Authors.
|
|
|
|
# See the Authors file at the top-level directory of this distribution and
|
2021-12-20 20:07:00 -05:00
|
|
|
# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS
|
2017-03-09 15:23:02 -06:00
|
|
|
#
|
|
|
|
# This file is part of OpenRC. It is subject to the license terms in
|
|
|
|
# the LICENSE file found in the top-level directory of this
|
2021-12-20 20:07:00 -05:00
|
|
|
# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE
|
2017-03-09 15:23:02 -06:00
|
|
|
# This file may not be copied, modified, propagated, or distributed
|
|
|
|
# except according to the terms contained in the LICENSE file.
|
|
|
|
|
|
|
|
description="start agetty on a terminal line"
|
|
|
|
supervisor=supervise-daemon
|
|
|
|
port="${RC_SVCNAME#*.}"
|
2018-12-06 16:37:40 -06:00
|
|
|
respawn_period="${respawn_period:-60}"
|
2017-03-09 15:23:02 -06:00
|
|
|
term_type="${term_type:-linux}"
|
|
|
|
command=/sbin/agetty
|
2017-05-22 12:46:55 -05:00
|
|
|
command_args_foreground="${agetty_options} ${port} ${baud} ${term_type}"
|
2017-03-09 15:23:02 -06:00
|
|
|
pidfile="/run/${RC_SVCNAME}.pid"
|
|
|
|
|
|
|
|
depend() {
|
|
|
|
after local
|
2017-03-31 16:21:28 -05:00
|
|
|
keyword -prefix
|
2019-07-29 16:41:25 -05:00
|
|
|
provide getty
|
2017-03-09 15:23:02 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
start_pre() {
|
2019-08-18 21:13:41 +08:00
|
|
|
if [ "$port" = "$RC_SVCNAME" ]; then
|
2017-03-09 15:23:02 -06:00
|
|
|
eerror "${RC_SVCNAME} cannot be started directly. You must create"
|
|
|
|
eerror "symbolic links to it for the ports you want to start"
|
|
|
|
eerror "agetty on and add those to the appropriate runlevels."
|
|
|
|
return 1
|
2018-03-14 20:37:02 -05:00
|
|
|
else
|
|
|
|
export EINFO_QUIET="${quiet:-yes}"
|
2017-03-09 15:23:02 -06:00
|
|
|
fi
|
|
|
|
}
|
2018-03-14 20:37:02 -05:00
|
|
|
|
|
|
|
stop_pre()
|
|
|
|
{
|
|
|
|
export EINFO_QUIET="${quiet:-yes}"
|
|
|
|
}
|