]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/user-sessions/user-sessions.c
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
10 #include "fileio-label.h"
12 #include "main-func.h"
14 #include "selinux-util.h"
15 #include "string-util.h"
17 static int run(int argc
, char *argv
[]) {
21 return log_error_errno(SYNTHETIC_ERRNO(EINVAL
),
22 "This program requires one argument.");
32 /* We only touch /run/nologin. See create_shutdown_run_nologin_or_warn() for details. */
34 if (streq(argv
[1], "start"))
35 return unlink_or_warn("/run/nologin");
36 if (streq(argv
[1], "stop"))
37 return create_shutdown_run_nologin_or_warn();
39 return log_error_errno(SYNTHETIC_ERRNO(EINVAL
), "Unknown verb '%s'.", argv
[1]);
42 DEFINE_MAIN_FUNCTION(run
);