machined.c revision d3e84ddb885e9d5f0ae9930eb905910e3a81f157
322345fdb9865ef2477fba8e4bdde0e1183ef505Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
322345fdb9865ef2477fba8e4bdde0e1183ef505Lennart Poettering This file is part of systemd.
322345fdb9865ef2477fba8e4bdde0e1183ef505Lennart Poettering Copyright 2013 Lennart Poettering
322345fdb9865ef2477fba8e4bdde0e1183ef505Lennart Poettering systemd is free software; you can redistribute it and/or modify it
322345fdb9865ef2477fba8e4bdde0e1183ef505Lennart Poettering under the terms of the GNU Lesser General Public License as published by
322345fdb9865ef2477fba8e4bdde0e1183ef505Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
322345fdb9865ef2477fba8e4bdde0e1183ef505Lennart Poettering (at your option) any later version.
322345fdb9865ef2477fba8e4bdde0e1183ef505Lennart Poettering systemd is distributed in the hope that it will be useful, but
322345fdb9865ef2477fba8e4bdde0e1183ef505Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
322345fdb9865ef2477fba8e4bdde0e1183ef505Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
322345fdb9865ef2477fba8e4bdde0e1183ef505Lennart Poettering Lesser General Public License for more details.
322345fdb9865ef2477fba8e4bdde0e1183ef505Lennart Poettering You should have received a copy of the GNU Lesser General Public License
322345fdb9865ef2477fba8e4bdde0e1183ef505Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
4d506d6bb757af3b99e0876234c465e6898c5ea4Lennart Poettering m->machines = hashmap_new(string_hash_func, string_compare_func);
4d506d6bb757af3b99e0876234c465e6898c5ea4Lennart Poettering m->machine_units = hashmap_new(string_hash_func, string_compare_func);
7778dffff3d8bd7438fe19a248c16203668324c9Daniel Mack m->machine_leaders = hashmap_new(trivial_hash_func, trivial_compare_func);
manager_free(m);
return NULL;
manager_free(m);
return NULL;
assert(m);
free(m);
assert(m);
if (!machine) {
if (!machine)
return -ENOMEM;
if (_machine)
assert(m);
if (!mm)
assert(m);
return -errno;
assert(m);
r = sd_bus_add_object_vtable(m->bus, "/org/freedesktop/machine1", "org.freedesktop.machine1.Manager", manager_vtable, m);
r = sd_bus_add_fallback_vtable(m->bus, "/org/freedesktop/machine1/machine", "org.freedesktop.machine1.Machine", machine_vtable, machine_object_find, m);
r = sd_bus_add_node_enumerator(m->bus, "/org/freedesktop/machine1/machine", machine_node_enumerator, m);
"sender='org.freedesktop.systemd1',"
"interface='org.freedesktop.systemd1.Manager',"
"path='/org/freedesktop/systemd1'",
"sender='org.freedesktop.systemd1',"
"interface='org.freedesktop.systemd1.Manager',"
"path='/org/freedesktop/systemd1'",
"sender='org.freedesktop.systemd1',"
"sender='org.freedesktop.systemd1',"
"interface='org.freedesktop.systemd1.Manager',"
"path='/org/freedesktop/systemd1'",
r = sd_bus_call_method(
m->bus,
"org.freedesktop.systemd1",
"/org/freedesktop/systemd1",
"org.freedesktop.systemd1.Manager",
&error,
if (r != SD_BUS_NAME_PRIMARY_OWNER) {
return -EEXIST;
assert(m);
Iterator i;
assert(m);
r = manager_connect_bus(m);
manager_gc(m, false);
assert(m);
if (r == SD_EVENT_FINISHED)
manager_gc(m, true);
log_open();
r = -EINVAL;
goto finish;
m = manager_new();
r = log_oom();
goto finish;
r = manager_startup(m);
goto finish;
sd_notify(false,
r = manager_run(m);
sd_notify(false,
manager_free(m);