![Michał Łyszczek](/assets/img/avatar_default.png)
We install a template getty service, and we 'instantiate' it in the default runlevel, using the configured tty. Ideally, packages that provide a getty program would be responsible for installing the corresponding service file. However, to keep consistency with the existing init systems (busybox, systemd, and sysv), so we do provide it from the openrc package itself. OpenRC only acts on the files in a runlevel sub-directory, but the documentation [0] actually suggests that the instance symlink be done in init.d, and then again symlinked into the actual runlevel sub-directory. So, we abide by the rules. Also, to be noted, the getty service file is installed without ensuring that a getty command is available. This again is not unlike other init systems, sysvinit and busybox, which behave the same. [0] https://wiki.gentoo.org/wiki/OpenRC Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl> [yann.morin.1998@free.fr: - move getty template to openrc package (Thomas) - fix namespace of the vaiables (Thomas) - simplify creation of the defaults file - rewrite commit log ] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
25 lines
497 B
Plaintext
Executable file
25 lines
497 B
Plaintext
Executable file
#!/sbin/openrc-run
|
|
# based on agetty service from OpenRC package
|
|
|
|
description="start getty on terminal"
|
|
supervisor=supervise-daemon
|
|
port="${RC_SVCNAME#*.}"
|
|
term_type="${term_type:-linux}"
|
|
command=/sbin/getty
|
|
command_args_foreground="${getty_options} ${baud} ${port} ${term_type}"
|
|
pidfile="/run/${RC_SVCNAME}.pid"
|
|
|
|
depend() {
|
|
# start getty at the very end of init
|
|
after *
|
|
keyword -prefix
|
|
}
|
|
|
|
start_pre() {
|
|
export EINFO_QUIET="${quiet:-yes}"
|
|
}
|
|
|
|
stop_pre() {
|
|
export EINFO_QUIET="${quiet:-yes}"
|
|
}
|