dbus-service.c revision 9a60da2834074d970ca063c210fe9d2f05c70532
fb0951b02ebf51a93acf12721d8857d31ce57ba3Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers This file is part of systemd.
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering Copyright 2010 Lennart Poettering
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering systemd is free software; you can redistribute it and/or modify it
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering under the terms of the GNU General Public License as published by
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering the Free Software Foundation; either version 2 of the License, or
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering (at your option) any later version.
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering systemd is distributed in the hope that it will be useful, but
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering General Public License for more details.
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering You should have received a copy of the GNU General Public License
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering " <interface name=\"org.freedesktop.systemd1.Service\">\n" \
a80db8bd5f7f15859e8891aab9fc3694ce4cd0bdJavier Jardón " <property name=\"Type\" type=\"s\" access=\"read\"/>\n" \
a80db8bd5f7f15859e8891aab9fc3694ce4cd0bdJavier Jardón " <property name=\"Restart\" type=\"s\" access=\"read\"/>\n" \
4db6d587c37c0357d20c79bf1a7c9afd4c7ced61Kay Sievers " <property name=\"PIDFile\" type=\"s\" access=\"read\"/>\n" \
907dd1953b7517534d646f5b2777780020c896e2Kay Sievers " <property name=\"NotifyAccess\" type=\"s\" access=\"read\"/>\n" \
eb7bbee6cd182d5c4eb1e1180631c35158f59379Kay Sievers " <property name=\"RestartUSec\" type=\"t\" access=\"read\"/>\n" \
6aad7f2cd75c88f990c7857bb173b3e8d0faee0fUmut Tezduyar Lindskog " <property name=\"TimeoutUSec\" type=\"t\" access=\"read\"/>\n" \
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering BUS_EXEC_COMMAND_INTERFACE("ExecStartPost") \
22be093ffb403a1c474037939ca9b88b1ee39f77Lennart Poettering BUS_EXEC_COMMAND_INTERFACE("ExecReload") \
4fecbe59dadaed314b792ed35ef5dc24c7047a18Jan Alexander Steffens (heftig) BUS_EXEC_COMMAND_INTERFACE("ExecStop") \
0e3b0a95cc57cf8c51b20b5b94af7e51c5e424f3Jan Alexander Steffens (heftig) BUS_EXEC_COMMAND_INTERFACE("ExecStopPost") \
0e3b0a95cc57cf8c51b20b5b94af7e51c5e424f3Jan Alexander Steffens (heftig) BUS_EXEC_CONTEXT_INTERFACE \
0e3b0a95cc57cf8c51b20b5b94af7e51c5e424f3Jan Alexander Steffens (heftig) " <property name=\"PermissionsStartOnly\" type=\"b\" access=\"read\"/>\n" \
0e3b0a95cc57cf8c51b20b5b94af7e51c5e424f3Jan Alexander Steffens (heftig) " <property name=\"RootDirectoryStartOnly\" type=\"b\" access=\"read\"/>\n" \
0e3b0a95cc57cf8c51b20b5b94af7e51c5e424f3Jan Alexander Steffens (heftig) " <property name=\"RemainAfterExit\" type=\"b\" access=\"read\"/>\n" \
0e3b0a95cc57cf8c51b20b5b94af7e51c5e424f3Jan Alexander Steffens (heftig) BUS_EXEC_STATUS_INTERFACE("ExecMain") \
0e3b0a95cc57cf8c51b20b5b94af7e51c5e424f3Jan Alexander Steffens (heftig) " <property name=\"MainPID\" type=\"u\" access=\"read\"/>\n" \
0e3b0a95cc57cf8c51b20b5b94af7e51c5e424f3Jan Alexander Steffens (heftig) " <property name=\"ControlPID\" type=\"u\" access=\"read\"/>\n" \
4fecbe59dadaed314b792ed35ef5dc24c7047a18Jan Alexander Steffens (heftig) " <property name=\"SysVStartPriority\" type=\"i\" access=\"read\"/>\n" \
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers " <property name=\"SysVRunLevels\" type=\"s\" access=\"read\"/>\n" \
8666abb452db73d9a11ead61251eec42bc531cceKay Sievers " <property name=\"SysVPath\" type=\"s\" access=\"read\"/>\n" \
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering " <property name=\"BusName\" type=\"s\" access=\"read\"/>\n" \
5e63ce78b5018ba612e794a610a6f13c5eefade7Cristian Rodríguez " <property name=\"StatusText\" type=\"s\" access=\"read\"/>\n" \
3d585edbb14b9705c80183aeb16dfd0a28df0ac9Lennart Poettering " </interface>\n"
0fa2cac4f0cdefaf1addd7f1fe0fd8113db9360bKay Sievers " <interface name=\"org.freedesktop.systemd1.Service\">\n" \
0fa2cac4f0cdefaf1addd7f1fe0fd8113db9360bKay Sievers " <property name=\"Type\" type=\"s\" access=\"read\"/>\n" \
4c6abc93c708762ae3f377eab8dbd357262cc432Koen Kooi " <property name=\"Restart\" type=\"s\" access=\"read\"/>\n" \
f15515b5e6a9ebe95c938cc670df6e576fcf9176Filipe Brandenburger " <property name=\"PIDFile\" type=\"s\" access=\"read\"/>\n" \
0fa2cac4f0cdefaf1addd7f1fe0fd8113db9360bKay Sievers " <property name=\"NotifyAccess\" type=\"s\" access=\"read\"/>\n" \
f15515b5e6a9ebe95c938cc670df6e576fcf9176Filipe Brandenburger " <property name=\"RestartUSec\" type=\"t\" access=\"read\"/>\n" \
f15515b5e6a9ebe95c938cc670df6e576fcf9176Filipe Brandenburger " <property name=\"TimeoutUSec\" type=\"t\" access=\"read\"/>\n" \
f15515b5e6a9ebe95c938cc670df6e576fcf9176Filipe Brandenburger BUS_EXEC_COMMAND_INTERFACE("ExecStartPre") \
f15515b5e6a9ebe95c938cc670df6e576fcf9176Filipe Brandenburger BUS_EXEC_COMMAND_INTERFACE("ExecStart") \
f15515b5e6a9ebe95c938cc670df6e576fcf9176Filipe Brandenburger BUS_EXEC_COMMAND_INTERFACE("ExecStartPost") \
f15515b5e6a9ebe95c938cc670df6e576fcf9176Filipe Brandenburger BUS_EXEC_COMMAND_INTERFACE("ExecReload") \
f15515b5e6a9ebe95c938cc670df6e576fcf9176Filipe Brandenburger BUS_EXEC_COMMAND_INTERFACE("ExecStop") \
f15515b5e6a9ebe95c938cc670df6e576fcf9176Filipe Brandenburger BUS_EXEC_COMMAND_INTERFACE("ExecStopPost") \
f15515b5e6a9ebe95c938cc670df6e576fcf9176Filipe Brandenburger " <property name=\"PermissionsStartOnly\" type=\"b\" access=\"read\"/>\n" \
2f96919bcdd0978164c801b21e053fb3b31e8bacFilipe Brandenburger " <property name=\"RootDirectoryStartOnly\" type=\"b\" access=\"read\"/>\n" \
a59f16ce4a11c440cb2136ad3d5e3184714c545eRobert Schiele " <property name=\"RemainAfterExit\" type=\"b\" access=\"read\"/>\n" \
2f96919bcdd0978164c801b21e053fb3b31e8bacFilipe Brandenburger BUS_EXEC_STATUS_INTERFACE("ExecMain") \
1c7dde3e475978c569a982d65fd86d4b4e3caad8Bastien Nocera " <property name=\"MainPID\" type=\"u\" access=\"read\"/>\n" \
2f96919bcdd0978164c801b21e053fb3b31e8bacFilipe Brandenburger " <property name=\"ControlPID\" type=\"u\" access=\"read\"/>\n" \
2f96919bcdd0978164c801b21e053fb3b31e8bacFilipe Brandenburger " <property name=\"BusName\" type=\"s\" access=\"read\"/>\n" \
2f96919bcdd0978164c801b21e053fb3b31e8bacFilipe Brandenburger " <property name=\"StatusText\" type=\"s\" access=\"read\"/>\n" \
2f96919bcdd0978164c801b21e053fb3b31e8bacFilipe Brandenburger " </interface>\n"
f975e971accc4d50c73ae53167db3df7a7099cf2Lennart Poetteringconst char bus_service_interface[] _introspect_("Service") = BUS_SERVICE_INTERFACE;
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sieversconst char bus_service_invalidating_properties[] =
fe1fed02c7637a2c18cd575f78be7fda27972148Zbigniew Jędrzejewski-Szmek "ExecStartPre\0"
92ec4495f76a7a2a6c31f5bb2a5240f78dcfe1d2Javier Jardón "ExecStart\0"
2d0efdf1af5ff77441228854343c61d42a89840cSamuli Suominen "ExecStartPost\0"
2d0efdf1af5ff77441228854343c61d42a89840cSamuli Suominen "ExecReload\0"
b51fc639f01ee6194af3e7e944a79accce474fe1Dave Reisner "ExecStop\0"
dd5ae4c36c89da5dbe8d1628939b26c00db98753Przemyslaw Kedzierski "ExecStopPost\0"
96ede2601f27cd5fe52eed96b873bef55cd0ce23Lennart Poettering "ControlPID\0"
2d0efdf1af5ff77441228854343c61d42a89840cSamuli Suominen "StatusText\0"
7801356442578ff6e1c65844eb9e65c819af4660Zbigniew Jędrzejewski-Szmekstatic DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_service_append_type, service_type, ServiceType);
66b0e0e0e3652227fe107ab9d09fa14fd4bc4dfaCristian Rodríguezstatic DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_service_append_restart, service_restart, ServiceRestart);
66b0e0e0e3652227fe107ab9d09fa14fd4bc4dfaCristian Rodríguezstatic DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_service_append_notify_access, notify_access, NotifyAccess);
f00929ad622c978f8ad83590a15a765b4beecac9Dimitri John LedkovDBusHandlerResult bus_service_message_handler(Unit *u, DBusConnection *connection, DBusMessage *message) {
446883528524429283626208928b51f49f28f810Lennart Poettering { "org.freedesktop.systemd1.Service", "Type", bus_service_append_type, "s", &u->service.type },
4acbce79798347cddf1e1d42e9be571e0a041873Zbigniew Jędrzejewski-Szmek { "org.freedesktop.systemd1.Service", "Restart", bus_service_append_restart, "s", &u->service.restart },
4acbce79798347cddf1e1d42e9be571e0a041873Zbigniew Jędrzejewski-Szmek { "org.freedesktop.systemd1.Service", "PIDFile", bus_property_append_string, "s", u->service.pid_file },
c4a77bcb9a50f152557e25c90837d8bfef858729Marc-Antoine Perennou { "org.freedesktop.systemd1.Service", "NotifyAccess", bus_service_append_notify_access, "s", &u->service.notify_access },
ac714a78fdca481488d88f84b6332d28083a4511Martin Jansa { "org.freedesktop.systemd1.Service", "RestartUSec", bus_property_append_usec, "t", &u->service.restart_usec },
ac714a78fdca481488d88f84b6332d28083a4511Martin Jansa { "org.freedesktop.systemd1.Service", "TimeoutUSec", bus_property_append_usec, "t", &u->service.timeout_usec },
b62cfcea00862ccbf0e5e297f8a339f70987edefMichael Biebl BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Service", u->service.exec_command[SERVICE_EXEC_START_PRE], "ExecStartPre"),
b62cfcea00862ccbf0e5e297f8a339f70987edefMichael Biebl BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Service", u->service.exec_command[SERVICE_EXEC_START], "ExecStart"),
b62cfcea00862ccbf0e5e297f8a339f70987edefMichael Biebl BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Service", u->service.exec_command[SERVICE_EXEC_START_POST], "ExecStartPost"),
9a60da2834074d970ca063c210fe9d2f05c70532Thierry Reding BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Service", u->service.exec_command[SERVICE_EXEC_RELOAD], "ExecReload"),
732bfe09aeffc3cd78b80ee9e20c9c3babd944d6Zbigniew Jędrzejewski-Szmek BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Service", u->service.exec_command[SERVICE_EXEC_STOP], "ExecStop"),
732bfe09aeffc3cd78b80ee9e20c9c3babd944d6Zbigniew Jędrzejewski-Szmek BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Service", u->service.exec_command[SERVICE_EXEC_STOP_POST], "ExecStopPost"),
732bfe09aeffc3cd78b80ee9e20c9c3babd944d6Zbigniew Jędrzejewski-Szmek BUS_EXEC_CONTEXT_PROPERTIES("org.freedesktop.systemd1.Service", u->service.exec_context),
732bfe09aeffc3cd78b80ee9e20c9c3babd944d6Zbigniew Jędrzejewski-Szmek { "org.freedesktop.systemd1.Service", "PermissionsStartOnly", bus_property_append_bool, "b", &u->service.permissions_start_only },
732bfe09aeffc3cd78b80ee9e20c9c3babd944d6Zbigniew Jędrzejewski-Szmek { "org.freedesktop.systemd1.Service", "RootDirectoryStartOnly", bus_property_append_bool, "b", &u->service.root_directory_start_only },
732bfe09aeffc3cd78b80ee9e20c9c3babd944d6Zbigniew Jędrzejewski-Szmek { "org.freedesktop.systemd1.Service", "RemainAfterExit", bus_property_append_bool, "b", &u->service.remain_after_exit },
732bfe09aeffc3cd78b80ee9e20c9c3babd944d6Zbigniew Jędrzejewski-Szmek BUS_EXEC_STATUS_PROPERTIES("org.freedesktop.systemd1.Service", u->service.main_exec_status, "ExecMain"),
732bfe09aeffc3cd78b80ee9e20c9c3babd944d6Zbigniew Jędrzejewski-Szmek { "org.freedesktop.systemd1.Service", "MainPID", bus_property_append_pid, "u", &u->service.main_pid },
732bfe09aeffc3cd78b80ee9e20c9c3babd944d6Zbigniew Jędrzejewski-Szmek { "org.freedesktop.systemd1.Service", "ControlPID", bus_property_append_pid, "u", &u->service.control_pid },
732bfe09aeffc3cd78b80ee9e20c9c3babd944d6Zbigniew Jędrzejewski-Szmek { "org.freedesktop.systemd1.Service", "SysVPath", bus_property_append_string, "s", u->service.sysv_path },
732bfe09aeffc3cd78b80ee9e20c9c3babd944d6Zbigniew Jędrzejewski-Szmek { "org.freedesktop.systemd1.Service", "BusName", bus_property_append_string, "s", u->service.bus_name },
732bfe09aeffc3cd78b80ee9e20c9c3babd944d6Zbigniew Jędrzejewski-Szmek { "org.freedesktop.systemd1.Service", "StatusText", bus_property_append_string, "s", u->service.status_text },
ae0ceefc2f432bc1068889fcff53d929eca8a3c4Zbigniew Jędrzejewski-Szmek { "org.freedesktop.systemd1.Service", "SysVRunLevels", bus_property_append_string, "s", u->service.sysv_runlevels },
ae0ceefc2f432bc1068889fcff53d929eca8a3c4Zbigniew Jędrzejewski-Szmek { "org.freedesktop.systemd1.Service", "SysVStartPriority", bus_property_append_int, "i", &u->service.sysv_start_priority },
ae0ceefc2f432bc1068889fcff53d929eca8a3c4Zbigniew Jędrzejewski-Szmek { "org.freedesktop.systemd1.Service", "FsckPassNo", bus_property_append_int, "i", &u->service.fsck_passno },
ae0ceefc2f432bc1068889fcff53d929eca8a3c4Zbigniew Jędrzejewski-Szmek { NULL, NULL, NULL, NULL, NULL }