4 This file is part of systemd.
6 Copyright 2010 Lennart Poettering
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
28 /* This defines pretty names for the LSB 'start' verb exit codes. Note that they shouldn't be confused with the LSB
29 * 'status' verb exit codes which are defined very differently. For details see:
31 * https://refspecs.linuxbase.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
35 /* EXIT_SUCCESS defined by libc */
36 /* EXIT_FAILURE defined by libc */
37 EXIT_INVALIDARGUMENT
= 2,
38 EXIT_NOTIMPLEMENTED
= 3,
39 EXIT_NOPERMISSION
= 4,
40 EXIT_NOTINSTALLED
= 5,
41 EXIT_NOTCONFIGURED
= 6,
44 /* The LSB suggests that error codes >= 200 are "reserved". We
45 * use them here under the assumption that they hence are
46 * unused by init scripts. */
58 EXIT_CHROOT
, /* 210 */
68 EXIT_SETSID
, /* 220 */
71 _EXIT_RESERVED
, /* used to be tcpwrap, don't reuse! */
75 EXIT_NO_NEW_PRIVILEGES
,
78 EXIT_PERSONALITY
, /* 230 */
79 EXIT_APPARMOR_PROFILE
,
80 EXIT_ADDRESS_FAMILIES
,
81 EXIT_RUNTIME_DIRECTORY
,
82 _EXIT_RESERVED2
, /* used to be used by kdbus, don't reuse */
84 EXIT_SMACK_PROCESS_LABEL
,
88 EXIT_LOGS_DIRECTORY
, /* 240 */
89 EXIT_CONFIGURATION_DIRECTORY
,
92 typedef enum ExitStatusLevel
{
93 EXIT_STATUS_MINIMAL
, /* only cover libc EXIT_STATUS/EXIT_FAILURE */
94 EXIT_STATUS_SYSTEMD
, /* cover libc and systemd's own exit codes */
95 EXIT_STATUS_LSB
, /* cover libc, systemd's own and LSB exit codes */
96 EXIT_STATUS_FULL
= EXIT_STATUS_LSB
99 typedef struct ExitStatusSet
{
104 const char* exit_status_to_string(int status
, ExitStatusLevel level
) _const_
;
106 typedef enum ExitClean
{
111 bool is_clean_exit(int code
, int status
, ExitClean clean
, ExitStatusSet
*success_status
);
113 void exit_status_set_free(ExitStatusSet
*x
);
114 bool exit_status_set_is_empty(ExitStatusSet
*x
);
115 bool exit_status_set_test(ExitStatusSet
*x
, int code
, int status
);