In man launchctl
we can read:
Note that per-user configuration files (LaunchAgents) must be owned by the user loading them. All sytem-wide daemons (LaunchDaemons) must be owned by root. Configuration files must not be group- or world-writable. These restrictions are in place for security reasons.
This is how launchctl.c checks that:
bool path_goodness_check(const char *path, bool forceload) {
if (forceload) {
return true;
}
if (sb.st_mode & (S_IWOTH|S_IWGRP)) {
fprintf(stderr, "%s: Dubious permissions on file (skipping): %s\n", getprogname(), path);
return false;
}
if (sb.st_uid != 0 && sb.st_uid != getuid()) {
fprintf(stderr, "%s: Dubious ownership on file (skipping): %s\n", getprogname(), path);
return false;
}
if (!(S_ISREG(sb.st_mode) || S_ISDIR(sb.st_mode))) {
fprintf(stderr, "%s: Dubious path. Not a regular file or directory (skipping): %s\n", getprogname(), path);
return false;
}
if ((!S_ISDIR(sb.st_mode)) && (fnmatch("*.plist", path, FNM_CASEFOLD) == FNM_NOMATCH)) {
fprintf(stderr, "%s: Dubious file. Not of type .plist (skipping): %s\n", getprogname(), path);
return false;
}
return true;
}
So in other words, correct the ownership, permissions or path of your .plist file or force the loading (-F
).