64
64
#include "com.ubuntu.Upstart.h"
68
#endif /* ENABLE_CGROUPS */
66
70
/* Prototypes for static functions */
67
71
static int control_server_connect (DBusServer *server, DBusConnection *conn);
68
72
static void control_disconnected (DBusConnection *conn);
982
* control_notify_cgroup_manager_address:
984
* @message: D-Bus connection and message received,
985
* @address: D-Bus address that cgroup manager is connected to.
987
* Implements the NotifyCGroupManagerAddress method of the
988
* com.ubuntu.Upstart interface.
990
* Called to allow the cgroup manager to be contacted,
991
* thus enabling the cgroup stanza.
993
* Returns: zero on success, negative value on raised error.
996
control_notify_cgroup_manager_address (void *data,
997
NihDBusMessage *message,
1000
nih_assert (message);
1001
nih_assert (address);
1003
if (! control_check_permission (message)) {
1004
nih_dbus_error_raise_printf (
1005
DBUS_INTERFACE_UPSTART ".Error.PermissionDenied",
1006
_("You do not have permission to notify cgroup manager address"));
1010
#ifdef ENABLE_CGROUPS
1011
if (! cgroup_support_enabled ())
1014
/* Already called */
1015
if (cgroup_manager_available ())
1018
if (! cgroup_manager_set_address (address)) {
1019
nih_dbus_error_raise_printf (DBUS_ERROR_NO_MEMORY,
1020
_("Out of Memory"));
1024
nih_debug ("set cgroup manager address");
1026
if (! job_class_induct_jobs ()) {
1027
nih_dbus_error_raise_printf (DBUS_ERROR_NO_MEMORY,
1028
_("Out of Memory"));
1033
nih_debug ("cgroup support not available");
1034
#endif /* ENABLE_CGROUPS */
978
1040
* control_bus_flush:
980
1042
* Drain any remaining messages in the D-Bus queue.