[systemd-devel] [PATCH] core/main.c: only reopen /dev/console if we switch-root to a custom init

Harald Hoyer harald at redhat.com
Thu Jul 12 01:09:16 PDT 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 12.07.2012 09:34, schrieb Paul Menzel:
> Dear Harald,
> 
> 
> thank you for the patch.
> 
> 
> Am Donnerstag, den 12.07.2012, 08:43 +0200 schrieb harald at redhat.com:
>> From: Harald Hoyer <harald at redhat.com>
> 
> What happens otherwise? Is there an error message?
> 
>> --- src/core/main.c |    6 +++--- 1 file changed, 3 insertions(+), 3
>> deletions(-)
>> 
>> diff --git a/src/core/main.c b/src/core/main.c index 6f6b565..a7172c1
>> 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -1672,9 +1672,6 @@
>> finish: * rebooted while we do that */ watchdog_close(true);
>> 
>> -                /* Reopen the console */ -
>> make_console_stdio(); - if (switch_root_dir) { r =
>> switch_root(switch_root_dir); if (r < 0) @@ -1711,6 +1708,9 @@ finish: 
>> execv(args[0], (char* const*) args); }
>> 
>> +                /* Reopen the console */ +
>> make_console_stdio(); + /* Try the fallback, if there is any, without
>> any * serialization. We pass the original argv[] and * envp[]. (Well,
>> modulo the ordering changes due to
> 
> 
> Thanks,
> 
> Paul
> 

systemd gets an unnecessary SIGHUP, which leads to systemd reloading its
config and running its generators again.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJP/oYkAAoJEANOs3ABTfJwb0wQAIsB+iTik08F1Ky+9ItEGme0
ffqWgiTdP8EXSszDVpolUSHVNNDu9CuT7Yk2RCp5WgjzFt27KaLQZ/ovdPyGAOKg
kUeVVoC8SK4F/2h/DK+V3Jr1enuzigYsT9Fpow5s9cKnTZC5q98wigPcKLy9Mmf6
ogsuEAbwVckG+ogscvWiqNn9Em3llfHxVvt7E3klDADBjZ1NwB2EYq/epAOXA9U1
pXYX4etxGoGfjwTUWF4z2Cda6+Dvm6rXOKZ2TA33wcoGY4cKXbl+McbFEXKIFLxB
CF8btyn6WLoOLR8TMzx1xIubjhwgP2L8OadMGhg717W+kWMIiFU3OExRXAmbOlw9
deKaICkZeMGqLI62LWb0T3gu7+WugoTh4WWOFAIAE6ksKWAr4QjcDgRQYM+ZJzoi
cyhLe9hVsu9mJXELBFyyhOZ20zWOA3cu8p6+sASfddsXvB/AEG1zNJ1hXEjoRaqk
5wVV7LbN9nuwx3WLv3fIHOcjGbmUsnBfUb1a+5++T774xyLCaIo3Pc22hl1GYijB
nOub9hRzQ+9bB+rqwt4DXMAFwzHesehzzDGs1kNyOGN6dHTIEpneC8X/YtbMgT53
G7vMUfFv7UU3YgQ2Lr/1c6268tU0xa7ojnQPNvTjt37wDGhUHpOZZUYbGLVzAmEc
SgyQnYAx1WJ9oCfW626C
=udly
-----END PGP SIGNATURE-----


More information about the systemd-devel mailing list