]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Merge pull request #13743 from anitazha/dropin_all_the_things
authorChris Down <chris@chrisdown.name>
Thu, 17 Oct 2019 03:10:05 +0000 (23:10 -0400)
committerGitHub <noreply@github.com>
Thu, 17 Oct 2019 03:10:05 +0000 (23:10 -0400)
core: support top level drop-ins through -.service.d for service units

1  2 
man/systemd.service.xml
src/core/service.c

Simple merge
index 3713490c93893e99531c8bb8dae1e8c562e68e3e,24ad1e77fa913a17f1603578fe85fc6dfe6fea5a..256ca46fd88cc30a52c8553aa96303c8f92ae20a
@@@ -548,8 -548,15 +548,13 @@@ static int service_arm_timer(Service *s
  
  static int service_verify(Service *s) {
          assert(s);
 -
 -        if (UNIT(s)->load_state != UNIT_LOADED)
 -                return 0;
 +        assert(UNIT(s)->load_state == UNIT_LOADED);
  
+         if (!service_unit_name_is_valid(UNIT(s)->id)) {
+                 log_unit_error(UNIT(s), "Service name is invalid or reserved. Refusing.");
+                 return -EINVAL;
+         }
          if (!s->exec_command[SERVICE_EXEC_START] && !s->exec_command[SERVICE_EXEC_STOP]
              && UNIT(s)->success_action == EMERGENCY_ACTION_NONE) {
                  /* FailureAction= only makes sense if one of the start or stop commands is specified.