Hi
I need to install a linux package (yocto/bitbake) .ipk, from inside my program.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
if ( fork() == 0 ) {
setsid();
if ( fork() == 0 ) {
execlp("/etc/ifmii/scripts/update.sh", (char *) nullptr);
} else {
int status;
wait(&status);
_exit(0);
}
} else {
int status;
wait(&status);
_exit(0);
}
|
While the script does run, it fails to utilize the package manager to actually install the package. Instead it just silently fails.
The script itself works, when run by hand. But when run from the actual systemd service it should replace, it just wont run through to the end.
Echo logs will be in the log file, until the actual install command. There it stops.
opkg install --force-options $(find packages) 2>&1 /update.log
It fails to log stderr and stdout from opkg.
Since i do not have anything to go with. No errors, nothing, i'm hoping someone can help with this.
I can run other opkg commands such as
opkg list | opkg status pkg
I did try exec*(), system(), popen()/pclose() and the above is just the most current idea. But since the script generally starts, the problem has to be something else...