mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-08 13:29:59 -05:00
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
This commit is contained in:
parent
279b99e101
commit
6f8bf764a1
1 changed files with 10 additions and 4 deletions
|
|
@ -1088,25 +1088,31 @@ int main(int argc, char *argv[]) {
|
||||||
#ifdef HAVE_DBUS
|
#ifdef HAVE_DBUS
|
||||||
pa_assert_se(dbus_threads_init_default());
|
pa_assert_se(dbus_threads_init_default());
|
||||||
|
|
||||||
if (start_server) {
|
if (start_server)
|
||||||
#endif
|
#endif
|
||||||
|
{
|
||||||
|
const char *command_source = NULL;
|
||||||
|
|
||||||
if (conf->load_default_script_file) {
|
if (conf->load_default_script_file) {
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
|
||||||
if ((f = pa_daemon_conf_open_default_script_file(conf))) {
|
if ((f = pa_daemon_conf_open_default_script_file(conf))) {
|
||||||
r = pa_cli_command_execute_file_stream(c, f, buf, &conf->fail);
|
r = pa_cli_command_execute_file_stream(c, f, buf, &conf->fail);
|
||||||
fclose(f);
|
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);
|
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_log_error("%s", s = pa_strbuf_to_string_free(buf));
|
||||||
pa_xfree(s);
|
pa_xfree(s);
|
||||||
|
|
||||||
if (r < 0 && conf->fail) {
|
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;
|
goto finish;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1121,8 +1127,8 @@ int main(int argc, char *argv[]) {
|
||||||
* think there's no way to contact the server, but receiving certain
|
* think there's no way to contact the server, but receiving certain
|
||||||
* signals could still cause modules to load. */
|
* signals could still cause modules to load. */
|
||||||
conf->disallow_module_loading = true;
|
conf->disallow_module_loading = true;
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/* We completed the initial module loading, so let's disable it
|
/* We completed the initial module loading, so let's disable it
|
||||||
* from now on, if requested */
|
* from now on, if requested */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue