forked from pool/plymouth
This commit is contained in:
parent
eab389a3ef
commit
6c4aee52e2
@ -1,34 +0,0 @@
|
|||||||
From 41560df672d0aeb954874b6d0aa81849ab35ca71 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ray Strode <rstrode@redhat.com>
|
|
||||||
Date: Mon, 10 Jun 2013 10:44:56 -0400
|
|
||||||
Subject: [PATCH] terminal-session: plug /dev/console fd leak
|
|
||||||
|
|
||||||
When we stop redirecting console messages, we temporarly open
|
|
||||||
/dev/console. We don't ever close it.
|
|
||||||
|
|
||||||
This commit fixes that.
|
|
||||||
---
|
|
||||||
src/libply/ply-terminal-session.c | 6 +++++-
|
|
||||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/libply/ply-terminal-session.c b/src/libply/ply-terminal-session.c
|
|
||||||
index 3d43709..e7377e9 100644
|
|
||||||
--- a/src/libply/ply-terminal-session.c
|
|
||||||
+++ b/src/libply/ply-terminal-session.c
|
|
||||||
@@ -213,8 +213,12 @@ ply_terminal_session_unredirect_console (ply_terminal_session_t *session)
|
|
||||||
assert (session->console_is_redirected);
|
|
||||||
|
|
||||||
fd = open ("/dev/console", O_RDWR | O_NOCTTY);
|
|
||||||
- if (fd >= 0)
|
|
||||||
+ if (fd >= 0) {
|
|
||||||
ioctl (fd, TIOCCONS);
|
|
||||||
+ close (fd);
|
|
||||||
+ } else {
|
|
||||||
+ ply_trace ("couldn't open /dev/console to stop redirecting it: %m");
|
|
||||||
+ }
|
|
||||||
|
|
||||||
session->console_is_redirected = false;
|
|
||||||
}
|
|
||||||
--
|
|
||||||
1.8.1.4
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
|||||||
From 95a4fd9cb721f3e8355a944db85462ef15603e1f Mon Sep 17 00:00:00 2001
|
|
||||||
From: Frederic Crozat <fcrozat@suse.com>
|
|
||||||
Date: Mon, 10 Jun 2013 18:54:47 +0200
|
|
||||||
Subject: [PATCH] systemd: make sure to ignore all exit codes in ExecStartPost
|
|
||||||
|
|
||||||
---
|
|
||||||
systemd-units/plymouth-start.service.in | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
Index: plymouth-0.8.8_git201304161248/systemd-units/plymouth-start.service.in
|
|
||||||
===================================================================
|
|
||||||
--- plymouth-0.8.8_git201304161248.orig/systemd-units/plymouth-start.service.in
|
|
||||||
+++ plymouth-0.8.8_git201304161248/systemd-units/plymouth-start.service.in
|
|
||||||
@@ -8,7 +8,7 @@ ConditionKernelCommandLine=!plymouth.ena
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
ExecStart=@PLYMOUTH_DAEMON_DIR@/plymouthd --mode=boot --pid-file=@plymouthruntimedir@/pid --attach-to-session
|
|
||||||
-ExecStartPost=-@UDEVADM@ settle --timeout=30 --exit-if-exists=/sys/class/drm/card0/dev ; @UDEVADM@ settle --timeout=30 --exit-if-exists=/sys/class/graphics/fb0/dev ; @PLYMOUTH_CLIENT_DIR@/plymouth show-splash
|
|
||||||
+ExecStartPost=-@UDEVADM@ settle --timeout=30 --exit-if-exists=/sys/class/drm/card0/dev ; -@UDEVADM@ settle --timeout=30 --exit-if-exists=/sys/class/graphics/fb0/dev ; -@PLYMOUTH_CLIENT_DIR@/plymouth show-splash
|
|
||||||
Type=forking
|
|
||||||
KillMode=none
|
|
||||||
SendSIGKILL=no
|
|
@ -1,176 +0,0 @@
|
|||||||
From 0d610f91e2bfc85f2e9a4c037adc91306e4faf62 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Frederic Crozat <fcrozat@suse.com>
|
|
||||||
Date: Mon, 10 Jun 2013 18:44:08 +0200
|
|
||||||
Subject: [PATCH] main: redirect standard io to /dev/null
|
|
||||||
|
|
||||||
do not redirect standard io to console tty anymore, it can cause issue
|
|
||||||
with Xorg grabbing tty
|
|
||||||
(https://bugzilla.novell.com/show_bug.cgi?id=811185).
|
|
||||||
|
|
||||||
Initial patch by Ray Strode
|
|
||||||
---
|
|
||||||
src/main.c | 87 +++++++++++++++++++++++++++++++++++++++-----------------------
|
|
||||||
1 file changed, 55 insertions(+), 32 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/main.c b/src/main.c
|
|
||||||
index e0d087c..2a9c84d 100644
|
|
||||||
--- a/src/main.c
|
|
||||||
+++ b/src/main.c
|
|
||||||
@@ -616,7 +616,7 @@ get_cache_file_for_mode (ply_mode_t mode)
|
|
||||||
filename = NULL;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
- fprintf (stderr, "Unhandled case in %s line %d\n", __FILE__, __LINE__);
|
|
||||||
+ ply_error ("Unhandled case in %s line %d\n", __FILE__, __LINE__);
|
|
||||||
abort ();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
@@ -640,7 +640,7 @@ get_log_file_for_mode (ply_mode_t mode)
|
|
||||||
filename = _PATH_DEVNULL;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
- fprintf (stderr, "Unhandled case in %s line %d\n", __FILE__, __LINE__);
|
|
||||||
+ ply_error ("Unhandled case in %s line %d\n", __FILE__, __LINE__);
|
|
||||||
abort ();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
@@ -664,7 +664,7 @@ get_log_spool_file_for_mode (ply_mode_t mode)
|
|
||||||
filename = NULL;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
- fprintf (stderr, "Unhandled case in %s line %d\n", __FILE__, __LINE__);
|
|
||||||
+ ply_error ("Unhandled case in %s line %d\n", __FILE__, __LINE__);
|
|
||||||
abort ();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
@@ -1098,6 +1098,13 @@ deactivate_splash (state_t *state)
|
|
||||||
ply_terminal_stop_watching_for_vt_changes (state->local_console_terminal);
|
|
||||||
ply_terminal_set_buffered_input (state->local_console_terminal);
|
|
||||||
ply_terminal_ignore_mode_changes (state->local_console_terminal, true);
|
|
||||||
+ ply_terminal_close (state->local_console_terminal);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /* do not let any tty opened where we could write after deactivate */
|
|
||||||
+ if (command_line_has_argument (state->kernel_command_line, "plymouth.debug"))
|
|
||||||
+ {
|
|
||||||
+ ply_logger_close_file (ply_logger_get_error_default ());
|
|
||||||
}
|
|
||||||
|
|
||||||
state->is_inactive = true;
|
|
||||||
@@ -1191,6 +1198,7 @@ on_reactivate (state_t *state)
|
|
||||||
|
|
||||||
if (state->local_console_terminal != NULL)
|
|
||||||
{
|
|
||||||
+ ply_terminal_open (state->local_console_terminal);
|
|
||||||
ply_terminal_watch_for_vt_changes (state->local_console_terminal);
|
|
||||||
ply_terminal_set_unbuffered_input (state->local_console_terminal);
|
|
||||||
ply_terminal_ignore_mode_changes (state->local_console_terminal, false);
|
|
||||||
@@ -1890,6 +1898,33 @@ check_verbosity (state_t *state)
|
|
||||||
ply_logger_set_output_fd (ply_logger_get_error_default (), fd);
|
|
||||||
}
|
|
||||||
free (stream_copy);
|
|
||||||
+ } else {
|
|
||||||
+ const char* device;
|
|
||||||
+ char *file;
|
|
||||||
+
|
|
||||||
+ if (state->kernel_console_tty != NULL)
|
|
||||||
+ device = state->kernel_console_tty;
|
|
||||||
+ else
|
|
||||||
+ device = state->default_tty;
|
|
||||||
+
|
|
||||||
+ ply_trace ("redirecting debug output to %s", device);
|
|
||||||
+
|
|
||||||
+ if (strncmp (device, "/dev/", strlen ("/dev/")) == 0)
|
|
||||||
+ file = strdup (device);
|
|
||||||
+ else
|
|
||||||
+ asprintf (&file, "/dev/%s", device);
|
|
||||||
+
|
|
||||||
+ fd = open (file, O_RDWR | O_APPEND);
|
|
||||||
+
|
|
||||||
+ if (fd < 0)
|
|
||||||
+ {
|
|
||||||
+ ply_trace ("could not redirected debug output to %s: %m", device);
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ ply_logger_set_output_fd (ply_logger_get_error_default (), fd);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ free (file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
@@ -2157,21 +2192,11 @@ check_for_consoles (state_t *state,
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool
|
|
||||||
-redirect_standard_io_to_device (const char *device)
|
|
||||||
+redirect_standard_io_to_dev_null (void)
|
|
||||||
{
|
|
||||||
int fd;
|
|
||||||
- char *file;
|
|
||||||
|
|
||||||
- ply_trace ("redirecting stdio to %s", device);
|
|
||||||
-
|
|
||||||
- if (strncmp (device, "/dev/", strlen ("/dev/")) == 0)
|
|
||||||
- file = strdup (device);
|
|
||||||
- else
|
|
||||||
- asprintf (&file, "/dev/%s", device);
|
|
||||||
-
|
|
||||||
- fd = open (file, O_RDWR | O_APPEND);
|
|
||||||
-
|
|
||||||
- free (file);
|
|
||||||
+ fd = open ("/dev/null", O_RDWR | O_APPEND);
|
|
||||||
|
|
||||||
if (fd < 0)
|
|
||||||
return false;
|
|
||||||
@@ -2214,19 +2239,6 @@ initialize_environment (state_t *state)
|
|
||||||
if (!get_kernel_command_line (state))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
- check_verbosity (state);
|
|
||||||
- check_logging (state);
|
|
||||||
-
|
|
||||||
- ply_trace ("source built on %s", __DATE__);
|
|
||||||
-
|
|
||||||
- state->keystroke_triggers = ply_list_new ();
|
|
||||||
- state->entry_triggers = ply_list_new ();
|
|
||||||
- state->entry_buffer = ply_buffer_new();
|
|
||||||
- state->pixel_displays = ply_list_new ();
|
|
||||||
- state->text_displays = ply_list_new ();
|
|
||||||
- state->messages = ply_list_new ();
|
|
||||||
- state->keyboard = NULL;
|
|
||||||
-
|
|
||||||
if (!state->default_tty)
|
|
||||||
{
|
|
||||||
if (state->mode == PLY_MODE_SHUTDOWN)
|
|
||||||
@@ -2247,12 +2259,23 @@ initialize_environment (state_t *state)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ check_verbosity (state);
|
|
||||||
+ check_logging (state);
|
|
||||||
+
|
|
||||||
+ ply_trace ("source built on %s", __DATE__);
|
|
||||||
+
|
|
||||||
+ state->keystroke_triggers = ply_list_new ();
|
|
||||||
+ state->entry_triggers = ply_list_new ();
|
|
||||||
+ state->entry_buffer = ply_buffer_new();
|
|
||||||
+ state->pixel_displays = ply_list_new ();
|
|
||||||
+ state->text_displays = ply_list_new ();
|
|
||||||
+ state->messages = ply_list_new ();
|
|
||||||
+ state->keyboard = NULL;
|
|
||||||
+
|
|
||||||
+
|
|
||||||
check_for_consoles (state, state->default_tty, false);
|
|
||||||
|
|
||||||
- if (state->kernel_console_tty != NULL)
|
|
||||||
- redirect_standard_io_to_device (state->kernel_console_tty);
|
|
||||||
- else
|
|
||||||
- redirect_standard_io_to_device (state->default_tty);
|
|
||||||
+ redirect_standard_io_to_dev_null ();
|
|
||||||
|
|
||||||
ply_trace ("Making sure " PLYMOUTH_RUNTIME_DIR " exists");
|
|
||||||
if (!ply_create_directory (PLYMOUTH_RUNTIME_DIR))
|
|
||||||
--
|
|
||||||
1.8.1.4
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
|||||||
From 5ed074df62fe13acd491079c2156907ba9e5b3be Mon Sep 17 00:00:00 2001
|
|
||||||
From: Frederic Crozat <fcrozat@suse.com>
|
|
||||||
Date: Mon, 10 Jun 2013 18:29:57 +0200
|
|
||||||
Subject: [PATCH] terminal-session: don't close session fd if already closed
|
|
||||||
|
|
||||||
Prevents close(-1) from showing up in strace
|
|
||||||
---
|
|
||||||
src/libply/ply-terminal-session.c | 3 ++-
|
|
||||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/libply/ply-terminal-session.c b/src/libply/ply-terminal-session.c
|
|
||||||
index e7377e9..0bdb985 100644
|
|
||||||
--- a/src/libply/ply-terminal-session.c
|
|
||||||
+++ b/src/libply/ply-terminal-session.c
|
|
||||||
@@ -148,7 +148,8 @@ ply_terminal_session_free (ply_terminal_session_t *session)
|
|
||||||
|
|
||||||
ply_free_string_array (session->argv);
|
|
||||||
|
|
||||||
- close (session->pseudoterminal_master_fd);
|
|
||||||
+ if (session->pseudoterminal_master_fd >= 0)
|
|
||||||
+ close (session->pseudoterminal_master_fd);
|
|
||||||
free (session);
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
1.8.1.4
|
|
||||||
|
|
@ -4,6 +4,10 @@ Thu Aug 1 14:08:53 UTC 2013 - tittiatcoke@gmail.com
|
|||||||
- Update to version 0.8.8_git201308011340
|
- Update to version 0.8.8_git201308011340
|
||||||
- Drop patch plymouth-correct-systemd-prefix.patch
|
- Drop patch plymouth-correct-systemd-prefix.patch
|
||||||
- Drop patch plymouth-close.patch
|
- Drop patch plymouth-close.patch
|
||||||
|
- Drop patch plymouth-close-unredirect.patch
|
||||||
|
- Drop patch plymouth-redirect-null.patch
|
||||||
|
- Drop patch plymouth-exit-code.patch
|
||||||
|
- Drop patch plymouth-terminal-session-close.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Jul 29 16:23:21 UTC 2013 - tittiatcoke@gmail.com
|
Mon Jul 29 16:23:21 UTC 2013 - tittiatcoke@gmail.com
|
||||||
|
@ -43,14 +43,6 @@ Patch9: plymouth-dracut-path.patch
|
|||||||
Patch10: 0001-Some-greenish-openSUSE-colors.patch
|
Patch10: 0001-Some-greenish-openSUSE-colors.patch
|
||||||
# PATCH-OPENSUSE -- plymouth-correct-runtime-dir.patch tittiatcoke@gmail.com -- make sure the runtime directory is /run and not /var/run
|
# PATCH-OPENSUSE -- plymouth-correct-runtime-dir.patch tittiatcoke@gmail.com -- make sure the runtime directory is /run and not /var/run
|
||||||
Patch16: plymouth-correct-runtime-dir.patch
|
Patch16: plymouth-correct-runtime-dir.patch
|
||||||
# PATCH-FIX-UPSTREAM plymouth-close-deactivate.patch bnc#811185 fcrozat@suse.com -- close stdout/stderr on deactivate
|
|
||||||
Patch18: plymouth-close-unredirect.patch
|
|
||||||
# PATCH-FIX-UPSTREAM plymouth-redirect-null.patch bnc#811185 fcrozat@suse.com -- redirect standard io to /dev/null
|
|
||||||
Patch19: plymouth-redirect-null.patch
|
|
||||||
# PATCH-FIX-UPSTREAM plymouth-exit-code.patch fcrozat@suse.com -- ensure all exit code are ignored in ExecStartPost
|
|
||||||
Patch20: plymouth-exit-code.patch
|
|
||||||
# PATCH-FIX-UPSTREAM plymouth-terminal-session-close.patch fcrozat@suse.com -- do not close already closed terminal session fd
|
|
||||||
Patch21: plymouth-terminal-session-close.patch
|
|
||||||
BuildRequires: automake
|
BuildRequires: automake
|
||||||
BuildRequires: kernel-headers
|
BuildRequires: kernel-headers
|
||||||
BuildRequires: libtool
|
BuildRequires: libtool
|
||||||
@ -322,10 +314,6 @@ plugin.
|
|||||||
%patch9 -p0
|
%patch9 -p0
|
||||||
%patch10 -p1
|
%patch10 -p1
|
||||||
%patch16 -p1
|
%patch16 -p1
|
||||||
#patch18 -p1
|
|
||||||
#patch19 -p1
|
|
||||||
#patch20 -p1
|
|
||||||
%patch21 -p1
|
|
||||||
# replace builddate with patch0date
|
# replace builddate with patch0date
|
||||||
sed -i "s/__DATE__/\"$(stat -c %y %{_sourcedir}/%{name}.changes)\"/" src/main.c
|
sed -i "s/__DATE__/\"$(stat -c %y %{_sourcedir}/%{name}.changes)\"/" src/main.c
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user