]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
master: Don't check if service's executable exists if there are no listeners.
authorTimo Sirainen <tss@iki.fi>
Sun, 7 Feb 2010 17:13:55 +0000 (19:13 +0200)
committerTimo Sirainen <tss@iki.fi>
Sun, 7 Feb 2010 17:13:55 +0000 (19:13 +0200)
--HG--
branch : HEAD

src/master/service.c

index 0d7fdd0b8ceab06209bcb75e7ce7b28eb27507eb..f8e5b39e4c67955d05406bd785a9962652aaca9b 100644 (file)
@@ -236,12 +236,6 @@ service_create(pool_t pool, const struct service_settings *set,
                        p_strconcat(pool, set->master_set->libexec_dir, "/",
                                    set->executable, NULL);
        }
-       if (access(t_strcut(service->executable, ' '), X_OK) < 0) {
-               *error_r = t_strdup_printf("access(%s) failed: %m",
-                                          t_strcut(service->executable, ' '));
-               return NULL;
-       }
-
        /* set these later, so if something fails we don't have to worry about
           closing them */
        service->log_fd[0] = -1;
@@ -313,6 +307,13 @@ service_create(pool_t pool, const struct service_settings *set,
                        return NULL;
        }
 
+       if (array_count(&service->listeners) > 0) {
+               if (access(t_strcut(service->executable, ' '), X_OK) < 0) {
+                       *error_r = t_strdup_printf("access(%s) failed: %m",
+                               t_strcut(service->executable, ' '));
+                       return NULL;
+               }
+       }
        return service;
 }