Reputation: 1157
I'm trying to add some simple stuff to app_process
by introducing a bash script before its invocation as follows:
app_process:
#!/system/bin/sh
ENV=env_data /system/bin/app_process.orig $*
However, after pushing the required files in via adb:
adb push app_process system/bin
adb push app_process.orig system/bin
The emulator won't start properly again with shell stop/start or running the emulator command with the modified system.img. It goes into some boot failure loop with the following error:
E/BandwidthController( 4244): runIptablesCmd(): failed /system/bin/iptables -A bw_INPUT -i lo --jump RETURN res=768
E/BandwidthController( 4244): runIptablesCmd(): failed /system/bin/ip6tables -A bw_INPUT -i lo --jump RETURN res=768
E/Netd ( 4244): Unable to bind netlink socket: No such file or directory
E/Netd ( 4244): Unable to open quota2 logging socket
D/MDnsDS ( 4244): MDnsSdListener::Hander starting up
D/MDnsDS ( 4244): MDnsSdListener starting to monitor
D/MDnsDS ( 4244): Going to poll with pollCount 1
Is the way I'm calling app_process
correct?
Upvotes: 0
Views: 1125
Reputation: 385
I think the init can't run the script without specified executable.
The app_process are launched by the init process by reading its script, /init.rc.
The default command of Android in init.rc:
service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
And you might need change it to:
service zygote /system/bin/sh /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
This will let init run the script by invoke shell.
However If you want to modify init.rc, you need repack the ramdisk.img & boot.img and flash it.
Upvotes: 1