aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTanu Kaskinen <tanuk@iki.fi>2019-06-08 11:44:43 +0300
committerGeorg Chini <georg@chini.tk>2019-06-22 10:13:58 +0000
commit6f8bf764a1c6f970c822165bb32cad83d333b8c1 (patch)
tree3b214c34e42e50f2db33f76ba62c063be65300ff
parent279b99e101c9d4d25e7ad7ce377623feb85352ea (diff)
downloadpulseaudio-6f8bf764a1c6f970c822165bb32cad83d333b8c1.tar.gz
main: Log more information when executing default.pa fails
"Failed to initialize daemon" is not as informative message as it could be. This change was inspired by the discussion in this bug: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/597
-rw-r--r--src/daemon/main.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/daemon/main.c b/src/daemon/main.c
index 553f12ae..e96c86d2 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -1088,25 +1088,31 @@ int main(int argc, char *argv[]) {
#ifdef HAVE_DBUS
pa_assert_se(dbus_threads_init_default());
- if (start_server) {
+ if (start_server)
#endif
+ {
+ const char *command_source = NULL;
+
if (conf->load_default_script_file) {
FILE *f;
if ((f = pa_daemon_conf_open_default_script_file(conf))) {
r = pa_cli_command_execute_file_stream(c, f, buf, &conf->fail);
fclose(f);
+ command_source = pa_daemon_conf_get_default_script_file(conf);
}
}
- if (r >= 0)
+ if (r >= 0) {
r = pa_cli_command_execute(c, conf->script_commands, buf, &conf->fail);
+ command_source = _("command line arguments");
+ }
pa_log_error("%s", s = pa_strbuf_to_string_free(buf));
pa_xfree(s);
if (r < 0 && conf->fail) {
- pa_log(_("Failed to initialize daemon."));
+ pa_log(_("Failed to initialize daemon due to errors while executing startup commands. Source of commands: %s"), command_source);
goto finish;
}
@@ -1121,8 +1127,8 @@ int main(int argc, char *argv[]) {
* think there's no way to contact the server, but receiving certain
* signals could still cause modules to load. */
conf->disallow_module_loading = true;
- }
#endif
+ }
/* We completed the initial module loading, so let's disable it
* from now on, if requested */