Skip to content

Instantly share code, notes, and snippets.

@stevenwilliamson
Created April 10, 2015 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevenwilliamson/ea6c42b8ee3d2c7a823a to your computer and use it in GitHub Desktop.
Save stevenwilliamson/ea6c42b8ee3d2c7a823a to your computer and use it in GitHub Desktop.
The error from the services logfile when starting with use_profile = true and profile = deploy set in method_context
Could not find the execution profile "deploy", command /opt/local/lib/svc/method/unicorn
Code responsible for error in librestart.c from illumos-joyent
eap = getexecprof(buf, KV_COMMAND, cmdp, GET_ONE);
if (eap == NULL)
return (mc_error_create(merr, ENOENT,
"Could not find the execution profile \"%s\", "
"command %s.", buf, cmdp));
Simple program that makes the same call but does not specify the name
at test.c
#include <stdio.h>
#include <exec_attr.h>
#include <secdb.h>
int main(){
execattr_t *execprof;
if ((execprof=getexecprof(NULL, KV_COMMAND, "/opt/local/lib/svc/method/unicorn",
GET_ONE)) == NULL) {
printf("Not Found");
} else
{
printf("Found");
printf("name: %s, policy: %s, id: %s\n", execprof->name, execprof->policy, execprof->id);
}
}
./a.out
Foundname: deploy, policy: solaris, id: /opt/local/lib/svc/method/unicorn
Tweak to test to also include profile name
#include <stdio.h>
#include <exec_attr.h>
#include <secdb.h>
int main(){
execattr_t *execprof;
if ((execprof=getexecprof("deploy", KV_COMMAND, "/opt/local/lib/svc/method/unicorn",
GET_ONE)) == NULL) {
printf("Not Found");
} else
{
printf("Found");
printf("name: %s, policy: %s, id: %s\n", execprof->name, execprof->policy, execprof->id);
}
}
./a.out
Not Found
Wut ??
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment