Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@chris-piekarski
Created September 18, 2013 23:39
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 chris-piekarski/6617285 to your computer and use it in GitHub Desktop.
Save chris-piekarski/6617285 to your computer and use it in GitHub Desktop.
The exec command is not implemend by default for init.rc despite what the readme.txt says. Add the following to get it working.
file: android/system/core/init/builtins.c
int do_exec(int nargs, char **args)
{
const int cmd_line_max = 256;
char cmd_line[cmd_line_max];
int cmd_length, i;
cmd_line[0] = '\0';
cmd_length = 0;
for(i = 1; i < nargs; i++)
{
cmd_length += (strlen(args[i]) + 2);
if(cmd_length >= cmd_line_max) return -1;
strcat(cmd_line, args[i]);
strcat(cmd_line, " ");
}
return system(cmd_line);
//return -1;
}
@chris-piekarski
Copy link
Author

or do something like this instead

service aName /aPath/aScript.sh
oneshot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment