Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
steam
systemd
Commits
f212ac12
Commit
f212ac12
authored
Feb 14, 2011
by
Lennart Poettering
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getty: do not auto-spawn getty's on VC ttys if console=ttyN is used
https://bugzilla.redhat.com/show_bug.cgi?id=676885
parent
7a57b332
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
4 deletions
+22
-4
TODO
TODO
+4
-0
src/target.c
src/target.c
+6
-1
src/util.c
src/util.c
+11
-3
src/util.h
src/util.h
+1
-0
No files found.
TODO
View file @
f212ac12
...
...
@@ -11,6 +11,10 @@ Bugs:
Features:
* look up crypto partition mount points via fstab to show to the user when prompting for a password
* prohibit socket activation of sysv services
* Maybe store in unit files whether a service should be enabled by default on package installation
* perhaps add "systemctl reenable" as combination of "systemctl disable" and "systemctl enable"
...
...
src/target.c
View file @
f212ac12
...
...
@@ -91,7 +91,12 @@ static int target_add_getty_dependencies(Target *t) {
/* Automatically add in a serial getty on the kernel
* console */
if
(
t
->
meta
.
manager
->
console
)
{
if
(
t
->
meta
.
manager
->
console
&&
!
tty_is_vc
(
t
->
meta
.
manager
->
console
))
{
/* We assume that gettys on virtual terminals are
* started via manual configuration and do this magic
* only for non-VC terminals. */
log_debug
(
"Automatically adding serial getty for %s"
,
t
->
meta
.
manager
->
console
);
if
(
!
(
n
=
unit_name_replace_instance
(
SPECIAL_SERIAL_GETTY_SERVICE
,
t
->
meta
.
manager
->
console
)))
return
-
ENOMEM
;
...
...
src/util.c
View file @
f212ac12
...
...
@@ -3549,6 +3549,16 @@ void filter_environ(const char *prefix) {
environ
[
j
]
=
NULL
;
}
bool
tty_is_vc
(
const
char
*
tty
)
{
assert
(
tty
);
if
(
startswith
(
tty
,
"/dev/"
))
tty
+=
5
;
return
startswith
(
tty
,
"tty"
)
&&
tty
[
3
]
>=
'0'
&&
tty
[
3
]
<=
'9'
;
}
const
char
*
default_term_for_tty
(
const
char
*
tty
)
{
char
*
active
=
NULL
;
const
char
*
term
;
...
...
@@ -3566,9 +3576,7 @@ const char *default_term_for_tty(const char *tty) {
tty
=
active
;
}
term
=
(
startswith
(
tty
,
"tty"
)
&&
tty
[
3
]
>=
'0'
&&
tty
[
3
]
<=
'9'
)
?
"TERM=linux"
:
"TERM=vt100"
;
term
=
tty_is_vc
(
tty
)
?
"TERM=linux"
:
"TERM=vt100"
;
free
(
active
);
return
term
;
...
...
src/util.h
View file @
f212ac12
...
...
@@ -370,6 +370,7 @@ char *fstab_node_to_udev_node(const char *p);
void
filter_environ
(
const
char
*
prefix
);
bool
tty_is_vc
(
const
char
*
tty
);
const
char
*
default_term_for_tty
(
const
char
*
tty
);
bool
running_in_vm
(
void
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment