1 /*-*- Mode: C; c-basic-offset: 8 -*-*/
10 #include <sys/prctl.h>
14 #include "conf-parser.h"
15 #include "load-fragment.h"
18 #include "securebits.h"
21 static int config_parse_deps(
30 UnitDependency d
= PTR_TO_UINT(data
);
40 FOREACH_WORD(w
, &l
, rvalue
, state
) {
44 if (!(t
= strndup(w
, l
)))
47 r
= unit_add_dependency_by_name(u
, d
, t
);
57 static int config_parse_names(
76 FOREACH_WORD(w
, &l
, rvalue
, state
) {
81 if (!(t
= strndup(w
, l
)))
84 other
= manager_get_unit(u
->meta
.manager
, t
);
90 if (other
->meta
.load_state
!= UNIT_STUB
) {
95 if ((r
= unit_merge(u
, other
)) < 0) {
102 if ((r
= unit_add_name(u
, t
)) < 0) {
114 static int config_parse_listen(
115 const char *filename
,
134 if (!(p
= new0(SocketPort
, 1)))
137 if (streq(lvalue
, "ListenFIFO")) {
138 p
->type
= SOCKET_FIFO
;
140 if (!(p
->path
= strdup(rvalue
))) {
145 p
->type
= SOCKET_SOCKET
;
147 if ((r
= socket_address_parse(&p
->address
, rvalue
)) < 0) {
148 log_error("[%s:%u] Failed to parse address value: %s", filename
, line
, rvalue
);
153 if (streq(lvalue
, "ListenStream"))
154 p
->address
.type
= SOCK_STREAM
;
155 else if (streq(lvalue
, "ListenDatagram"))
156 p
->address
.type
= SOCK_DGRAM
;
158 assert(streq(lvalue
, "ListenSequentialPacket"));
159 p
->address
.type
= SOCK_SEQPACKET
;
162 if (socket_address_family(&p
->address
) != AF_LOCAL
&& p
->address
.type
== SOCK_SEQPACKET
) {
164 return -EPROTONOSUPPORT
;
169 LIST_PREPEND(SocketPort
, port
, s
->ports
, p
);
174 static int config_parse_socket_bind(
175 const char *filename
,
193 if ((r
= parse_boolean(rvalue
)) < 0) {
194 log_error("[%s:%u] Failed to parse bind IPv6 only value: %s", filename
, line
, rvalue
);
198 s
->bind_ipv6_only
= r
? SOCKET_ADDRESS_IPV6_ONLY
: SOCKET_ADDRESS_BOTH
;
203 static int config_parse_nice(
204 const char *filename
,
212 ExecContext
*c
= data
;
220 if ((r
= safe_atoi(rvalue
, &priority
)) < 0) {
221 log_error("[%s:%u] Failed to parse nice priority: %s", filename
, line
, rvalue
);
225 if (priority
< PRIO_MIN
|| priority
>= PRIO_MAX
) {
226 log_error("[%s:%u] Nice priority out of range: %s", filename
, line
, rvalue
);
236 static int config_parse_oom_adjust(
237 const char *filename
,
245 ExecContext
*c
= data
;
253 if ((r
= safe_atoi(rvalue
, &oa
)) < 0) {
254 log_error("[%s:%u] Failed to parse OOM adjust value: %s", filename
, line
, rvalue
);
258 if (oa
< OOM_DISABLE
|| oa
> OOM_ADJUST_MAX
) {
259 log_error("[%s:%u] OOM adjust value out of range: %s", filename
, line
, rvalue
);
264 c
->oom_adjust_set
= true;
269 static int config_parse_umask(
270 const char *filename
,
288 l
= strtol(rvalue
, &x
, 8);
289 if (!x
|| *x
|| errno
) {
290 log_error("[%s:%u] Failed to parse umask value: %s", filename
, line
, rvalue
);
291 return errno
? -errno
: -EINVAL
;
294 if (l
< 0000 || l
> 0777) {
295 log_error("[%s:%u] umask value out of range: %s", filename
, line
, rvalue
);
303 static int config_parse_exec(
304 const char *filename
,
312 ExecCommand
**e
= data
, *ee
, *nce
= NULL
;
325 FOREACH_WORD_QUOTED(w
, l
, rvalue
, state
)
328 if (!(n
= new(char*, k
+1)))
332 FOREACH_WORD_QUOTED(w
, l
, rvalue
, state
)
333 if (!(n
[k
++] = strndup(w
, l
)))
338 if (!n
[0] || !path_is_absolute(n
[0])) {
339 log_error("[%s:%u] Invalid executable path in command line: %s", filename
, line
, rvalue
);
344 if (!(nce
= new0(ExecCommand
, 1)))
348 if (!(nce
->path
= strdup(n
[0])))
352 /* It's kinda important that we keep the order here */
353 LIST_FIND_TAIL(ExecCommand
, command
, *e
, ee
);
354 LIST_INSERT_AFTER(ExecCommand
, command
, *e
, ee
, nce
);
370 static int config_parse_usec(
371 const char *filename
,
380 unsigned long long u
;
388 if ((r
= safe_atollu(rvalue
, &u
)) < 0) {
389 log_error("[%s:%u] Failed to parse time value: %s", filename
, line
, rvalue
);
393 /* We actually assume the user configures seconds. Later on we
394 * might choose to support suffixes for time values, to
395 * configure bigger or smaller units */
397 *usec
= u
* USEC_PER_SEC
;
402 static int config_parse_service_type(
403 const char *filename
,
419 if ((x
= service_type_from_string(rvalue
)) < 0) {
420 log_error("[%s:%u] Failed to parse service type: %s", filename
, line
, rvalue
);
429 static int config_parse_service_restart(
430 const char *filename
,
446 if ((x
= service_restart_from_string(rvalue
)) < 0) {
447 log_error("[%s:%u] Failed to parse service restart specifier: %s", filename
, line
, rvalue
);
456 int config_parse_bindtodevice(
457 const char *filename
,
473 if (rvalue
[0] && !streq(rvalue
, "*")) {
474 if (!(n
= strdup(rvalue
)))
479 free(s
->bind_to_device
);
480 s
->bind_to_device
= n
;
485 int config_parse_output(
486 const char *filename
,
494 ExecOutput
*o
= data
, x
;
501 if ((x
= exec_output_from_string(rvalue
)) < 0) {
502 log_error("[%s:%u] Failed to parse output specifier: %s", filename
, line
, rvalue
);
511 int config_parse_input(
512 const char *filename
,
520 ExecInput
*i
= data
, x
;
527 if ((x
= exec_input_from_string(rvalue
)) < 0) {
528 log_error("[%s:%u] Failed to parse input specifier: %s", filename
, line
, rvalue
);
537 int config_parse_facility(
538 const char *filename
,
554 if ((x
= log_facility_from_string(rvalue
)) < 0)
556 /* Second try, let's see if this is a number. */
557 if (safe_atoi(rvalue
, &x
) < 0 || !log_facility_to_string(x
)) {
558 log_error("[%s:%u] Failed to parse log facility: %s", filename
, line
, rvalue
);
562 *o
= LOG_MAKEPRI(x
, LOG_PRI(*o
));
567 int config_parse_level(
568 const char *filename
,
584 if ((x
= log_level_from_string(rvalue
)) < 0)
586 /* Second try, let's see if this is a number. */
587 if (safe_atoi(rvalue
, &x
) < 0 || !log_level_to_string(x
)) {
588 log_error("[%s:%u] Failed to parse log level: %s", filename
, line
, rvalue
);
592 *o
= LOG_MAKEPRI(LOG_FAC(*o
), x
);
596 int config_parse_io_class(
597 const char *filename
,
605 ExecContext
*c
= data
;
613 if ((x
= ioprio_class_from_string(rvalue
)) < 0)
615 /* Second try, let's see if this is a number. */
616 if (safe_atoi(rvalue
, &x
) < 0 || !ioprio_class_to_string(x
)) {
617 log_error("[%s:%u] Failed to parse IO scheduling class: %s", filename
, line
, rvalue
);
621 c
->ioprio
= IOPRIO_PRIO_VALUE(x
, IOPRIO_PRIO_DATA(c
->ioprio
));
622 c
->ioprio_set
= true;
627 int config_parse_io_priority(
628 const char *filename
,
636 ExecContext
*c
= data
;
644 if (safe_atoi(rvalue
, &i
) < 0 || i
< 0 || i
>= IOPRIO_BE_NR
) {
645 log_error("[%s:%u] Failed to parse io priority: %s", filename
, line
, rvalue
);
649 c
->ioprio
= IOPRIO_PRIO_VALUE(IOPRIO_PRIO_CLASS(c
->ioprio
), i
);
650 c
->ioprio_set
= true;
655 int config_parse_cpu_sched_policy(
656 const char *filename
,
665 ExecContext
*c
= data
;
673 if ((x
= sched_policy_from_string(rvalue
)) < 0)
675 /* Second try, let's see if this is a number. */
676 if (safe_atoi(rvalue
, &x
) < 0 || !sched_policy_to_string(x
)) {
677 log_error("[%s:%u] Failed to parse CPU scheduling policy: %s", filename
, line
, rvalue
);
681 c
->cpu_sched_policy
= x
;
682 c
->cpu_sched_set
= true;
687 int config_parse_cpu_sched_prio(
688 const char *filename
,
696 ExecContext
*c
= data
;
704 /* On Linux RR/FIFO have the same range */
705 if (safe_atoi(rvalue
, &i
) < 0 || i
< sched_get_priority_min(SCHED_RR
) || i
> sched_get_priority_max(SCHED_RR
)) {
706 log_error("[%s:%u] Failed to parse CPU scheduling priority: %s", filename
, line
, rvalue
);
710 c
->cpu_sched_priority
= i
;
711 c
->cpu_sched_set
= true;
716 int config_parse_cpu_affinity(
717 const char *filename
,
725 ExecContext
*c
= data
;
735 FOREACH_WORD(w
, &l
, rvalue
, state
) {
740 if (!(t
= strndup(w
, l
)))
743 r
= safe_atou(t
, &cpu
);
746 if (r
< 0 || cpu
>= CPU_SETSIZE
) {
747 log_error("[%s:%u] Failed to parse CPU affinity: %s", filename
, line
, rvalue
);
751 CPU_SET(cpu
, &c
->cpu_affinity
);
754 c
->cpu_affinity_set
= true;
759 int config_parse_capabilities(
760 const char *filename
,
768 ExecContext
*c
= data
;
776 if (!(cap
= cap_from_text(rvalue
))) {
780 log_error("[%s:%u] Failed to parse capabilities: %s", filename
, line
, rvalue
);
785 cap_free(c
->capabilities
);
786 c
->capabilities
= cap
;
791 int config_parse_secure_bits(
792 const char *filename
,
800 ExecContext
*c
= data
;
810 FOREACH_WORD(w
, &l
, rvalue
, state
) {
811 if (first_word(w
, "keep-caps"))
812 c
->secure_bits
|= SECURE_KEEP_CAPS
;
813 else if (first_word(w
, "keep-caps-locked"))
814 c
->secure_bits
|= SECURE_KEEP_CAPS_LOCKED
;
815 else if (first_word(w
, "no-setuid-fixup"))
816 c
->secure_bits
|= SECURE_NO_SETUID_FIXUP
;
817 else if (first_word(w
, "no-setuid-fixup-locked"))
818 c
->secure_bits
|= SECURE_NO_SETUID_FIXUP_LOCKED
;
819 else if (first_word(w
, "noroot"))
820 c
->secure_bits
|= SECURE_NOROOT
;
821 else if (first_word(w
, "noroot-locked"))
822 c
->secure_bits
|= SECURE_NOROOT_LOCKED
;
824 log_error("[%s:%u] Failed to parse secure bits: %s", filename
, line
, rvalue
);
832 int config_parse_bounding_set(
833 const char *filename
,
841 ExecContext
*c
= data
;
851 FOREACH_WORD(w
, &l
, rvalue
, state
) {
856 if (!(t
= strndup(w
, l
)))
859 r
= cap_from_name(t
, &cap
);
863 log_error("[%s:%u] Failed to parse capability bounding set: %s", filename
, line
, rvalue
);
867 c
->capability_bounding_set_drop
|= 1 << cap
;
873 static int config_parse_timer_slack_ns(
874 const char *filename
,
882 ExecContext
*c
= data
;
891 if ((r
= safe_atolu(rvalue
, &u
)) < 0) {
892 log_error("[%s:%u] Failed to parse time slack value: %s", filename
, line
, rvalue
);
896 c
->timer_slack_ns
= u
;
901 static int config_parse_limit(
902 const char *filename
,
910 struct rlimit
**rl
= data
;
911 unsigned long long u
;
919 if ((r
= safe_atollu(rvalue
, &u
)) < 0) {
920 log_error("[%s:%u] Failed to parse resource value: %s", filename
, line
, rvalue
);
925 if (!(*rl
= new(struct rlimit
, 1)))
928 (*rl
)->rlim_cur
= (*rl
)->rlim_max
= (rlim_t
) u
;
934 static int open_follow(char **filename
, FILE **_f
, Set
*names
, char **_id
) {
945 /* This will update the filename pointer if the loaded file is
946 * reached by a symlink. The old string will be freed. */
949 char *target
, *k
, *name
;
951 if (c
++ >= FOLLOW_MAX
)
954 path_kill_slashes(*filename
);
956 /* Add the file name we are currently looking at to
957 * the names of this unit */
958 name
= file_name_from_path(*filename
);
959 if (!(id
= set_get(names
, name
))) {
961 if (!(id
= strdup(name
)))
964 if ((r
= set_put(names
, id
)) < 0) {
970 /* Try to open the file name, but don't if its a symlink */
971 if ((fd
= open(*filename
, O_RDONLY
|O_CLOEXEC
|O_NOCTTY
|O_NOFOLLOW
)) >= 0)
977 /* Hmm, so this is a symlink. Let's read the name, and follow it manually */
978 if ((r
= readlink_malloc(*filename
, &target
)) < 0)
981 k
= file_in_same_dir(*filename
, target
);
991 if (!(f
= fdopen(fd
, "r"))) {
993 assert(close_nointr(fd
) == 0);
1002 static int load_from_path(Unit
*u
, const char *path
) {
1004 static const char* const section_table
[_UNIT_TYPE_MAX
] = {
1005 [UNIT_SERVICE
] = "Service",
1006 [UNIT_TIMER
] = "Timer",
1007 [UNIT_SOCKET
] = "Socket",
1008 [UNIT_TARGET
] = "Target",
1009 [UNIT_DEVICE
] = "Device",
1010 [UNIT_MOUNT
] = "Mount",
1011 [UNIT_AUTOMOUNT
] = "Automount",
1012 [UNIT_SNAPSHOT
] = "Snapshot"
1015 #define EXEC_CONTEXT_CONFIG_ITEMS(context, section) \
1016 { "WorkingDirectory", config_parse_path, &(context).working_directory, section }, \
1017 { "RootDirectory", config_parse_path, &(context).root_directory, section }, \
1018 { "User", config_parse_string, &(context).user, section }, \
1019 { "Group", config_parse_string, &(context).group, section }, \
1020 { "SupplementaryGroups", config_parse_strv, &(context).supplementary_groups, section }, \
1021 { "Nice", config_parse_nice, &(context), section }, \
1022 { "OOMAdjust", config_parse_oom_adjust, &(context), section }, \
1023 { "IOSchedulingClass", config_parse_io_class, &(context), section }, \
1024 { "IOSchedulingPriority", config_parse_io_priority, &(context), section }, \
1025 { "CPUSchedulingPolicy", config_parse_cpu_sched_policy,&(context), section }, \
1026 { "CPUSchedulingPriority", config_parse_cpu_sched_prio, &(context), section }, \
1027 { "CPUAffinity", config_parse_cpu_affinity, &(context), section }, \
1028 { "UMask", config_parse_umask, &(context).umask, section }, \
1029 { "Environment", config_parse_strv, &(context).environment, section }, \
1030 { "Output", config_parse_output, &(context).output, section }, \
1031 { "Input", config_parse_input, &(context).input, section }, \
1032 { "SyslogIdentifier", config_parse_string, &(context).syslog_identifier, section }, \
1033 { "SyslogFacility", config_parse_facility, &(context).syslog_priority, section }, \
1034 { "SyslogLevel", config_parse_level, &(context).syslog_priority, section }, \
1035 { "Capabilities", config_parse_capabilities, &(context), section }, \
1036 { "SecureBits", config_parse_secure_bits, &(context), section }, \
1037 { "CapabilityBoundingSetDrop", config_parse_bounding_set, &(context), section }, \
1038 { "TimerSlackNS", config_parse_timer_slack_ns, &(context), section }, \
1039 { "LimitCPU", config_parse_limit, &(context).rlimit[RLIMIT_CPU], section }, \
1040 { "LimitFSIZE", config_parse_limit, &(context).rlimit[RLIMIT_FSIZE], section }, \
1041 { "LimitDATA", config_parse_limit, &(context).rlimit[RLIMIT_DATA], section }, \
1042 { "LimitSTACK", config_parse_limit, &(context).rlimit[RLIMIT_STACK], section }, \
1043 { "LimitCORE", config_parse_limit, &(context).rlimit[RLIMIT_CORE], section }, \
1044 { "LimitRSS", config_parse_limit, &(context).rlimit[RLIMIT_RSS], section }, \
1045 { "LimitNOFILE", config_parse_limit, &(context).rlimit[RLIMIT_NOFILE], section }, \
1046 { "LimitAS", config_parse_limit, &(context).rlimit[RLIMIT_AS], section }, \
1047 { "LimitNPROC", config_parse_limit, &(context).rlimit[RLIMIT_NPROC], section }, \
1048 { "LimitMEMLOCK", config_parse_limit, &(context).rlimit[RLIMIT_MEMLOCK], section }, \
1049 { "LimitLOCKS", config_parse_limit, &(context).rlimit[RLIMIT_LOCKS], section }, \
1050 { "LimitSIGPENDING", config_parse_limit, &(context).rlimit[RLIMIT_SIGPENDING], section }, \
1051 { "LimitMSGQUEUE", config_parse_limit, &(context).rlimit[RLIMIT_MSGQUEUE], section }, \
1052 { "LimitNICE", config_parse_limit, &(context).rlimit[RLIMIT_NICE], section }, \
1053 { "LimitRTPRIO", config_parse_limit, &(context).rlimit[RLIMIT_RTPRIO], section }, \
1054 { "LimitRTTIME", config_parse_limit, &(context).rlimit[RLIMIT_RTTIME], section }
1056 const ConfigItem items
[] = {
1057 { "Names", config_parse_names
, u
, "Meta" },
1058 { "Description", config_parse_string
, &u
->meta
.description
, "Meta" },
1059 { "Requires", config_parse_deps
, UINT_TO_PTR(UNIT_REQUIRES
), "Meta" },
1060 { "SoftRequires", config_parse_deps
, UINT_TO_PTR(UNIT_SOFT_REQUIRES
), "Meta" },
1061 { "Wants", config_parse_deps
, UINT_TO_PTR(UNIT_WANTS
), "Meta" },
1062 { "Requisite", config_parse_deps
, UINT_TO_PTR(UNIT_REQUISITE
), "Meta" },
1063 { "SoftRequisite", config_parse_deps
, UINT_TO_PTR(UNIT_SOFT_REQUISITE
), "Meta" },
1064 { "Conflicts", config_parse_deps
, UINT_TO_PTR(UNIT_CONFLICTS
), "Meta" },
1065 { "Before", config_parse_deps
, UINT_TO_PTR(UNIT_BEFORE
), "Meta" },
1066 { "After", config_parse_deps
, UINT_TO_PTR(UNIT_AFTER
), "Meta" },
1067 { "RecursiveStop", config_parse_bool
, &u
->meta
.recursive_stop
, "Meta" },
1068 { "StopWhenUnneeded", config_parse_bool
, &u
->meta
.stop_when_unneeded
, "Meta" },
1070 { "PIDFile", config_parse_path
, &u
->service
.pid_file
, "Service" },
1071 { "ExecStartPre", config_parse_exec
, u
->service
.exec_command
+SERVICE_EXEC_START_PRE
, "Service" },
1072 { "ExecStart", config_parse_exec
, u
->service
.exec_command
+SERVICE_EXEC_START
, "Service" },
1073 { "ExecStartPost", config_parse_exec
, u
->service
.exec_command
+SERVICE_EXEC_START_POST
, "Service" },
1074 { "ExecReload", config_parse_exec
, u
->service
.exec_command
+SERVICE_EXEC_RELOAD
, "Service" },
1075 { "ExecStop", config_parse_exec
, u
->service
.exec_command
+SERVICE_EXEC_STOP
, "Service" },
1076 { "ExecStopPost", config_parse_exec
, u
->service
.exec_command
+SERVICE_EXEC_STOP_POST
, "Service" },
1077 { "RestartSec", config_parse_usec
, &u
->service
.restart_usec
, "Service" },
1078 { "TimeoutSec", config_parse_usec
, &u
->service
.timeout_usec
, "Service" },
1079 { "Type", config_parse_service_type
, &u
->service
, "Service" },
1080 { "Restart", config_parse_service_restart
, &u
->service
, "Service" },
1081 EXEC_CONTEXT_CONFIG_ITEMS(u
->service
.exec_context
, "Service"),
1083 { "ListenStream", config_parse_listen
, &u
->socket
, "Socket" },
1084 { "ListenDatagram", config_parse_listen
, &u
->socket
, "Socket" },
1085 { "ListenSequentialPacket", config_parse_listen
, &u
->socket
, "Socket" },
1086 { "ListenFIFO", config_parse_listen
, &u
->socket
, "Socket" },
1087 { "BindIPv6Only", config_parse_socket_bind
, &u
->socket
, "Socket" },
1088 { "Backlog", config_parse_unsigned
, &u
->socket
.backlog
, "Socket" },
1089 { "BindToDevice", config_parse_bindtodevice
, &u
->socket
, "Socket" },
1090 { "ExecStartPre", config_parse_exec
, u
->socket
.exec_command
+SOCKET_EXEC_START_PRE
, "Socket" },
1091 { "ExecStartPost", config_parse_exec
, u
->socket
.exec_command
+SOCKET_EXEC_START_POST
, "Socket" },
1092 { "ExecStopPre", config_parse_exec
, u
->socket
.exec_command
+SOCKET_EXEC_STOP_PRE
, "Socket" },
1093 { "ExecStopPost", config_parse_exec
, u
->socket
.exec_command
+SOCKET_EXEC_STOP_POST
, "Socket" },
1094 EXEC_CONTEXT_CONFIG_ITEMS(u
->socket
.exec_context
, "Socket"),
1096 EXEC_CONTEXT_CONFIG_ITEMS(u
->automount
.exec_context
, "Automount"),
1098 { NULL
, NULL
, NULL
, NULL
}
1101 #undef EXEC_CONTEXT_CONFIG_ITEMS
1103 const char *sections
[3];
1108 char *filename
, *id
;
1110 sections
[0] = "Meta";
1111 sections
[1] = section_table
[u
->meta
.type
];
1114 if (!(symlink_names
= set_new(string_hash_func
, string_compare_func
)))
1117 /* Instead of opening the path right away, we manually
1118 * follow all symlinks and add their name to our unit
1119 * name set while doing so */
1120 if (!(filename
= path_make_absolute(path
, unit_path()))) {
1125 if ((r
= open_follow(&filename
, &f
, symlink_names
, &id
)) < 0) {
1127 r
= 0; /* returning 0 means: no suitable config file found */
1132 /* Now, parse the file contents */
1133 r
= config_parse(filename
, f
, sections
, items
, u
);
1137 /* Let's try to add in all symlink names we found */
1138 while ((k
= set_steal_first(symlink_names
))) {
1139 if ((r
= unit_add_name(u
, k
)) < 0)
1144 unit_choose_id(u
, id
);
1149 free(u
->meta
.load_path
);
1150 u
->meta
.load_path
= filename
;
1153 r
= 1; /* returning 1 means: suitable config file found and loaded */
1156 while ((k
= set_steal_first(symlink_names
)))
1158 set_free(symlink_names
);
1164 int unit_load_fragment(Unit
*u
) {
1169 assert(u
->meta
.load_state
== UNIT_STUB
);
1171 if (u
->meta
.load_path
)
1172 r
= load_from_path(u
, u
->meta
.load_path
);
1177 /* Try to find a name we can load this with */
1178 SET_FOREACH(t
, u
->meta
.names
, i
)
1179 if ((r
= load_from_path(u
, t
)) != 0)
1183 if (u
->meta
.type
== UNIT_SOCKET
)
1184 c
= &u
->socket
.exec_context
;
1185 else if (u
->meta
.type
== UNIT_SERVICE
)
1186 c
= &u
->service
.exec_context
;
1191 (c
->output
== EXEC_OUTPUT_KERNEL
|| c
->output
== EXEC_OUTPUT_SYSLOG
)) {
1194 /* If syslog or kernel logging is requested, make sure
1195 * our own logging daemon is run first. */
1197 if ((k
= unit_add_dependency_by_name(u
, UNIT_AFTER
, SPECIAL_LOGGER_SOCKET
)) < 0)
1200 if ((k
= unit_add_dependency_by_name(u
, UNIT_REQUIRES
, SPECIAL_LOGGER_SOCKET
)) < 0)