init、cron 和 am 交互
第一次在这里发布海报。我的安卓系统有问题。我将 cron 守护进程设置为每隔一段时间运行一个脚本。该脚本内置有警报,当脚本失败或成功时会触发警报。警报使用“am”命令来激活某些 APK 上的操作(一个唤醒设备,另一个播放音乐和/或振动)。
该脚本运行良好。但是,当从 crond 调用它时,它的行为会异常。 dmesg 显示 init 根据以下代码杀死了进程:
svc = service_find_by_pid(pid); 如果(!svc){ ERROR("未跟踪的 pid %d 已退出\n", pid);
显然我的脚本不在 init.rc 文件中,crond 也不是作为一项服务(我的手机每次启动时都会从 ramdisk 锁定/重新加载 init.rc)。有没有办法在不编辑 init.rc 的情况下解决这个问题?
first time poster here. I have a problem with android. I have cron daemon set up to run a script every once and a while. This script has alarms built in to it that trigger when the script fails or succeeds. The alarms use "am" commands to activate actions on some APKs (one wakes the device, the other plays music and or vibrates).
The script works fine. However, when it is called from the crond it behaves abnormally. dmesg shows init killed the process as per this bit of code:
svc = service_find_by_pid(pid);
if (!svc) {
ERROR("untracked pid %d exited\n", pid);
Obviously my script is not in the init.rc file, nor is crond for that matter, as a service (my phone is locked/reloads init.rc from ramdisk every boot). Is there a manner of fixing this problem without editing the init.rc?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个演练似乎让您想到了:
http://howto.ccroms.net/howto/cron
this walkthrough seems like it had you in mind:
http://howto.ccroms.net/howto/cron