Lines 1576-1584
Link Here
|
1576 |
static int send_prepare_for(Manager *m, InhibitWhat w, bool _active) { |
1576 |
static int send_prepare_for(Manager *m, InhibitWhat w, bool _active) { |
1577 |
int active = _active; |
1577 |
int active = _active; |
1578 |
|
1578 |
|
|
|
1579 |
log_debug("send_prepare_for()"); |
1580 |
|
1579 |
assert(m); |
1581 |
assert(m); |
1580 |
assert(IN_SET(w, INHIBIT_SHUTDOWN, INHIBIT_SLEEP)); |
1582 |
assert(IN_SET(w, INHIBIT_SHUTDOWN, INHIBIT_SLEEP)); |
1581 |
|
1583 |
|
|
|
1584 |
log_debug("send_prepare_for() sending PrepareFor..."); |
1582 |
return sd_bus_emit_signal(m->bus, |
1585 |
return sd_bus_emit_signal(m->bus, |
1583 |
"/org/freedesktop/login1", |
1586 |
"/org/freedesktop/login1", |
1584 |
"org.freedesktop.login1.Manager", |
1587 |
"org.freedesktop.login1.Manager", |
Lines 1738-1743
Link Here
|
1738 |
bool delayed; |
1741 |
bool delayed; |
1739 |
int r; |
1742 |
int r; |
1740 |
|
1743 |
|
|
|
1744 |
log_debug("bus_manager_shutdown_or_sleep_now_or_later() enter"); |
1745 |
|
1741 |
assert(m); |
1746 |
assert(m); |
1742 |
assert(unit_name); |
1747 |
assert(unit_name); |
1743 |
assert(w > 0); |
1748 |
assert(w > 0); |
Lines 1769-1774
Link Here
|
1769 |
* immediately */ |
1774 |
* immediately */ |
1770 |
r = execute_shutdown_or_sleep(m, w, unit_name, error); |
1775 |
r = execute_shutdown_or_sleep(m, w, unit_name, error); |
1771 |
|
1776 |
|
|
|
1777 |
log_debug("bus_manager_shutdown_or_sleep_now_or_later() leave"); |
1772 |
return r; |
1778 |
return r; |
1773 |
} |
1779 |
} |
1774 |
|
1780 |
|
Lines 1857-1862
Link Here
|
1857 |
uint64_t flags; |
1863 |
uint64_t flags; |
1858 |
int r; |
1864 |
int r; |
1859 |
|
1865 |
|
|
|
1866 |
log_info("method_do_shutdown_or_sleep() enter"); |
1867 |
|
1860 |
assert(m); |
1868 |
assert(m); |
1861 |
assert(message); |
1869 |
assert(message); |
1862 |
assert(unit_name); |
1870 |
assert(unit_name); |
Lines 1885-1890
Link Here
|
1885 |
flags = interactive ? SD_LOGIND_INTERACTIVE : 0; |
1893 |
flags = interactive ? SD_LOGIND_INTERACTIVE : 0; |
1886 |
} |
1894 |
} |
1887 |
|
1895 |
|
|
|
1896 |
log_debug("method_do_shutdown_or_sleep() flags parsed"); |
1897 |
|
1898 |
|
1888 |
if ((flags & SD_LOGIND_REBOOT_VIA_KEXEC) && kexec_loaded()) |
1899 |
if ((flags & SD_LOGIND_REBOOT_VIA_KEXEC) && kexec_loaded()) |
1889 |
unit_name = SPECIAL_KEXEC_TARGET; |
1900 |
unit_name = SPECIAL_KEXEC_TARGET; |
1890 |
|
1901 |
|
Lines 1905-1912
Link Here
|
1905 |
return r; |
1916 |
return r; |
1906 |
} |
1917 |
} |
1907 |
|
1918 |
|
|
|
1919 |
log_debug("method_do_shutdown_or_sleep() operation verified"); |
1920 |
|
1908 |
r = verify_shutdown_creds(m, message, w, action, action_multiple_sessions, |
1921 |
r = verify_shutdown_creds(m, message, w, action, action_multiple_sessions, |
1909 |
action_ignore_inhibit, flags, error); |
1922 |
action_ignore_inhibit, flags, error); |
|
|
1923 |
log_debug("method_do_shutdown_or_sleep() creds verified: %d", r); |
1910 |
if (r != 0) |
1924 |
if (r != 0) |
1911 |
return r; |
1925 |
return r; |
1912 |
|
1926 |
|
Lines 1914-1919
Link Here
|
1914 |
if (r < 0) |
1928 |
if (r < 0) |
1915 |
return r; |
1929 |
return r; |
1916 |
|
1930 |
|
|
|
1931 |
log_debug("method_do_shutdown_or_sleep() leave"); |
1917 |
return sd_bus_reply_method_return(message, NULL); |
1932 |
return sd_bus_reply_method_return(message, NULL); |
1918 |
} |
1933 |
} |
1919 |
|
1934 |
|