diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-04-08 18:10:32 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-04-12 13:43:32 +0200 |
commit | e20b2a867ac5ac7ff6d43898fb83bc78f730909e (patch) | |
tree | 54b6780ea7baa9cf2dc2fd841d743e8078b48bd0 /src/core/unit.c | |
parent | 344ca7556bf6c1c8727c19a0eb8751a27dc0a85f (diff) |
core: when creating a drop-in snippet, add a comment explaining this to it
Diffstat (limited to 'src/core/unit.c')
-rw-r--r-- | src/core/unit.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/unit.c b/src/core/unit.c index a8174e6041..fb4f3ddff6 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -3357,7 +3357,7 @@ static const char* unit_drop_in_dir(Unit *u, UnitSetPropertiesMode mode) { int unit_write_drop_in(Unit *u, UnitSetPropertiesMode mode, const char *name, const char *data) { _cleanup_free_ char *p = NULL, *q = NULL; - const char *dir; + const char *dir, *prefixed; int r; assert(u); @@ -3376,7 +3376,10 @@ int unit_write_drop_in(Unit *u, UnitSetPropertiesMode mode, const char *name, co if (!dir) return -EINVAL; - r = write_drop_in(dir, u->id, 50, name, data); + prefixed = strjoina("# This is a drop-in unit file extension, created via \"systemctl set-property\" or an equivalent operation. Do not edit.\n", + data); + + r = write_drop_in(dir, u->id, 50, name, prefixed); if (r < 0) return r; |