diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index 72c47150d0c..483dc1a69fc 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -180,7 +180,7 @@ static int parse_line( char *l, void *userdata) { - char *e; + char *e, *include; assert(filename); assert(line > 0); @@ -194,7 +194,8 @@ static int parse_line( if (strchr(COMMENTS "\n", *l)) return 0; - if (startswith(l, ".include ")) { + include = first_word(l, ".include"); + if (include) { _cleanup_free_ char *fn = NULL; /* .includes are a bad idea, we only support them here @@ -211,7 +212,11 @@ static int parse_line( return 0; } - fn = file_in_same_dir(filename, strstrip(l+9)); + log_syntax(unit, LOG_WARNING, filename, line, 0, + ".include directives are deprecated, and support for them will be removed in a future version of systemd. " + "Please use drop-in files instead."); + + fn = file_in_same_dir(filename, strstrip(include)); if (!fn) return -ENOMEM;