2009-07-29 21:08:27 +03:00
|
|
|
/* -*- Mode: C ; c-basic-offset: 2 -*- */
|
2005-09-13 08:22:59 +03:00
|
|
|
/*
|
2009-07-29 21:08:27 +03:00
|
|
|
* LADI Session Handler (ladish)
|
2008-09-07 01:48:05 +03:00
|
|
|
*
|
2013-01-13 02:04:56 +02:00
|
|
|
* Copyright (C) 2008,2009,2010,2011,2012,2013 Nedko Arnaudov <nedko@arnaudov.name>
|
2009-07-29 21:08:27 +03:00
|
|
|
* Copyright (C) 2008 Juuso Alasuutari <juuso.alasuutari@gmail.com>
|
|
|
|
* Copyright (C) 2002 Robert Ham <rah@bash.sh>
|
2008-09-07 01:48:05 +03:00
|
|
|
*
|
2009-07-29 21:08:27 +03:00
|
|
|
**************************************************************************
|
|
|
|
* This file contains the code that implements main() and other top-level functionality
|
|
|
|
**************************************************************************
|
2005-09-13 08:22:59 +03:00
|
|
|
*
|
2009-07-29 21:08:27 +03:00
|
|
|
* LADI Session Handler is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
2005-09-13 08:22:59 +03:00
|
|
|
*
|
2009-07-29 21:08:27 +03:00
|
|
|
* LADI Session Handler is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with LADI Session Handler. If not, see <http://www.gnu.org/licenses/>
|
|
|
|
* or write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
2005-09-13 08:22:59 +03:00
|
|
|
*/
|
|
|
|
|
2009-07-20 23:49:46 +03:00
|
|
|
#include "common.h"
|
2008-09-28 19:11:16 +03:00
|
|
|
|
2005-09-13 08:22:59 +03:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <signal.h>
|
2008-09-07 01:48:05 +03:00
|
|
|
#include <sys/stat.h>
|
2005-09-13 08:22:59 +03:00
|
|
|
|
2009-07-20 23:49:46 +03:00
|
|
|
#include "version.h" /* git version define */
|
|
|
|
#include "proctitle.h"
|
|
|
|
#include "loader.h"
|
2021-12-24 13:54:04 +02:00
|
|
|
#if SIGINFO_ENABLED
|
2013-01-13 02:04:56 +02:00
|
|
|
#include "siginfo.h"
|
2021-12-24 13:54:04 +02:00
|
|
|
#endif
|
2009-08-20 22:06:58 +03:00
|
|
|
#include "control.h"
|
2009-07-26 23:26:29 +03:00
|
|
|
#include "studio.h"
|
2009-08-22 03:07:19 +03:00
|
|
|
#include "../dbus_constants.h"
|
2010-09-19 17:15:11 +03:00
|
|
|
#include "../common/catdup.h"
|
2010-09-19 17:04:14 +03:00
|
|
|
#include "../common/dirhelpers.h"
|
2009-12-13 18:10:57 +02:00
|
|
|
#include "../proxies/a2j_proxy.h"
|
2010-04-11 17:18:48 +03:00
|
|
|
#include "../proxies/jmcore_proxy.h"
|
2010-04-18 01:49:36 +03:00
|
|
|
#include "../proxies/notify_proxy.h"
|
2010-09-26 19:46:53 +03:00
|
|
|
#include "../proxies/conf_proxy.h"
|
|
|
|
#include "conf.h"
|
2010-10-09 16:53:03 +03:00
|
|
|
#include "recent_projects.h"
|
2011-08-04 02:59:01 +03:00
|
|
|
#include "lash_server.h"
|
2005-09-13 08:22:59 +03:00
|
|
|
|
2009-07-21 00:12:07 +03:00
|
|
|
bool g_quit;
|
2009-07-31 01:40:59 +03:00
|
|
|
const char * g_dbus_unique_name;
|
2011-09-10 03:35:48 +03:00
|
|
|
cdbus_object_path g_control_object;
|
2009-08-24 00:02:45 +03:00
|
|
|
char * g_base_dir;
|
2010-09-26 19:46:53 +03:00
|
|
|
static bool g_use_notify = false;
|
2005-09-13 08:22:59 +03:00
|
|
|
|
2009-07-20 23:49:46 +03:00
|
|
|
#if 0
|
|
|
|
static DBusHandlerResult lashd_client_disconnect_handler(DBusConnection * connection, DBusMessage * message, void * data)
|
|
|
|
{
|
|
|
|
/* If the message isn't a signal the object path handler may use it */
|
|
|
|
if (dbus_message_get_type(message) != DBUS_MESSAGE_TYPE_SIGNAL)
|
|
|
|
{
|
|
|
|
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *member, *name, *old_name;
|
|
|
|
struct lash_client *client;
|
2005-09-13 08:22:59 +03:00
|
|
|
|
2009-07-20 23:49:46 +03:00
|
|
|
if (!(member = dbus_message_get_member(message)))
|
|
|
|
{
|
2009-09-20 18:23:42 +03:00
|
|
|
log_error("Received JACK signal with NULL member");
|
2009-07-20 23:49:46 +03:00
|
|
|
return DBUS_HANDLER_RESULT_HANDLED;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (strcmp(member, "NameOwnerChanged") != 0)
|
|
|
|
{
|
|
|
|
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
|
|
|
}
|
|
|
|
|
|
|
|
dbus_error_init(&err);
|
|
|
|
|
|
|
|
if (!dbus_message_get_args(message, &err,
|
|
|
|
DBUS_TYPE_STRING, &name,
|
|
|
|
DBUS_TYPE_STRING, &old_name,
|
|
|
|
DBUS_TYPE_INVALID))
|
|
|
|
{
|
2009-09-20 18:23:42 +03:00
|
|
|
log_error("Cannot get message arguments: %s",
|
2009-07-20 23:49:46 +03:00
|
|
|
err.message);
|
|
|
|
dbus_error_free(&err);
|
|
|
|
return DBUS_HANDLER_RESULT_HANDLED;
|
|
|
|
}
|
|
|
|
|
|
|
|
client = server_find_client_by_dbus_name(old_name);
|
|
|
|
if (client)
|
|
|
|
{
|
|
|
|
client_disconnected(client);
|
|
|
|
return DBUS_HANDLER_RESULT_HANDLED;
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dbus_bus_add_match(
|
|
|
|
service->connection,
|
|
|
|
"type='signal'"
|
|
|
|
",sender='org.freedesktop.DBus'"
|
|
|
|
",path='/org/freedesktop/DBus'"
|
|
|
|
",interface='org.freedesktop.DBus'"
|
|
|
|
",member='NameOwnerChanged'"
|
|
|
|
",arg2=''",
|
|
|
|
&err);
|
|
|
|
if (dbus_error_is_set(&err))
|
|
|
|
{
|
2009-09-20 18:23:42 +03:00
|
|
|
log_error("Failed to add D-Bus match rule: %s", err.message);
|
2009-07-20 23:49:46 +03:00
|
|
|
dbus_error_free(&err);
|
|
|
|
goto fail;
|
|
|
|
}
|
2005-09-13 08:22:59 +03:00
|
|
|
|
2009-07-20 23:49:46 +03:00
|
|
|
if (!dbus_connection_add_filter(service->connection, lashd_client_disconnect_handler, NULL, NULL))
|
|
|
|
{
|
2009-09-20 18:23:42 +03:00
|
|
|
log_error("Failed to add D-Bus filter");
|
2009-07-20 23:49:46 +03:00
|
|
|
goto fail;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2009-07-31 01:40:59 +03:00
|
|
|
static bool connect_dbus(void)
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
2011-07-31 20:04:01 +03:00
|
|
|
dbus_error_init(&cdbus_g_dbus_error);
|
2009-12-13 18:19:56 +02:00
|
|
|
|
2011-07-31 20:04:01 +03:00
|
|
|
cdbus_g_dbus_connection = dbus_bus_get(DBUS_BUS_SESSION, &cdbus_g_dbus_error);
|
|
|
|
if (dbus_error_is_set(&cdbus_g_dbus_error))
|
2009-07-31 01:40:59 +03:00
|
|
|
{
|
2011-07-31 20:04:01 +03:00
|
|
|
log_error("Failed to get bus: %s", cdbus_g_dbus_error.message);
|
|
|
|
dbus_error_free(&cdbus_g_dbus_error);
|
2009-07-31 01:40:59 +03:00
|
|
|
goto fail;
|
|
|
|
}
|
|
|
|
|
2011-07-31 20:04:01 +03:00
|
|
|
g_dbus_unique_name = dbus_bus_get_unique_name(cdbus_g_dbus_connection);
|
2009-07-31 01:40:59 +03:00
|
|
|
if (g_dbus_unique_name == NULL)
|
|
|
|
{
|
2009-09-20 18:23:42 +03:00
|
|
|
log_error("Failed to read unique bus name");
|
2009-07-31 01:40:59 +03:00
|
|
|
goto unref_connection;
|
|
|
|
}
|
|
|
|
|
2009-09-20 18:23:42 +03:00
|
|
|
log_info("Connected to local session bus, unique name is \"%s\"", g_dbus_unique_name);
|
2009-08-23 01:21:23 +03:00
|
|
|
|
2011-07-31 20:04:01 +03:00
|
|
|
ret = dbus_bus_request_name(cdbus_g_dbus_connection, SERVICE_NAME, DBUS_NAME_FLAG_DO_NOT_QUEUE, &cdbus_g_dbus_error);
|
2009-07-31 01:40:59 +03:00
|
|
|
if (ret == -1)
|
|
|
|
{
|
2011-07-31 20:04:01 +03:00
|
|
|
log_error("Failed to acquire bus name: %s", cdbus_g_dbus_error.message);
|
|
|
|
dbus_error_free(&cdbus_g_dbus_error);
|
2009-07-31 01:40:59 +03:00
|
|
|
goto unref_connection;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ret == DBUS_REQUEST_NAME_REPLY_EXISTS)
|
|
|
|
{
|
2009-09-20 18:23:42 +03:00
|
|
|
log_error("Requested connection name already exists");
|
2009-07-31 01:40:59 +03:00
|
|
|
goto unref_connection;
|
|
|
|
}
|
|
|
|
|
2011-09-10 03:35:48 +03:00
|
|
|
g_control_object = cdbus_object_path_new(CONTROL_OBJECT_PATH, &g_lashd_interface_control, NULL, NULL);
|
2009-07-31 01:40:59 +03:00
|
|
|
if (g_control_object == NULL)
|
|
|
|
{
|
|
|
|
goto unref_connection;
|
|
|
|
}
|
|
|
|
|
2011-09-10 03:35:48 +03:00
|
|
|
if (!cdbus_object_path_register(cdbus_g_dbus_connection, g_control_object))
|
2009-07-31 01:40:59 +03:00
|
|
|
{
|
|
|
|
goto destroy_control_object;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
destroy_control_object:
|
2011-09-10 03:35:48 +03:00
|
|
|
cdbus_object_path_destroy(cdbus_g_dbus_connection, g_control_object);
|
2009-07-31 01:40:59 +03:00
|
|
|
unref_connection:
|
2011-07-31 20:04:01 +03:00
|
|
|
dbus_connection_unref(cdbus_g_dbus_connection);
|
2009-07-20 23:49:46 +03:00
|
|
|
|
|
|
|
fail:
|
2009-07-31 01:40:59 +03:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void disconnect_dbus(void)
|
|
|
|
{
|
2011-09-10 03:35:48 +03:00
|
|
|
cdbus_object_path_destroy(cdbus_g_dbus_connection, g_control_object);
|
2011-07-31 20:04:01 +03:00
|
|
|
dbus_connection_unref(cdbus_g_dbus_connection);
|
2011-09-10 03:35:48 +03:00
|
|
|
cdbus_call_last_error_cleanup();
|
2009-07-20 23:49:46 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void term_signal_handler(int signum)
|
2005-09-13 08:22:59 +03:00
|
|
|
{
|
2009-09-20 18:23:42 +03:00
|
|
|
log_info("Caught signal %d (%s), terminating", signum, strsignal(signum));
|
2009-07-20 23:49:46 +03:00
|
|
|
g_quit = true;
|
2005-09-13 08:22:59 +03:00
|
|
|
}
|
|
|
|
|
2009-07-20 23:49:46 +03:00
|
|
|
bool install_term_signal_handler(int signum, bool ignore_if_already_ignored)
|
2005-09-13 08:22:59 +03:00
|
|
|
{
|
2009-07-13 00:15:44 +03:00
|
|
|
sig_t sigh;
|
2009-07-20 23:49:46 +03:00
|
|
|
|
|
|
|
sigh = signal(signum, term_signal_handler);
|
|
|
|
if (sigh == SIG_ERR)
|
|
|
|
{
|
2009-09-20 18:23:42 +03:00
|
|
|
log_error("signal() failed to install handler function for signal %d.", signum);
|
2009-07-20 23:49:46 +03:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sigh == SIG_IGN && ignore_if_already_ignored)
|
|
|
|
{
|
|
|
|
signal(SIGTERM, SIG_IGN);
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2009-08-24 00:02:45 +03:00
|
|
|
bool init_paths(void)
|
|
|
|
{
|
|
|
|
const char * home_dir;
|
|
|
|
|
|
|
|
home_dir = getenv("HOME");
|
|
|
|
if (home_dir == NULL)
|
|
|
|
{
|
2009-09-20 18:23:42 +03:00
|
|
|
log_error("Environment variable HOME not set");
|
2009-08-24 00:02:45 +03:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_base_dir = catdup(home_dir, BASE_DIR);
|
|
|
|
if (g_base_dir == NULL)
|
|
|
|
{
|
2009-09-20 18:23:42 +03:00
|
|
|
log_error("catdup failed for '%s' and '%s'", home_dir, BASE_DIR);
|
2009-08-24 00:02:45 +03:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!ensure_dir_exist(g_base_dir, 0700))
|
|
|
|
{
|
|
|
|
free(g_base_dir);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void uninit_paths(void)
|
|
|
|
{
|
|
|
|
free(g_base_dir);
|
|
|
|
}
|
|
|
|
|
2012-12-02 23:50:05 +02:00
|
|
|
static void on_conf_notify_changed(void * UNUSED(context), const char * UNUSED(key), const char * value)
|
2010-09-26 19:46:53 +03:00
|
|
|
{
|
2010-09-28 00:18:44 +03:00
|
|
|
bool notify_enable;
|
|
|
|
|
|
|
|
if (value == NULL)
|
|
|
|
{
|
|
|
|
notify_enable = LADISH_CONF_KEY_DAEMON_NOTIFY_DEFAULT;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
notify_enable = conf_string2bool(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (notify_enable)
|
2010-09-26 19:46:53 +03:00
|
|
|
{
|
|
|
|
if (!g_use_notify)
|
|
|
|
{
|
|
|
|
g_use_notify = ladish_notify_init("LADI Session Handler");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
log_info("Sending notifications is disabled");
|
|
|
|
if (g_use_notify)
|
|
|
|
{
|
|
|
|
ladish_notify_uninit();
|
|
|
|
g_use_notify = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-07-20 23:49:46 +03:00
|
|
|
int main(int argc, char ** argv, char ** envp)
|
|
|
|
{
|
2009-07-13 00:15:44 +03:00
|
|
|
struct stat st;
|
|
|
|
char timestamp_str[26];
|
2009-07-20 23:49:46 +03:00
|
|
|
int ret;
|
2009-07-13 00:15:44 +03:00
|
|
|
|
|
|
|
st.st_mtime = 0;
|
|
|
|
stat(argv[0], &st);
|
|
|
|
ctime_r(&st.st_mtime, timestamp_str);
|
|
|
|
timestamp_str[24] = 0;
|
|
|
|
|
|
|
|
lash_init_setproctitle(argc, argv, envp);
|
|
|
|
|
|
|
|
dbus_threads_init_default();
|
2005-09-13 08:22:59 +03:00
|
|
|
|
2009-09-20 18:23:42 +03:00
|
|
|
log_info("------------------");
|
|
|
|
log_info("LADI session handler activated. Version %s (%s) built on %s", PACKAGE_VERSION, GIT_VERSION, timestamp_str);
|
2005-09-15 11:23:29 +03:00
|
|
|
|
2009-07-20 23:49:46 +03:00
|
|
|
ret = EXIT_FAILURE;
|
2008-09-07 01:48:05 +03:00
|
|
|
|
2009-08-24 00:02:45 +03:00
|
|
|
if (!init_paths())
|
|
|
|
{
|
|
|
|
goto exit;
|
|
|
|
}
|
|
|
|
|
2010-05-05 00:35:10 +03:00
|
|
|
loader_init(ladish_studio_on_child_exit);
|
2008-09-07 01:48:05 +03:00
|
|
|
|
2010-03-23 01:11:02 +02:00
|
|
|
if (!room_templates_init())
|
2010-01-27 18:24:47 +02:00
|
|
|
{
|
|
|
|
goto uninit_loader;
|
|
|
|
}
|
|
|
|
|
2009-07-31 01:40:59 +03:00
|
|
|
if (!connect_dbus())
|
2009-07-13 00:15:44 +03:00
|
|
|
{
|
2009-09-20 18:23:42 +03:00
|
|
|
log_error("Failed to connecto to D-Bus");
|
2010-03-23 01:11:02 +02:00
|
|
|
goto uninit_room_templates;
|
2009-07-13 00:15:44 +03:00
|
|
|
}
|
2005-09-15 11:23:29 +03:00
|
|
|
|
2009-07-13 00:15:44 +03:00
|
|
|
/* install the signal handlers */
|
2009-07-20 23:49:46 +03:00
|
|
|
install_term_signal_handler(SIGTERM, false);
|
|
|
|
install_term_signal_handler(SIGINT, true);
|
|
|
|
install_term_signal_handler(SIGHUP, true);
|
|
|
|
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
|
|
|
|
{
|
2009-09-20 18:23:42 +03:00
|
|
|
log_error("signal(SIGPIPE, SIG_IGN).");
|
2009-07-20 23:49:46 +03:00
|
|
|
}
|
2005-09-15 11:23:29 +03:00
|
|
|
|
2021-12-24 13:54:04 +02:00
|
|
|
#if SIGINFO_ENABLED
|
2009-07-13 00:15:44 +03:00
|
|
|
/* setup our SIGSEGV magic that prints nice stack in our logfile */
|
2013-01-13 02:04:56 +02:00
|
|
|
setup_siginfo();
|
2021-12-24 13:54:04 +02:00
|
|
|
#endif
|
2008-09-07 01:48:05 +03:00
|
|
|
|
2010-09-26 19:46:53 +03:00
|
|
|
if (!conf_proxy_init())
|
2010-04-11 17:18:48 +03:00
|
|
|
{
|
|
|
|
goto uninit_dbus;
|
|
|
|
}
|
|
|
|
|
2010-09-26 19:46:53 +03:00
|
|
|
if (!conf_register(LADISH_CONF_KEY_DAEMON_NOTIFY, on_conf_notify_changed, NULL))
|
|
|
|
{
|
|
|
|
goto uninit_conf;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!conf_register(LADISH_CONF_KEY_DAEMON_SHELL, NULL, NULL))
|
|
|
|
{
|
|
|
|
goto uninit_conf;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!conf_register(LADISH_CONF_KEY_DAEMON_TERMINAL, NULL, NULL))
|
|
|
|
{
|
|
|
|
goto uninit_conf;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!conf_register(LADISH_CONF_KEY_DAEMON_STUDIO_AUTOSTART, NULL, NULL))
|
|
|
|
{
|
|
|
|
goto uninit_conf;
|
|
|
|
}
|
|
|
|
|
2011-10-23 03:52:16 +03:00
|
|
|
if (!conf_register(LADISH_CONF_KEY_DAEMON_JS_SAVE_DELAY, NULL, NULL))
|
|
|
|
{
|
|
|
|
goto uninit_conf;
|
|
|
|
}
|
|
|
|
|
2010-10-09 16:53:03 +03:00
|
|
|
if (!ladish_recent_projects_init())
|
2010-04-18 01:49:36 +03:00
|
|
|
{
|
2010-09-26 19:46:53 +03:00
|
|
|
goto uninit_conf;
|
2010-04-18 01:49:36 +03:00
|
|
|
}
|
|
|
|
|
2010-10-09 16:53:03 +03:00
|
|
|
if (!a2j_proxy_init())
|
|
|
|
{
|
|
|
|
goto uninit_recent_projects;
|
|
|
|
}
|
|
|
|
|
2010-04-11 17:18:48 +03:00
|
|
|
if (!jmcore_proxy_init())
|
|
|
|
{
|
|
|
|
goto uninit_a2j;
|
|
|
|
}
|
2009-12-07 00:56:48 +02:00
|
|
|
|
2010-05-05 00:35:10 +03:00
|
|
|
if (!ladish_studio_init())
|
2009-07-23 01:37:53 +03:00
|
|
|
{
|
2010-04-11 17:18:48 +03:00
|
|
|
goto uninit_jmcore;
|
2009-07-23 01:37:53 +03:00
|
|
|
}
|
|
|
|
|
2011-08-04 02:59:01 +03:00
|
|
|
if (!lash_server_init())
|
|
|
|
{
|
|
|
|
goto uninit_studio;
|
|
|
|
}
|
|
|
|
|
2010-04-18 01:49:36 +03:00
|
|
|
ladish_notify_simple(LADISH_NOTIFY_URGENCY_LOW, "LADI Session Handler daemon activated", NULL);
|
|
|
|
|
2009-07-20 23:49:46 +03:00
|
|
|
while (!g_quit)
|
|
|
|
{
|
2011-07-31 20:04:01 +03:00
|
|
|
dbus_connection_read_write_dispatch(cdbus_g_dbus_connection, 50);
|
2009-07-20 23:49:46 +03:00
|
|
|
loader_run();
|
2010-05-05 00:35:10 +03:00
|
|
|
ladish_studio_run();
|
2010-12-23 04:20:52 +02:00
|
|
|
ladish_check_integrity();
|
2009-07-26 23:26:29 +03:00
|
|
|
}
|
|
|
|
|
2009-12-17 07:41:57 +02:00
|
|
|
emit_clean_exit();
|
2010-04-18 01:49:36 +03:00
|
|
|
ladish_notify_simple(LADISH_NOTIFY_URGENCY_LOW, "LADI Session Handler daemon deactivated", NULL);
|
2009-12-17 07:41:57 +02:00
|
|
|
|
2009-07-20 23:49:46 +03:00
|
|
|
ret = EXIT_SUCCESS;
|
2005-09-15 11:23:29 +03:00
|
|
|
|
2009-09-20 18:23:42 +03:00
|
|
|
log_debug("Finished, cleaning up");
|
2005-09-15 11:23:29 +03:00
|
|
|
|
2011-08-04 02:59:01 +03:00
|
|
|
lash_server_uninit();
|
|
|
|
|
|
|
|
uninit_studio:
|
2010-05-05 00:35:10 +03:00
|
|
|
ladish_studio_uninit();
|
2009-07-23 01:37:53 +03:00
|
|
|
|
2010-04-11 17:18:48 +03:00
|
|
|
uninit_jmcore:
|
|
|
|
jmcore_proxy_uninit();
|
|
|
|
|
|
|
|
uninit_a2j:
|
2009-12-07 00:56:48 +02:00
|
|
|
a2j_proxy_uninit();
|
|
|
|
|
2010-10-09 16:53:03 +03:00
|
|
|
uninit_recent_projects:
|
|
|
|
ladish_recent_projects_uninit();
|
|
|
|
|
2010-09-26 19:46:53 +03:00
|
|
|
uninit_conf:
|
|
|
|
if (g_use_notify)
|
|
|
|
{
|
|
|
|
ladish_notify_uninit();
|
|
|
|
}
|
|
|
|
|
|
|
|
conf_proxy_uninit();
|
2010-04-18 01:49:36 +03:00
|
|
|
|
2009-08-23 01:21:23 +03:00
|
|
|
uninit_dbus:
|
2009-07-31 01:40:59 +03:00
|
|
|
disconnect_dbus();
|
2005-09-15 11:23:29 +03:00
|
|
|
|
2010-03-23 01:11:02 +02:00
|
|
|
uninit_room_templates:
|
|
|
|
room_templates_uninit();
|
2010-01-27 18:24:47 +02:00
|
|
|
|
2008-09-07 01:48:05 +03:00
|
|
|
uninit_loader:
|
2009-07-13 00:15:44 +03:00
|
|
|
loader_uninit();
|
2005-09-15 11:23:29 +03:00
|
|
|
|
2009-08-24 00:02:45 +03:00
|
|
|
uninit_paths();
|
|
|
|
|
|
|
|
exit:
|
2009-09-20 18:23:42 +03:00
|
|
|
log_debug("Cleaned up, exiting");
|
2008-09-07 01:48:05 +03:00
|
|
|
|
2009-09-20 18:23:42 +03:00
|
|
|
log_info("LADI session handler deactivated");
|
|
|
|
log_info("------------------");
|
2008-09-07 01:48:05 +03:00
|
|
|
|
2011-09-10 02:04:28 +03:00
|
|
|
exit(ret);
|
2005-09-15 11:23:29 +03:00
|
|
|
}
|