diff --git a/Makefile.am b/Makefile.am
index d59f6660b1..84cc435b37 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2944,7 +2944,8 @@ MANPAGES += \
man/sd_uid_get_state.3 \
man/sd_session_is_active.3 \
man/sd_seat_get_active.3 \
- man/sd_get_seats.3
+ man/sd_get_seats.3 \
+ man/systemd-user-sessions.service.8
MANPAGES_ALIAS += \
man/systemd-logind.8 \
@@ -2965,7 +2966,8 @@ MANPAGES_ALIAS += \
man/sd_seat_get_sessions.3 \
man/sd_seat_can_multi_session.3 \
man/sd_get_sessions.3 \
- man/sd_get_uids.3
+ man/sd_get_uids.3 \
+ man/systemd-user-sessions.8
man/systemd-logind.8: man/systemd-logind.service.8
man/sd_login_monitor_unref.3: man/sd_login_monitor_new.3
@@ -2986,6 +2988,7 @@ man/sd_seat_get_sessions.3: man/sd_seat_get_active.3
man/sd_seat_can_multi_session.3: man/sd_seat_get_active.3
man/sd_get_sessions.3: man/sd_get_seats.3
man/sd_get_uids.3: man/sd_get_seats.3
+man/systemd-user-sessions.8: man/systemd-user-sessions.service.8
EXTRA_DIST += \
src/login/logind-gperf.gperf \
diff --git a/man/systemd-logind.service.xml b/man/systemd-logind.service.xml
index 3e6887299d..9cef4ad6c0 100644
--- a/man/systemd-logind.service.xml
+++ b/man/systemd-logind.service.xml
@@ -112,6 +112,7 @@
See Also
systemd1,
+ systemd-user-sessions.service8,
loginctl1,
logind.conf5,
pam_systemd8
diff --git a/man/systemd-user-sessions.service.xml b/man/systemd-user-sessions.service.xml
new file mode 100644
index 0000000000..338b7012bf
--- /dev/null
+++ b/man/systemd-user-sessions.service.xml
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+ systemd-user-sessions.service
+ systemd
+
+
+
+ Developer
+ Lennart
+ Poettering
+ lennart@poettering.net
+
+
+
+
+
+ systemd-user-sessions.service
+ 8
+
+
+
+ systemd-user-sessions.service
+ systemd-user-sessions
+ Permit user logins after boot, prohibit user logins at shutdown.
+
+
+
+ systemd-user-sessions.service
+ /usr/lib/systemd/systemd-user-sessions
+
+
+
+ Description
+
+ systemd-user-sessions.service
+ is a service that controls user logins. After basic
+ system initialization is complete it removes
+ /run/login, thus permitting
+ logins. Before system shutdown it creates
+ /run/nologin, thus prohibiting
+ further logins. At the same time it also kills all
+ user processes, so that system shutdown may proceed
+ without any remaining user processes around.
+
+
+
+ See Also
+
+ systemd1,
+ systemd-logind.service8,
+ pam_nologin8
+
+
+
+
diff --git a/src/login/user-sessions.c b/src/login/user-sessions.c
index 98b36c60e8..91531e8f38 100644
--- a/src/login/user-sessions.c
+++ b/src/login/user-sessions.c
@@ -69,17 +69,18 @@ int main(int argc, char*argv[]) {
int r, q;
char *cgroup_user_tree = NULL;
- if ((r = write_one_line_file_atomic("/run/nologin", "System is going down.")) < 0)
+ r = write_one_line_file_atomic("/run/nologin", "System is going down.");
+ if (r < 0)
log_error("Failed to create /run/nologin: %s", strerror(-r));
- if ((q = cg_get_user_path(&cgroup_user_tree)) < 0) {
+ q = cg_get_user_path(&cgroup_user_tree);
+ if (q < 0) {
log_error("Failed to determine use path: %s", strerror(-q));
goto finish;
}
q = cg_kill_recursive_and_wait(SYSTEMD_CGROUP_CONTROLLER, cgroup_user_tree, true);
free(cgroup_user_tree);
-
if (q < 0) {
log_error("Failed to kill sessions: %s", strerror(-q));
goto finish;
diff --git a/units/systemd-user-sessions.service.in b/units/systemd-user-sessions.service.in
index 363093ee1d..0869e73991 100644
--- a/units/systemd-user-sessions.service.in
+++ b/units/systemd-user-sessions.service.in
@@ -7,7 +7,8 @@
[Unit]
Description=Permit User Sessions
-After=local-fs.target remote-fs.target
+Documentation=man:systemd-user-sessions.service(8)
+After=remote-fs.target
[Service]
Type=oneshot