dbus-manager.c revision 123b964a537c21e9ebaf849acefb23f0f13db785
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering This file is part of systemd.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering Copyright 2010 Lennart Poettering
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering systemd is free software; you can redistribute it and/or modify it
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering under the terms of the GNU Lesser General Public License as published by
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering (at your option) any later version.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering systemd is distributed in the hope that it will be useful, but
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering Lesser General Public License for more details.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering You should have received a copy of the GNU Lesser General Public License
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " <interface name=\"org.freedesktop.systemd1.Manager\">\n"
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering " <method name=\"GetUnit\">\n" \
309e9d86f0e7f9c5f0a2a09227bdfdb3174d4436Lennart Poettering " <arg name=\"name\" type=\"s\" direction=\"in\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"unit\" type=\"o\" direction=\"out\"/>\n" \
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering " </method>\n" \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " <method name=\"GetUnitByPID\">\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"pid\" type=\"u\" direction=\"in\"/>\n" \
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering " <arg name=\"unit\" type=\"o\" direction=\"out\"/>\n" \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " </method>\n" \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " <method name=\"LoadUnit\">\n" \
818f766b12e025683cf4fed12b3da2a025bb0b31Lennart Poettering " <arg name=\"name\" type=\"s\" direction=\"in\"/>\n" \
818f766b12e025683cf4fed12b3da2a025bb0b31Lennart Poettering " <arg name=\"unit\" type=\"o\" direction=\"out\"/>\n" \
818f766b12e025683cf4fed12b3da2a025bb0b31Lennart Poettering " </method>\n" \
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering " <method name=\"StartUnit\">\n" \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " <arg name=\"name\" type=\"s\" direction=\"in\"/>\n" \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \
ac720200b7e5b80cc4985087e38f3452e5b3b080Lennart Poettering " <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \
ac720200b7e5b80cc4985087e38f3452e5b3b080Lennart Poettering " </method>\n" \
ac720200b7e5b80cc4985087e38f3452e5b3b080Lennart Poettering " <method name=\"StartUnitReplace\">\n" \
818f766b12e025683cf4fed12b3da2a025bb0b31Lennart Poettering " <arg name=\"old_unit\" type=\"s\" direction=\"in\"/>\n" \
818f766b12e025683cf4fed12b3da2a025bb0b31Lennart Poettering " <arg name=\"new_unit\" type=\"s\" direction=\"in\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \
547973dea7abd6c124ff6c79fe2bbe322a7314aeLennart Poettering " <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \
a761c1ca851a9397b5a207ef600e077d0f7f4534Lennart Poettering " </method>\n" \
019036a47fcd10fcf0286800d144c706f3773e2fLennart Poettering " <method name=\"StopUnit\">\n" \
547973dea7abd6c124ff6c79fe2bbe322a7314aeLennart Poettering " <arg name=\"name\" type=\"s\" direction=\"in\"/>\n" \
b2b796b8ab5565fbe60b544d2579e2bfca31bf6aLennart Poettering " <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \
b2b796b8ab5565fbe60b544d2579e2bfca31bf6aLennart Poettering " <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \
b2b796b8ab5565fbe60b544d2579e2bfca31bf6aLennart Poettering " </method>\n" \
3bbdc31df37a23b5134a115c01d15e7ff870b3ccLennart Poettering " <method name=\"ReloadUnit\">\n" \
4afd3348c7506dd1d36305b7bcb9feb8952b9d6bLennart Poettering " <arg name=\"name\" type=\"s\" direction=\"in\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering " <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " </method>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <method name=\"RestartUnit\">\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"name\" type=\"s\" direction=\"in\"/>\n" \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering " </method>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <method name=\"TryRestartUnit\">\n" \
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering " <arg name=\"name\" type=\"s\" direction=\"in\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " </method>\n" \
63c372cb9df3bee01e3bf8cd7f96f336bddda846Lennart Poettering " <method name=\"ReloadOrRestartUnit\">\n" \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " <arg name=\"name\" type=\"s\" direction=\"in\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " </method>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <method name=\"ReloadOrTryRestartUnit\">\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"name\" type=\"s\" direction=\"in\"/>\n" \
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering " <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering " <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering " </method>\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " <method name=\"KillUnit\">\n" \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " <arg name=\"name\" type=\"s\" direction=\"in\"/>\n" \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " <arg name=\"who\" type=\"s\" direction=\"in\"/>\n" \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " <arg name=\"signal\" type=\"i\" direction=\"in\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " </method>\n" \
78c6a153c47f8d597c827bdcaf8c4e42ac87f738Lennart Poettering " <method name=\"ResetFailedUnit\">\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " <arg name=\"name\" type=\"s\" direction=\"in\"/>\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " </method>\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " <method name=\"GetUnitControlGroupAttributes\">\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " <arg name=\"name\" type=\"s\" direction=\"in\"/>\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " <arg name=\"attributes\" type=\"as\" direction=\"in\"/>\n" \
78c6a153c47f8d597c827bdcaf8c4e42ac87f738Lennart Poettering " <arg name=\"values\" type=\"as\" direction=\"out\"/>\n" \
78c6a153c47f8d597c827bdcaf8c4e42ac87f738Lennart Poettering " </method>\n" \
78c6a153c47f8d597c827bdcaf8c4e42ac87f738Lennart Poettering " <method name=\"SetUnitControlGroupAttributes\">\n" \
78c6a153c47f8d597c827bdcaf8c4e42ac87f738Lennart Poettering " <arg name=\"name\" type=\"s\" direction=\"in\"/>\n" \
78c6a153c47f8d597c827bdcaf8c4e42ac87f738Lennart Poettering " <arg name=\"attributes\" type=\"a(sss)\" direction=\"in\"/>\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " <arg name=\"mode\" type=\"s\" direction=\"in\"\n/>" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " </method>\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " <method name=\"UnsetUnitControlGroupAttributes\">\n" \
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering " <arg name=\"name\" type=\"s\" direction=\"in\"/>\n" \
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poettering " <arg name=\"attributes\" type=\"a(ss)\" direction=\"in\"/>\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " </method>\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " <method name=\"SetUnitControlGroups\">\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " <arg name=\"name\" type=\"s\" direction=\"in\"/>\n" \
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering " <arg name=\"groups\" type=\"as\" direction=\"in\"/>\n" \
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering " <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poettering " </method>\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " <method name=\"UnsetUnitControlGroups\">\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " <arg name=\"name\" type=\"s\" direction=\"in\"/>\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " <arg name=\"groups\" type=\"as\" direction=\"in\"/>\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " <arg name=\"mode\" type=\"s\" direction=\"in\"\n/>" \
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering " </method>\n" \
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering " <method name=\"GetJob\">\n" \
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering " <arg name=\"id\" type=\"u\" direction=\"in\"/>\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " </method>\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " <method name=\"CancelJob\">\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " <arg name=\"id\" type=\"u\" direction=\"in\"/>\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " </method>\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " <method name=\"ClearJobs\"/>\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " <method name=\"ResetFailed\"/>\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " <method name=\"ListUnits\">\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " <arg name=\"units\" type=\"a(ssssssouso)\" direction=\"out\"/>\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " </method>\n" \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " <method name=\"ListJobs\">\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <arg name=\"jobs\" type=\"a(usssoo)\" direction=\"out\"/>\n" \
4afd3348c7506dd1d36305b7bcb9feb8952b9d6bLennart Poettering " </method>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <method name=\"Subscribe\"/>\n" \
51323288fc628a5cac50914df915545d685b793eLennart Poettering " <method name=\"Unsubscribe\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <method name=\"Dump\">\n" \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " <arg name=\"dump\" type=\"s\" direction=\"out\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " </method>\n" \
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering " <method name=\"CreateSnapshot\">\n" \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " <arg name=\"name\" type=\"s\" direction=\"in\"/>\n" \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " <arg name=\"cleanup\" type=\"b\" direction=\"in\"/>\n" \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " <arg name=\"unit\" type=\"o\" direction=\"out\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " </method>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <method name=\"RemoveSnapshot\">\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <arg name=\"name\" type=\"s\" direction=\"in\"/>\n" \
703e4f5e39c019da8c002ba10bd450ce378c0e91Lennart Poettering " </method>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <method name=\"Reload\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <method name=\"Reexecute\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <method name=\"Exit\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <method name=\"Reboot\"/>\n" \
7588460aaf6bd33f6c9bd5645916cfd8a862e9c4Tom Gundersen " <method name=\"PowerOff\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <method name=\"Halt\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <method name=\"KExec\"/>\n" \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " <method name=\"SwitchRoot\">\n" \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " <arg name=\"new_root\" type=\"s\" direction=\"in\"/>\n" \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " <arg name=\"init\" type=\"s\" direction=\"in\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " </method>\n" \
78c6a153c47f8d597c827bdcaf8c4e42ac87f738Lennart Poettering " <method name=\"SetEnvironment\">\n" \
51323288fc628a5cac50914df915545d685b793eLennart Poettering " <arg name=\"names\" type=\"as\" direction=\"in\"/>\n" \
51323288fc628a5cac50914df915545d685b793eLennart Poettering " </method>\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " <method name=\"UnsetEnvironment\">\n" \
3339cb71d44c5198f9546f113674f06dc7b01a6fLennart Poettering " <arg name=\"names\" type=\"as\" direction=\"in\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " </method>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <method name=\"UnsetAndSetEnvironment\">\n" \
3339cb71d44c5198f9546f113674f06dc7b01a6fLennart Poettering " <arg name=\"unset\" type=\"as\" direction=\"in\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <arg name=\"set\" type=\"as\" direction=\"in\"/>\n" \
801ad6a6a9cd8fbd58b9f9c27f20dbb3c87d47ddLennart Poettering " </method>\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " <method name=\"ListUnitFiles\">\n" \
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering " <arg name=\"files\" type=\"a(ss)\" direction=\"out\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " </method>\n" \
3339cb71d44c5198f9546f113674f06dc7b01a6fLennart Poettering " <method name=\"GetUnitFileState\">\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"file\" type=\"s\" direction=\"in\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <arg name=\"state\" type=\"s\" direction=\"out\"/>\n" \
3339cb71d44c5198f9546f113674f06dc7b01a6fLennart Poettering " </method>\n" \
3339cb71d44c5198f9546f113674f06dc7b01a6fLennart Poettering " <method name=\"EnableUnitFiles\">\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"files\" type=\"as\" direction=\"in\"/>\n" \
3339cb71d44c5198f9546f113674f06dc7b01a6fLennart Poettering " <arg name=\"runtime\" type=\"b\" direction=\"in\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <arg name=\"force\" type=\"b\" direction=\"in\"/>\n" \
309e9d86f0e7f9c5f0a2a09227bdfdb3174d4436Lennart Poettering " <arg name=\"carries_install_info\" type=\"b\" direction=\"out\"/>\n" \
3339cb71d44c5198f9546f113674f06dc7b01a6fLennart Poettering " <arg name=\"changes\" type=\"a(sss)\" direction=\"out\"/>\n" \
3339cb71d44c5198f9546f113674f06dc7b01a6fLennart Poettering " </method>\n" \
8ba9fd9cee0eef572f7b3ed7a8c3ed31160e93d3Lennart Poettering " <method name=\"DisableUnitFiles\">\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"files\" type=\"as\" direction=\"in\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <arg name=\"runtime\" type=\"b\" direction=\"in\"/>\n" \
703e4f5e39c019da8c002ba10bd450ce378c0e91Lennart Poettering " <arg name=\"changes\" type=\"a(sss)\" direction=\"out\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " </method>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <method name=\"ReenableUnitFiles\">\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"files\" type=\"as\" direction=\"in\"/>\n" \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " <arg name=\"runtime\" type=\"b\" direction=\"in\"/>\n" \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " <arg name=\"force\" type=\"b\" direction=\"in\"/>\n" \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " <arg name=\"carries_install_info\" type=\"b\" direction=\"out\"/>\n" \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " <arg name=\"changes\" type=\"a(sss)\" direction=\"out\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " </method>\n" \
309e9d86f0e7f9c5f0a2a09227bdfdb3174d4436Lennart Poettering " <method name=\"LinkUnitFiles\">\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <arg name=\"files\" type=\"as\" direction=\"in\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <arg name=\"runtime\" type=\"b\" direction=\"in\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <arg name=\"force\" type=\"b\" direction=\"in\"/>\n" \
931851e8e492a4d2715e22dcde50a5e7ccef4b49Lennart Poettering " <arg name=\"changes\" type=\"a(sss)\" direction=\"out\"/>\n" \
309e9d86f0e7f9c5f0a2a09227bdfdb3174d4436Lennart Poettering " </method>\n" \
309e9d86f0e7f9c5f0a2a09227bdfdb3174d4436Lennart Poettering " <method name=\"PresetUnitFiles\">\n" \
309e9d86f0e7f9c5f0a2a09227bdfdb3174d4436Lennart Poettering " <arg name=\"files\" type=\"as\" direction=\"in\"/>\n" \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " <arg name=\"runtime\" type=\"b\" direction=\"in\"/>\n" \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering " <arg name=\"force\" type=\"b\" direction=\"in\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"carries_install_info\" type=\"b\" direction=\"out\"/>\n" \
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering " <arg name=\"changes\" type=\"a(sss)\" direction=\"out\"/>\n" \
da927ba997d68401563b927f92e6e40e021a8e5cMichal Schmidt " </method>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <method name=\"MaskUnitFiles\">\n" \
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering " <arg name=\"files\" type=\"as\" direction=\"in\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"runtime\" type=\"b\" direction=\"in\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"force\" type=\"b\" direction=\"in\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"changes\" type=\"a(sss)\" direction=\"out\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " </method>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <method name=\"UnmaskUnitFiles\">\n" \
51323288fc628a5cac50914df915545d685b793eLennart Poettering " <arg name=\"files\" type=\"as\" direction=\"in\"/>\n" \
51323288fc628a5cac50914df915545d685b793eLennart Poettering " <arg name=\"runtime\" type=\"b\" direction=\"in\"/>\n" \
51323288fc628a5cac50914df915545d685b793eLennart Poettering " <arg name=\"changes\" type=\"a(sss)\" direction=\"out\"/>\n" \
51323288fc628a5cac50914df915545d685b793eLennart Poettering " </method>\n"
51323288fc628a5cac50914df915545d685b793eLennart Poettering " <signal name=\"UnitNew\">\n" \
51323288fc628a5cac50914df915545d685b793eLennart Poettering " <arg name=\"id\" type=\"s\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <arg name=\"unit\" type=\"o\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " </signal>\n" \
51323288fc628a5cac50914df915545d685b793eLennart Poettering " <signal name=\"UnitRemoved\">\n" \
51323288fc628a5cac50914df915545d685b793eLennart Poettering " <arg name=\"id\" type=\"s\"/>\n" \
51323288fc628a5cac50914df915545d685b793eLennart Poettering " <arg name=\"unit\" type=\"o\"/>\n" \
51323288fc628a5cac50914df915545d685b793eLennart Poettering " </signal>\n" \
190700621f95160d364f8ec1d3e360246c41ce75Lennart Poettering " <signal name=\"JobNew\">\n" \
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering " <arg name=\"id\" type=\"u\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"job\" type=\"o\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"unit\" type=\"s\"/>\n" \
51323288fc628a5cac50914df915545d685b793eLennart Poettering " </signal>\n" \
51323288fc628a5cac50914df915545d685b793eLennart Poettering " <signal name=\"JobRemoved\">\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"id\" type=\"u\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"job\" type=\"o\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"unit\" type=\"s\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"result\" type=\"s\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " </signal>" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <signal name=\"StartupFinished\">\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <arg name=\"firmware\" type=\"t\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <arg name=\"loader\" type=\"t\"/>\n" \
51323288fc628a5cac50914df915545d685b793eLennart Poettering " <arg name=\"kernel\" type=\"t\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"initrd\" type=\"t\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"userspace\" type=\"t\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <arg name=\"total\" type=\"t\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " </signal>" \
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poettering " <signal name=\"UnitFilesChanged\"/>\n"
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering#define BUS_MANAGER_INTERFACE_PROPERTIES_GENERAL \
7b9f7afcc04e80b77a2567b0750aa2cd03c1a1cdLennart Poettering " <property name=\"Version\" type=\"s\" access=\"read\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <property name=\"Features\" type=\"s\" access=\"read\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <property name=\"Tainted\" type=\"s\" access=\"read\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <property name=\"FirmwareTimestamp\" type=\"t\" access=\"read\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <property name=\"FirmwareTimestampMonotonic\" type=\"t\" access=\"read\"/>\n" \
801ad6a6a9cd8fbd58b9f9c27f20dbb3c87d47ddLennart Poettering " <property name=\"LoaderTimestamp\" type=\"t\" access=\"read\"/>\n" \
51323288fc628a5cac50914df915545d685b793eLennart Poettering " <property name=\"LoaderTimestampMonotonic\" type=\"t\" access=\"read\"/>\n" \
51323288fc628a5cac50914df915545d685b793eLennart Poettering " <property name=\"KernelTimestamp\" type=\"t\" access=\"read\"/>\n" \
51323288fc628a5cac50914df915545d685b793eLennart Poettering " <property name=\"KernelTimestampMonotonic\" type=\"t\" access=\"read\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <property name=\"InitRDTimestamp\" type=\"t\" access=\"read\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <property name=\"InitRDTimestampMonotonic\" type=\"t\" access=\"read\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <property name=\"UserspaceTimestamp\" type=\"t\" access=\"read\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <property name=\"UserspaceTimestampMonotonic\" type=\"t\" access=\"read\"/>\n" \
51323288fc628a5cac50914df915545d685b793eLennart Poettering " <property name=\"FinishTimestamp\" type=\"t\" access=\"read\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <property name=\"FinishTimestampMonotonic\" type=\"t\" access=\"read\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <property name=\"LogLevel\" type=\"s\" access=\"readwrite\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <property name=\"LogTarget\" type=\"s\" access=\"readwrite\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <property name=\"NNames\" type=\"u\" access=\"read\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <property name=\"NJobs\" type=\"u\" access=\"read\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <property name=\"NInstalledJobs\" type=\"u\" access=\"read\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <property name=\"NFailedJobs\" type=\"u\" access=\"read\"/>\n" \
966c66e34940001a40806142ecebaae61b478444Lennart Poettering " <property name=\"Progress\" type=\"d\" access=\"read\"/>\n" \
82bd6dddc4a363a9c3c6f41eb46eb171a80dca27Lennart Poettering " <property name=\"Environment\" type=\"as\" access=\"read\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <property name=\"ConfirmSpawn\" type=\"b\" access=\"read\"/>\n" \
82bd6dddc4a363a9c3c6f41eb46eb171a80dca27Lennart Poettering " <property name=\"ShowStatus\" type=\"b\" access=\"read\"/>\n" \
322345fdb9865ef2477fba8e4bdde0e1183ef505Lennart Poettering " <property name=\"UnitPath\" type=\"as\" access=\"read\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <property name=\"ControlGroupHierarchy\" type=\"s\" access=\"read\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <property name=\"DefaultControllers\" type=\"as\" access=\"read\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <property name=\"DefaultStandardOutput\" type=\"s\" access=\"read\"/>\n" \
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " <property name=\"DefaultStandardError\" type=\"s\" access=\"read\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <property name=\"RuntimeWatchdogUSec\" type=\"s\" access=\"readwrite\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <property name=\"ShutdownWatchdogUSec\" type=\"s\" access=\"readwrite\"/>\n" \
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering " <property name=\"Virtualization\" type=\"s\" access=\"read\"/>\n"
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering " </interface>\n"
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering BUS_MANAGER_INTERFACE_PROPERTIES_GENERAL \
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE \
95d46fcaa4f27bc5e675e8de39ab3acc4732e39bTom Gundersen "org.freedesktop.systemd1.Manager\0"
ad867662936a4c7ab2c7116d804c272338801231Lennart Poetteringconst char bus_manager_interface[] _introspect_("Manager") = BUS_MANAGER_INTERFACE;
ad867662936a4c7ab2c7116d804c272338801231Lennart Poetteringstatic DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_manager_append_exec_output, exec_output, ExecOutput);
78c6a153c47f8d597c827bdcaf8c4e42ac87f738Lennart Poetteringstatic int bus_manager_append_tainted(DBusMessageIter *i, const char *property, void *data) {
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering const char *t;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering char buf[LINE_MAX] = "", *e = buf, *p = NULL;
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering if (readlink_malloc("/etc/mtab", &p) < 0)
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering /* remove the last ':' */
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering if (!dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &t))
51323288fc628a5cac50914df915545d685b793eLennart Poetteringstatic int bus_manager_append_log_target(DBusMessageIter *i, const char *property, void *data) {
ad867662936a4c7ab2c7116d804c272338801231Lennart Poettering const char *t;
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering t = log_target_to_string(log_get_target());
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering if (!dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &t))
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poetteringstatic int bus_manager_set_log_target(DBusMessageIter *i, const char *property, void *data) {
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering const char *t;
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poetteringstatic int bus_manager_append_log_level(DBusMessageIter *i, const char *property, void *data) {
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poettering r = log_level_to_string_alloc(log_get_max_level(), &t);
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering if (!dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &t))
51323288fc628a5cac50914df915545d685b793eLennart Poetteringstatic int bus_manager_set_log_level(DBusMessageIter *i, const char *property, void *data) {
51323288fc628a5cac50914df915545d685b793eLennart Poettering const char *t;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poetteringstatic int bus_manager_append_n_names(DBusMessageIter *i, const char *property, void *data) {
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering if (!dbus_message_iter_append_basic(i, DBUS_TYPE_UINT32, &u))
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poetteringstatic int bus_manager_append_n_jobs(DBusMessageIter *i, const char *property, void *data) {
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering if (!dbus_message_iter_append_basic(i, DBUS_TYPE_UINT32, &u))
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poetteringstatic int bus_manager_append_progress(DBusMessageIter *i, const char *property, void *data) {
4e2d538f33df8a425487aaa4facc23065a9bdaf7Lennart Poettering if (dual_timestamp_is_set(&m->finish_timestamp))
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering d = 1.0 - ((double) hashmap_size(m->jobs) / (double) m->n_installed_jobs);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering if (!dbus_message_iter_append_basic(i, DBUS_TYPE_DOUBLE, &d))
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poetteringstatic int bus_manager_append_virt(DBusMessageIter *i, const char *property, void *data) {
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering if (!dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &id))
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poetteringstatic DBusMessage *message_from_file_changes(
78c6a153c47f8d597c827bdcaf8c4e42ac87f738Lennart Poettering reply = dbus_message_new_method_return(m);
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering dbus_message_iter_init_append(reply, &iter);
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_BOOLEAN, &b))
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering if (!dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "(sss)", &sub))
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering for (i = 0; i < n_changes; i++) {
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering type = unit_file_change_type_to_string(changes[i].type);
703e4f5e39c019da8c002ba10bd450ce378c0e91Lennart Poettering if (!dbus_message_iter_open_container(&sub, DBUS_TYPE_STRUCT, NULL, &sub2) ||
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &type) ||
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &path) ||
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &source) ||
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering !dbus_message_iter_close_container(&sub, &sub2))
931851e8e492a4d2715e22dcde50a5e7ccef4b49Lennart Poettering if (!dbus_message_iter_close_container(&iter, &sub))
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poetteringstatic int bus_manager_send_unit_files_changed(Manager *m) {
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering s = dbus_message_new_signal("/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager", "UnitFilesChanged");
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poetteringstatic int bus_manager_set_runtime_watchdog_usec(DBusMessageIter *i, const char *property, void *data) {
7b9f7afcc04e80b77a2567b0750aa2cd03c1a1cdLennart Poetteringstatic const char systemd_property_string[] =
7b9f7afcc04e80b77a2567b0750aa2cd03c1a1cdLennart Poetteringstatic const BusProperty bus_systemd_properties[] = {
c463eb783e5ad999d400180c69b912c54fa07ee1Lennart Poettering { "Version", bus_property_append_string, "s", 0 },
c463eb783e5ad999d400180c69b912c54fa07ee1Lennart Poettering { "Features", bus_property_append_string, "s", sizeof(PACKAGE_STRING) },
51323288fc628a5cac50914df915545d685b793eLennart Poetteringstatic const BusProperty bus_manager_properties[] = {
51323288fc628a5cac50914df915545d685b793eLennart Poettering { "Tainted", bus_manager_append_tainted, "s", 0 },
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering { "FirmwareTimestamp", bus_property_append_uint64, "t", offsetof(Manager, firmware_timestamp.realtime) },
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering { "FirmwareTimestampMonotonic", bus_property_append_uint64, "t", offsetof(Manager, firmware_timestamp.monotonic) },
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering { "LoaderTimestamp", bus_property_append_uint64, "t", offsetof(Manager, loader_timestamp.realtime) },
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering { "LoaderTimestampMonotonic", bus_property_append_uint64, "t", offsetof(Manager, loader_timestamp.monotonic) },
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering { "KernelTimestamp", bus_property_append_uint64, "t", offsetof(Manager, kernel_timestamp.realtime) },
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering { "KernelTimestampMonotonic", bus_property_append_uint64, "t", offsetof(Manager, kernel_timestamp.monotonic) },
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering { "InitRDTimestamp", bus_property_append_uint64, "t", offsetof(Manager, initrd_timestamp.realtime) },
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering { "InitRDTimestampMonotonic", bus_property_append_uint64, "t", offsetof(Manager, initrd_timestamp.monotonic) },
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering { "UserspaceTimestamp", bus_property_append_uint64, "t", offsetof(Manager, userspace_timestamp.realtime) },
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering { "UserspaceTimestampMonotonic", bus_property_append_uint64, "t", offsetof(Manager, userspace_timestamp.monotonic) },
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering { "FinishTimestamp", bus_property_append_uint64, "t", offsetof(Manager, finish_timestamp.realtime) },
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering { "FinishTimestampMonotonic", bus_property_append_uint64, "t", offsetof(Manager, finish_timestamp.monotonic) },
801ad6a6a9cd8fbd58b9f9c27f20dbb3c87d47ddLennart Poettering { "LogLevel", bus_manager_append_log_level, "s", 0, false, bus_manager_set_log_level },
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering { "LogTarget", bus_manager_append_log_target, "s", 0, false, bus_manager_set_log_target },
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering { "NNames", bus_manager_append_n_names, "u", 0 },
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering { "NJobs", bus_manager_append_n_jobs, "u", 0 },
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering { "NInstalledJobs", bus_property_append_uint32, "u", offsetof(Manager, n_installed_jobs) },
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering { "NFailedJobs", bus_property_append_uint32, "u", offsetof(Manager, n_failed_jobs) },
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering { "Progress", bus_manager_append_progress, "d", 0 },
966c66e34940001a40806142ecebaae61b478444Lennart Poettering { "Environment", bus_property_append_strv, "as", offsetof(Manager, environment), true },
82bd6dddc4a363a9c3c6f41eb46eb171a80dca27Lennart Poettering { "ConfirmSpawn", bus_property_append_bool, "b", offsetof(Manager, confirm_spawn) },
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering { "ShowStatus", bus_property_append_bool, "b", offsetof(Manager, show_status) },
82bd6dddc4a363a9c3c6f41eb46eb171a80dca27Lennart Poettering { "UnitPath", bus_property_append_strv, "as", offsetof(Manager, lookup_paths.unit_path), true },
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poettering { "ControlGroupHierarchy", bus_property_append_string, "s", offsetof(Manager, cgroup_hierarchy), true },
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering { "DefaultControllers", bus_property_append_strv, "as", offsetof(Manager, default_controllers), true },
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering { "DefaultStandardOutput", bus_manager_append_exec_output, "s", offsetof(Manager, default_std_output) },
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering { "DefaultStandardError", bus_manager_append_exec_output, "s", offsetof(Manager, default_std_error) },
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering { "RuntimeWatchdogUSec", bus_property_append_usec, "t", offsetof(Manager, runtime_watchdog), false, bus_manager_set_runtime_watchdog_usec },
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering { "ShutdownWatchdogUSec", bus_property_append_usec, "t", offsetof(Manager, shutdown_watchdog), false, bus_property_set_usec },
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering { "Virtualization", bus_manager_append_virt, "s", 0, },
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poetteringstatic DBusHandlerResult bus_manager_message_handler(DBusConnection *connection, DBusMessage *message, void *data) {
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering _cleanup_dbus_message_unref_ DBusMessage *reply = NULL;
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering member = dbus_message_get_member(message);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "GetUnit")) {
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, &error, -EINVAL);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering dbus_set_error(&error, BUS_ERROR_NO_SUCH_UNIT, "Unit %s is not loaded.", name);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, &error, -ENOENT);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering SELINUX_UNIT_ACCESS_CHECK(u, connection, message, "status");
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering reply = dbus_message_new_method_return(message);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "GetUnitByPID")) {
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, &error, -EINVAL);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering dbus_set_error(&error, BUS_ERROR_NO_SUCH_UNIT, "No unit for PID %lu is loaded.", (unsigned long) pid);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, &error, -ENOENT);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering SELINUX_UNIT_ACCESS_CHECK(u, connection, message, "status");
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering reply = dbus_message_new_method_return(message);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "LoadUnit")) {
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, &error, -EINVAL);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering r = manager_load_unit(m, name, NULL, &error, &u);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, &error, r);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering SELINUX_UNIT_ACCESS_CHECK(u, connection, message, "status");
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering reply = dbus_message_new_method_return(message);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "StartUnit"))
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "StartUnitReplace"))
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "StopUnit"))
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "ReloadUnit"))
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "RestartUnit"))
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "TryRestartUnit"))
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "ReloadOrRestartUnit")) {
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "ReloadOrTryRestartUnit")) {
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "KillUnit")) {
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, &error, -EINVAL);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, &error, -EINVAL);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, &error, -EINVAL);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering dbus_set_error(&error, BUS_ERROR_NO_SUCH_UNIT, "Unit %s is not loaded.", name);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, &error, -ENOENT);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering SELINUX_UNIT_ACCESS_CHECK(u, connection, message, "stop");
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, &error, r);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering reply = dbus_message_new_method_return(message);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "GetJob")) {
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, &error, -EINVAL);
703e4f5e39c019da8c002ba10bd450ce378c0e91Lennart Poettering dbus_set_error(&error, BUS_ERROR_NO_SUCH_JOB, "Job %u does not exist.", (unsigned) id);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, &error, -ENOENT);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering SELINUX_UNIT_ACCESS_CHECK(j->unit, connection, message, "status");
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering reply = dbus_message_new_method_return(message);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "CancelJob")) {
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, &error, -EINVAL);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering dbus_set_error(&error, BUS_ERROR_NO_SUCH_JOB, "Job %u does not exist.", (unsigned) id);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, &error, -ENOENT);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering SELINUX_UNIT_ACCESS_CHECK(j->unit, connection, message, "stop");
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering job_finish_and_invalidate(j, JOB_CANCELED, true);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering reply = dbus_message_new_method_return(message);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "ClearJobs")) {
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering SELINUX_ACCESS_CHECK(connection, message, "reboot");
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering reply = dbus_message_new_method_return(message);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "ResetFailed")) {
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering SELINUX_ACCESS_CHECK(connection, message, "reload");
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering reply = dbus_message_new_method_return(message);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "ResetFailedUnit")) {
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, &error, -EINVAL);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering dbus_set_error(&error, BUS_ERROR_NO_SUCH_UNIT, "Unit %s is not loaded.", name);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, &error, -ENOENT);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering SELINUX_UNIT_ACCESS_CHECK(u, connection, message, "reload");
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering reply = dbus_message_new_method_return(message);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "SetUnitControlGroups")) {
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering if (!dbus_message_iter_init(message, &iter))
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering r = bus_iter_get_basic_and_next(&iter, DBUS_TYPE_STRING, &name, true);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, NULL, r);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering dbus_set_error(&error, BUS_ERROR_NO_SUCH_UNIT, "Unit %s is not loaded.", name);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, &error, -ENOENT);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering SELINUX_UNIT_ACCESS_CHECK(u, connection, message, "start");
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, NULL, r);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering reply = dbus_message_new_method_return(message);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "UnsetUnitControlGroups")) {
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering if (!dbus_message_iter_init(message, &iter))
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering r = bus_iter_get_basic_and_next(&iter, DBUS_TYPE_STRING, &name, true);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, NULL, r);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering dbus_set_error(&error, BUS_ERROR_NO_SUCH_UNIT, "Unit %s is not loaded.", name);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, &error, -ENOENT);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering SELINUX_UNIT_ACCESS_CHECK(u, connection, message, "stop");
801ad6a6a9cd8fbd58b9f9c27f20dbb3c87d47ddLennart Poettering return bus_send_error_reply(connection, message, NULL, r);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering reply = dbus_message_new_method_return(message);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "SetUnitControlGroupAttributes")) {
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering if (!dbus_message_iter_init(message, &iter))
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering r = bus_iter_get_basic_and_next(&iter, DBUS_TYPE_STRING, &name, true);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, NULL, r);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering dbus_set_error(&error, BUS_ERROR_NO_SUCH_UNIT, "Unit %s is not loaded.", name);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, &error, -ENOENT);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering SELINUX_UNIT_ACCESS_CHECK(u, connection, message, "start");
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering r = bus_unit_cgroup_attribute_set(u, &iter);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, NULL, r);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering reply = dbus_message_new_method_return(message);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "UnsetUnitControlGroupAttributes")) {
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering if (!dbus_message_iter_init(message, &iter))
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering r = bus_iter_get_basic_and_next(&iter, DBUS_TYPE_STRING, &name, true);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, NULL, r);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering dbus_set_error(&error, BUS_ERROR_NO_SUCH_UNIT, "Unit %s is not loaded.", name);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, &error, -ENOENT);
7588460aaf6bd33f6c9bd5645916cfd8a862e9c4Tom Gundersen SELINUX_UNIT_ACCESS_CHECK(u, connection, message, "stop");
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering r = bus_unit_cgroup_attribute_unset(u, &iter);
9a1f0c283bac56eb26a2fa02d62e0e9ece82f25aLennart Poettering return bus_send_error_reply(connection, message, NULL, r);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering reply = dbus_message_new_method_return(message);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "GetUnitControlGroupAttributes")) {
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering if (!dbus_message_iter_init(message, &iter))
9a1f0c283bac56eb26a2fa02d62e0e9ece82f25aLennart Poettering r = bus_iter_get_basic_and_next(&iter, DBUS_TYPE_STRING, &name, true);
9a1f0c283bac56eb26a2fa02d62e0e9ece82f25aLennart Poettering return bus_send_error_reply(connection, message, NULL, r);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering dbus_set_error(&error, BUS_ERROR_NO_SUCH_UNIT, "Unit %s is not loaded.", name);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, &error, -ENOENT);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering SELINUX_UNIT_ACCESS_CHECK(u, connection, message, "status");
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering r = bus_unit_cgroup_attribute_get(u, &iter, &list);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering return bus_send_error_reply(connection, message, NULL, r);
9a1f0c283bac56eb26a2fa02d62e0e9ece82f25aLennart Poettering reply = dbus_message_new_method_return(message);
9a1f0c283bac56eb26a2fa02d62e0e9ece82f25aLennart Poettering dbus_message_iter_init_append(reply, &iter);
9a1f0c283bac56eb26a2fa02d62e0e9ece82f25aLennart Poettering if (bus_append_strv_iter(&iter, list) < 0)
9a1f0c283bac56eb26a2fa02d62e0e9ece82f25aLennart Poettering } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "ListUnits")) {
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering const char *k;
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering SELINUX_ACCESS_CHECK(connection, message, "status");
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering reply = dbus_message_new_method_return(message);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering dbus_message_iter_init_append(reply, &iter);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering if (!dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "(ssssssouso)", &sub))
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering const char *description, *load_state, *active_state, *sub_state, *sjob_type, *following;
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering if (!dbus_message_iter_open_container(&sub, DBUS_TYPE_STRUCT, NULL, &sub2))
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering load_state = unit_load_state_to_string(u->load_state);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering active_state = unit_active_state_to_string(unit_active_state(u));
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering sjob_type = job_type_to_string(u->job->type);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering if (!dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &u->id) ||
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &description) ||
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &load_state) ||
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &active_state) ||
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &sub_state) ||
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &following) ||
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_OBJECT_PATH, &u_path) ||
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_UINT32, &job_id) ||
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &sjob_type) ||
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_OBJECT_PATH, &j_path)) {
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering if (!dbus_message_iter_close_container(&sub, &sub2))
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering if (!dbus_message_iter_close_container(&iter, &sub))
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "ListJobs")) {
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering SELINUX_ACCESS_CHECK(connection, message, "status");
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering reply = dbus_message_new_method_return(message);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering dbus_message_iter_init_append(reply, &iter);
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering if (!dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "(usssoo)", &sub))
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering if (!dbus_message_iter_open_container(&sub, DBUS_TYPE_STRUCT, NULL, &sub2))
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering if (!dbus_message_iter_append_basic(&sub2, DBUS_TYPE_UINT32, &id) ||
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &j->unit->id) ||
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &type) ||
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &state) ||
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_OBJECT_PATH, &j_path) ||
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_OBJECT_PATH, &u_path)) {
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering if (!dbus_message_iter_close_container(&sub, &sub2))
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering if (!dbus_message_iter_close_container(&iter, &sub))
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "Subscribe")) {
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering SELINUX_ACCESS_CHECK(connection, message, "status");
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering s = BUS_CONNECTION_SUBSCRIBED(m, connection);
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering s = set_new(string_hash_func, string_compare_func);
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering if (!dbus_connection_set_data(connection, m->subscribed_data_slot, s, NULL)) {
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering client = strdup(bus_message_get_sender_with_fallback(message));
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering return bus_send_error_reply(connection, message, NULL, r);
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering reply = dbus_message_new_method_return(message);
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "Unsubscribe")) {
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering SELINUX_ACCESS_CHECK(connection, message, "status");
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering client = set_remove(BUS_CONNECTION_SUBSCRIBED(m, connection), (char*) bus_message_get_sender_with_fallback(message));
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering dbus_set_error(&error, BUS_ERROR_NOT_SUBSCRIBED, "Client is not subscribed.");
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering return bus_send_error_reply(connection, message, &error, -ENOENT);
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering reply = dbus_message_new_method_return(message);
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "Dump")) {
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering SELINUX_ACCESS_CHECK(connection, message, "status");
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering reply = dbus_message_new_method_return(message);
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering if (!dbus_message_append_args(reply, DBUS_TYPE_STRING, &dump, DBUS_TYPE_INVALID)) {
a150ff5e4e2481eb28d6ed6e0d3e176623e25f5aLennart Poettering } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "CreateSnapshot")) {
a150ff5e4e2481eb28d6ed6e0d3e176623e25f5aLennart Poettering SELINUX_ACCESS_CHECK(connection, message, "start");
a150ff5e4e2481eb28d6ed6e0d3e176623e25f5aLennart Poettering return bus_send_error_reply(connection, message, &error, -EINVAL);
a150ff5e4e2481eb28d6ed6e0d3e176623e25f5aLennart Poettering r = snapshot_create(m, name, cleanup, &error, &s);
a150ff5e4e2481eb28d6ed6e0d3e176623e25f5aLennart Poettering return bus_send_error_reply(connection, message, &error, r);
a150ff5e4e2481eb28d6ed6e0d3e176623e25f5aLennart Poettering reply = dbus_message_new_method_return(message);
a150ff5e4e2481eb28d6ed6e0d3e176623e25f5aLennart Poettering } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "RemoveSnapshot")) {
a150ff5e4e2481eb28d6ed6e0d3e176623e25f5aLennart Poettering return bus_send_error_reply(connection, message, &error, -EINVAL);
a150ff5e4e2481eb28d6ed6e0d3e176623e25f5aLennart Poettering dbus_set_error(&error, BUS_ERROR_NO_SUCH_UNIT, "Unit %s does not exist.", name);
a150ff5e4e2481eb28d6ed6e0d3e176623e25f5aLennart Poettering return bus_send_error_reply(connection, message, &error, -ENOENT);
a150ff5e4e2481eb28d6ed6e0d3e176623e25f5aLennart Poettering dbus_set_error(&error, BUS_ERROR_NO_SUCH_UNIT, "Unit %s is not a snapshot.", name);
a150ff5e4e2481eb28d6ed6e0d3e176623e25f5aLennart Poettering return bus_send_error_reply(connection, message, &error, -ENOENT);
a150ff5e4e2481eb28d6ed6e0d3e176623e25f5aLennart Poettering SELINUX_UNIT_ACCESS_CHECK(u, connection, message, "stop");
a150ff5e4e2481eb28d6ed6e0d3e176623e25f5aLennart Poettering reply = dbus_message_new_method_return(message);
a150ff5e4e2481eb28d6ed6e0d3e176623e25f5aLennart Poettering } else if (dbus_message_is_method_call(message, "org.freedesktop.DBus.Introspectable", "Introspect")) {
a150ff5e4e2481eb28d6ed6e0d3e176623e25f5aLennart Poettering const char *k;
a150ff5e4e2481eb28d6ed6e0d3e176623e25f5aLennart Poettering SELINUX_ACCESS_CHECK(connection, message, "status");
a150ff5e4e2481eb28d6ed6e0d3e176623e25f5aLennart Poettering reply = dbus_message_new_method_return(message);
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering /* We roll our own introspection code here, instead of
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering * relying on bus_default_message_handler() because we
a150ff5e4e2481eb28d6ed6e0d3e176623e25f5aLennart Poettering * need to generate our introspection string
a150ff5e4e2481eb28d6ed6e0d3e176623e25f5aLennart Poettering * dynamically. */
7f220d94a938a99c77400fa0ca30485e269bae7cLennart Poettering f = open_memstream(&introspection, &size);
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering fprintf(f, "<node name=\"unit/%s\"/>", p);
902bb5d8abb2a7d258741828d212ca549ab16950Lennart Poettering fprintf(f, "<node name=\"job/%lu\"/>", (unsigned long) j->id);
902bb5d8abb2a7d258741828d212ca549ab16950Lennart Poettering if (!dbus_message_append_args(reply, DBUS_TYPE_STRING, &introspection, DBUS_TYPE_INVALID)) {
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "Reload")) {
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering SELINUX_ACCESS_CHECK(connection, message, "reload");
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering /* Instead of sending the reply back right away, we
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * just remember that we need to and then send it
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * after the reload is finished. That way the caller
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * knows when the reload finished. */
da927ba997d68401563b927f92e6e40e021a8e5cMichal Schmidt m->queued_message = dbus_message_new_method_return(message);
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "Reexecute")) {
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering SELINUX_ACCESS_CHECK(connection, message, "reload");
f647962d64e844689f3e2acfce6102fc47e76df2Michal Schmidt /* We don't send a reply back here, the client should
f647962d64e844689f3e2acfce6102fc47e76df2Michal Schmidt * just wait for us disconnecting. */
f647962d64e844689f3e2acfce6102fc47e76df2Michal Schmidt } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "Exit")) {
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering SELINUX_ACCESS_CHECK(connection, message, "halt");
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering dbus_set_error(&error, BUS_ERROR_NOT_SUPPORTED, "Exit is only supported for user service managers.");
902bb5d8abb2a7d258741828d212ca549ab16950Lennart Poettering return bus_send_error_reply(connection, message, &error, -ENOTSUP);
902bb5d8abb2a7d258741828d212ca549ab16950Lennart Poettering reply = dbus_message_new_method_return(message);
da927ba997d68401563b927f92e6e40e021a8e5cMichal Schmidt } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "Reboot")) {
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering SELINUX_ACCESS_CHECK(connection, message, "reboot");
if (!reply)
goto oom;
dbus_set_error(&error, BUS_ERROR_NOT_SUPPORTED, "Powering off is only supported for system managers.");
if (!reply)
goto oom;
if (!reply)
goto oom;
if (!reply)
goto oom;
} else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "SwitchRoot")) {
if (!dbus_message_get_args(
&error,
dbus_set_error(&error, BUS_ERROR_NOT_SUPPORTED, "Switching root is only supported for system managers.");
goto oom;
free(p);
goto oom;
free(u);
goto oom;
v = NULL;
m->switch_root = u;
m->switch_root_init = v;
if (!reply)
goto oom;
} else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "SetEnvironment")) {
char **e = NULL;
if (r == -ENOMEM)
goto oom;
if (!strv_env_is_valid(l))
goto oom;
if (!reply) {
strv_free(e);
goto oom;
m->environment = e;
} else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "UnsetEnvironment")) {
char **e = NULL;
if (r == -ENOMEM)
goto oom;
if (!strv_env_name_or_assignment_is_valid(l))
goto oom;
if (!reply) {
strv_free(e);
goto oom;
m->environment = e;
} else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "UnsetAndSetEnvironment")) {
char **f = NULL;
goto oom;
if (r == -ENOMEM)
goto oom;
if (r == -ENOMEM)
goto oom;
goto oom;
goto oom;
if (!reply) {
strv_free(f);
goto oom;
m->environment = f;
} else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "ListUnitFiles")) {
Hashmap *h;
Iterator i;
if (!reply)
goto oom;
goto oom;
r = unit_file_get_list(m->running_as == SYSTEMD_SYSTEM ? UNIT_FILE_SYSTEM : UNIT_FILE_USER, NULL, h);
goto oom;
const char *state;
goto oom;
goto oom;
} else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "GetUnitFileState")) {
const char *name;
if (!dbus_message_get_args(
&error,
state = unit_file_get_state(m->running_as == SYSTEMD_SYSTEM ? UNIT_FILE_SYSTEM : UNIT_FILE_USER, NULL, name);
if (state < 0)
assert(s);
if (!reply)
goto oom;
if (!dbus_message_append_args(
DBUS_TYPE_STRING, &s,
goto oom;
} else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "EnableUnitFiles") ||
char **l = NULL;
unsigned n_changes = 0;
goto oom;
if (r == -ENOMEM)
goto oom;
strv_free(l);
carries_install_info = r;
carries_install_info = r;
carries_install_info = r;
strv_free(l);
if (!reply)
goto oom;
} else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "DisableUnitFiles") ||
char **l = NULL;
unsigned n_changes = 0;
goto oom;
if (r == -ENOMEM)
goto oom;
strv_free(l);
strv_free(l);
if (!reply)
goto oom;
{ NULL, }
Unit *u;
dbus_bool_t b;
&error,
&error,
if (old_name) {
if (mode < 0) {
if (reply)
goto oom;
return DBUS_HANDLER_RESULT_HANDLED;
oom:
return DBUS_HANDLER_RESULT_NEED_MEMORY;