Found the appropriate code in dovecot:
} else if ((path_env = getenv("PATH")) != NULL) {
/* we have to find our executable from path */
path = t_str_new(256);
paths = t_strsplit(path_env, ":");
for (; *paths != NULL; paths++) {
str_append(path, *paths);
str_append_c(path, '/');
str_append(path, *binpath);
if (access(str_c(path), X_OK) == 0) {
*binpath = str_c(path);
return TRUE;
}
str_truncate(path, 0);
}
*error_r = "Could not find the wanted executable from PATH";
return FALSE;
} else {
*error_r = "PATH environment variable undefined";
return FALSE;
}
So yes, for some reason when started from a dinit service file, PATH is not set.
>Do I set the PATH there? To what value?
To your standard locations like /usr/bin and /usr/sbin