summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexander.larsson@gmail.com>2016-07-29 00:24:43 +0200
committerGitHub <noreply@github.com>2016-07-29 00:24:43 +0200
commit003ef9ee2ef3557e025394957364cbe6e4f323b2 (patch)
tree2e4d276612920cd3cc5d3e4a0141160573152e42
parentcb9c13cda7bca7a89453cb57785df8af54898b00 (diff)
downloadflatpak-revert-202-journal-setup.tar.gz
Revert "Set up logging to the journal"revert-202-journal-setup
-rw-r--r--app/flatpak-builtins-run.c28
-rw-r--r--common/flatpak-run.c58
-rw-r--r--common/flatpak-run.h2
-rw-r--r--configure.ac2
-rw-r--r--doc/flatpak-run.xml8
5 files changed, 3 insertions, 95 deletions
diff --git a/app/flatpak-builtins-run.c b/app/flatpak-builtins-run.c
index 6c56da94..05dc291d 100644
--- a/app/flatpak-builtins-run.c
+++ b/app/flatpak-builtins-run.c
@@ -45,30 +45,6 @@ static gboolean opt_log_session_bus;
static gboolean opt_log_system_bus;
static char *opt_runtime;
static char *opt_runtime_version;
-static FlatpakRunFlags journal_flags;
-
-static gboolean
-opt_journal_cb (const char *option_name,
- const char *value,
- gpointer data,
- GError **error)
-{
- if (strcmp (value, "yes") == 0)
- journal_flags = FLATPAK_RUN_FLAG_JOURNAL;
- else if (strcmp (value, "no") == 0)
- journal_flags = FLATPAK_RUN_FLAG_NO_JOURNAL;
- else if (strcmp (value, "auto") == 0)
- journal_flags = 0;
- else
- {
- journal_flags = 0;
- g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_FAILED,
- _("Unknown journal option %s, valid options are: yes, no, auto"), value);
- return FALSE;
- }
-
- return TRUE;
-}
static GOptionEntry options[] = {
{ "arch", 0, 0, G_OPTION_ARG_STRING, &opt_arch, N_("Arch to use"), N_("ARCH") },
@@ -79,7 +55,6 @@ static GOptionEntry options[] = {
{ "runtime-version", 0, 0, G_OPTION_ARG_STRING, &opt_runtime_version, N_("Runtime version to use"), N_("VERSION") },
{ "log-session-bus", 0, 0, G_OPTION_ARG_NONE, &opt_log_session_bus, N_("Log session bus calls"), NULL },
{ "log-system-bus", 0, 0, G_OPTION_ARG_NONE, &opt_log_system_bus, N_("Log system bus calls"), NULL },
- { "journal", 0, 0, G_OPTION_ARG_CALLBACK, &opt_journal_cb, N_("Redirect stdout and stderr to the journal"), N_("VALUE") },
{ NULL }
};
@@ -152,8 +127,7 @@ flatpak_builtin_run (int argc, char **argv, GCancellable *cancellable, GError **
opt_runtime_version,
(opt_devel ? FLATPAK_RUN_FLAG_DEVEL : 0) |
(opt_log_session_bus ? FLATPAK_RUN_FLAG_LOG_SESSION_BUS : 0) |
- (opt_log_system_bus ? FLATPAK_RUN_FLAG_LOG_SYSTEM_BUS : 0) |
- journal_flags,
+ (opt_log_system_bus ? FLATPAK_RUN_FLAG_LOG_SYSTEM_BUS : 0),
opt_command,
&argv[rest_argv_start + 1],
rest_argc - 1,
diff --git a/common/flatpak-run.c b/common/flatpak-run.c
index eb67025e..64a0b2bc 100644
--- a/common/flatpak-run.c
+++ b/common/flatpak-run.c
@@ -42,9 +42,6 @@
#include "libgsystem.h"
#include "libglnx/libglnx.h"
-#include <syslog.h>
-#include <systemd/sd-journal.h>
-
#include "flatpak-run.h"
#include "flatpak-proxy.h"
#include "flatpak-utils.h"
@@ -3037,34 +3034,6 @@ clear_fd (gpointer data)
close (*fd_p);
}
-static gboolean
-connect_journal (const char *app_id, GError **error)
-{
- int fd;
-
- /* redirect stdout and stderr to the systemd journal */
- fd = sd_journal_stream_fd (app_id, LOG_INFO, TRUE);
- if (fd < 0)
- {
- g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno),
- _("Failed to create journal stream fd"));
- return FALSE;
- }
-
- if (dup3 (fd, STDOUT_FILENO, 0) < 0 ||
- dup3 (fd, STDERR_FILENO, 0) < 0)
- {
- g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno),
- _("Failed to duplicate journal stream fd"));
- return FALSE;
- }
-
- if (fd >= 3)
- close (fd);
-
- return TRUE;
-}
-
static void
child_setup (gpointer user_data)
{
@@ -3080,25 +3049,6 @@ child_setup (gpointer user_data)
fcntl (g_array_index (fd_array, int, i), F_SETFD, 0);
}
-static void
-child_setup_with_journal (gpointer user_data)
-{
- connect_journal ("", NULL);
- child_setup (user_data);
-}
-
-static gboolean
-should_use_journal (FlatpakRunFlags flags)
-{
- if ((flags & FLATPAK_RUN_FLAG_NO_JOURNAL) != 0)
- return FALSE;
- else if ((flags & FLATPAK_RUN_FLAG_JOURNAL) != 0)
- return TRUE;
- else if (isatty (fileno (stderr)))
- return FALSE;
- else
- return TRUE;
-}
gboolean
flatpak_run_app (const char *app_ref,
@@ -3315,19 +3265,13 @@ flatpak_run_app (const char *app_ref,
(char **) real_argv_array->pdata,
envp,
G_SPAWN_DEFAULT,
- should_use_journal (flags)
- ? child_setup_with_journal
- : child_setup,
- fd_array,
+ child_setup, fd_array,
NULL,
error))
return FALSE;
}
else
{
- if (should_use_journal (flags) && !connect_journal (app_ref_parts[1], error))
- return FALSE;
-
if (execvpe (flatpak_get_bwrap (), (char **) real_argv_array->pdata, envp) == -1)
{
g_set_error_literal (error, G_IO_ERROR, g_io_error_from_errno (errno),
diff --git a/common/flatpak-run.h b/common/flatpak-run.h
index 652df9f0..00530319 100644
--- a/common/flatpak-run.h
+++ b/common/flatpak-run.h
@@ -98,8 +98,6 @@ typedef enum {
FLATPAK_RUN_FLAG_LOG_SESSION_BUS = (1 << 2),
FLATPAK_RUN_FLAG_LOG_SYSTEM_BUS = (1 << 3),
FLATPAK_RUN_FLAG_NO_SESSION_HELPER = (1 << 4),
- FLATPAK_RUN_FLAG_JOURNAL = (1 << 5),
- FLATPAK_RUN_FLAG_NO_JOURNAL = (1 << 6)
} FlatpakRunFlags;
gboolean flatpak_run_setup_base_argv (GPtrArray *argv_array,
diff --git a/configure.ac b/configure.ac
index a4e6ac0b..ba84b430 100644
--- a/configure.ac
+++ b/configure.ac
@@ -125,7 +125,7 @@ AC_SUBST([GDBUS_CODEGEN], [`$PKG_CONFIG --variable gdbus_codegen gio-2.0`])
POLKIT_GOBJECT_REQUIRED=0.98
-PKG_CHECK_MODULES(BASE, [glib-2.0 >= $GLIB_REQS gio-2.0 gio-unix-2.0 libsystemd])
+PKG_CHECK_MODULES(BASE, [glib-2.0 >= $GLIB_REQS gio-2.0 gio-unix-2.0])
PKG_CHECK_MODULES(SOUP, [libsoup-2.4])
AC_ARG_ENABLE([system-helper],
diff --git a/doc/flatpak-run.xml b/doc/flatpak-run.xml
index 47dda4d2..f9ce1091 100644
--- a/doc/flatpak-run.xml
+++ b/doc/flatpak-run.xml
@@ -319,14 +319,6 @@
your D-Bus policy.
</para></listitem>
</varlistentry>
-
- <varlistentry>
- <term><option>--journal=VALUE</option></term>
-
- <listitem><para>
- Control whether to redirect stdout and stderr of the sandbox to the systemd journal. Possible values are yes, no or auto. In the latter case, only redirect if stderr is not a tty. The default is auto.
- </para></listitem>
- </varlistentry>
</variablelist>
</refsect1>