+static int config_parse_strv_printf(
+ const char *filename,
+ unsigned line,
+ const char *section,
+ const char *lvalue,
+ int ltype,
+ const char *rvalue,
+ void *data,
+ void *userdata) {
+
+ Unit *u = userdata;
+ char *k;
+ int r;
+
+ assert(filename);
+ assert(lvalue);
+ assert(rvalue);
+ assert(u);
+
+ k = unit_full_printf(u, rvalue);
+ if (!k)
+ return -ENOMEM;
+
+ r = config_parse_strv(filename, line, section, lvalue, ltype, k, data, userdata);
+ free(k);
+
+ return r;
+}
+
} else if (streq(lvalue, "ListenSpecial")) {
p->type = SOCKET_SPECIAL;
} else if (streq(lvalue, "ListenSpecial")) {
p->type = SOCKET_SPECIAL;
path_kill_slashes(p->path);
} else if (streq(lvalue, "ListenNetlink")) {
path_kill_slashes(p->path);
} else if (streq(lvalue, "ListenNetlink")) {
log_error("[%s:%u] Failed to parse address value, ignoring: %s", filename, line, rvalue);
free(p);
return 0;
}
} else {
log_error("[%s:%u] Failed to parse address value, ignoring: %s", filename, line, rvalue);
free(p);
return 0;
}
} else {
log_error("[%s:%u] Failed to parse address value, ignoring: %s", filename, line, rvalue);
free(p);
return 0;
log_error("[%s:%u] Failed to parse address value, ignoring: %s", filename, line, rvalue);
free(p);
return 0;
char *state;
FOREACH_WORD_QUOTED(w, l, rvalue, state) {
char *state;
FOREACH_WORD_QUOTED(w, l, rvalue, state) {
- if (!path_is_absolute(rvalue[0] == '-' ? rvalue + 1 : rvalue)) {
- log_error("[%s:%u] Path '%s' is not absolute, ignoring.", filename, line, rvalue);
+ s = unit_full_printf(u, rvalue);
+ if (!s)
+ return -ENOMEM;
+
+ if (!path_is_absolute(s[0] == '-' ? s + 1 : s)) {
+ log_error("[%s:%u] Path '%s' is not absolute, ignoring.", filename, line, s);
+ free(s);
- if (unit_name_is_valid(name, false)) {
- if (!(id = set_get(names, name))) {
+ if (unit_name_is_valid(name, true)) {
{ "CPUSchedulingResetOnFork", config_parse_bool, 0, &(context).cpu_sched_reset_on_fork, section }, \
{ "CPUAffinity", config_parse_cpu_affinity, 0, &(context), section }, \
{ "UMask", config_parse_mode, 0, &(context).umask, section }, \
{ "CPUSchedulingResetOnFork", config_parse_bool, 0, &(context).cpu_sched_reset_on_fork, section }, \
{ "CPUAffinity", config_parse_cpu_affinity, 0, &(context), section }, \
{ "UMask", config_parse_mode, 0, &(context).umask, section }, \
- { "Environment", config_parse_strv, 0, &(context).environment, section }, \
+ { "Environment", config_parse_strv_printf, 0, &(context).environment, section }, \
{ "EnvironmentFile", config_parse_env_file, 0, &(context).environment_files, section }, \
{ "StandardInput", config_parse_input, 0, &(context).std_input, section }, \
{ "StandardOutput", config_parse_output, 0, &(context).std_output, section }, \
{ "EnvironmentFile", config_parse_env_file, 0, &(context).environment_files, section }, \
{ "StandardInput", config_parse_input, 0, &(context).std_input, section }, \
{ "StandardOutput", config_parse_output, 0, &(context).std_output, section }, \
{ "KillMode", config_parse_kill_mode, 0, &(context).kill_mode, section }, \
{ "KillSignal", config_parse_kill_signal, 0, &(context).kill_signal, section }, \
{ "SendSIGKILL", config_parse_bool, 0, &(context).send_sigkill, section }, \
{ "KillMode", config_parse_kill_mode, 0, &(context).kill_mode, section }, \
{ "KillSignal", config_parse_kill_signal, 0, &(context).kill_signal, section }, \
{ "SendSIGKILL", config_parse_bool, 0, &(context).send_sigkill, section }, \
- { "UtmpIdentifier", config_parse_string_printf, 0, &(context).utmp_id, section }
+ { "UtmpIdentifier", config_parse_string_printf, 0, &(context).utmp_id, section }, \
+ { "ControlGroupModify", config_parse_bool, 0, &(context).control_group_modify, section }
const ConfigItem items[] = {
{ "Names", config_parse_names, 0, u, "Unit" },
const ConfigItem items[] = {
{ "Names", config_parse_names, 0, u, "Unit" },
{ "Mark", config_parse_int, 0, &u->socket.mark, "Socket" },
{ "PipeSize", config_parse_size, 0, &u->socket.pipe_size, "Socket" },
{ "FreeBind", config_parse_bool, 0, &u->socket.free_bind, "Socket" },
{ "Mark", config_parse_int, 0, &u->socket.mark, "Socket" },
{ "PipeSize", config_parse_size, 0, &u->socket.pipe_size, "Socket" },
{ "FreeBind", config_parse_bool, 0, &u->socket.free_bind, "Socket" },
+ { "Transparent", config_parse_bool, 0, &u->socket.transparent, "Socket" },
+ { "Broadcast", config_parse_bool, 0, &u->socket.broadcast, "Socket" },
{ "TCPCongestion", config_parse_string, 0, &u->socket.tcp_congestion, "Socket" },
{ "MessageQueueMaxMessages", config_parse_long, 0, &u->socket.mq_maxmsg, "Socket" },
{ "MessageQueueMessageSize", config_parse_long, 0, &u->socket.mq_msgsize, "Socket" },
{ "TCPCongestion", config_parse_string, 0, &u->socket.tcp_congestion, "Socket" },
{ "MessageQueueMaxMessages", config_parse_long, 0, &u->socket.mq_maxmsg, "Socket" },
{ "MessageQueueMessageSize", config_parse_long, 0, &u->socket.mq_msgsize, "Socket" },