diff --git a/src/service.c b/src/service.c index 19fb8a9a..270bf829 100644 --- a/src/service.c +++ b/src/service.c @@ -1570,15 +1570,15 @@ int service_register(int type, char *cfg, struct rlimit rlimit[], char *file) } else svc = svc_find(name, id); + if (!whichp(cmd)) { + if (nowarn) + return 0; + + warn("%s: skipping %s", file ? file : "static", cmd); + return errno; + } + if (!svc) { - if (!whichp(cmd)) { - if (nowarn) - return 0; - - warn("%s: skipping %s", file ? file : "static", cmd); - return errno; - } - dbg("Creating new svc for %s name %s id %s type %d", cmd, name, id, type); svc = svc_new(cmd, name, id, type); if (!svc) {