systemctl 显示二进制文件的不同行为
我开发了一款 OTA(无线)管理器,它在内部使用“swupdate”命令来更新固件。此 swupdate 由 OTA 管理器代码内的“system()”函数应用。
我的二进制文件按预期工作,并且如果我直接从控制台运行二进制文件 ota_manager,“swupdate”命令工作正常。
我为我的二进制文件创建了一个 systemctl 服务,如下所示:
[Unit]
Description=OTA manager service
After=syslogd.service
[Service]
Type=simple
ExecStart=/usr/bin/ota_manager
[Install]
WantedBy=multi-user.target
如果我运行此服务,swupdate 命令总是失败并出现错误:
SWUPDATE failed [0] ERROR handlers/archive_handler.c : extract : 110 : archive_read_next_header(): Pathname can't be converted from UTF-8 to current locale
我正在检查 swupdate 错误,但我不认为这是 swupdate 问题,因为如果我在控制台上手动应用命令或者直接从控制台运行 ota_manager 二进制文件,它工作正常。 看来是 systemctl 造成了这个问题。
我正在使用基于 NXP IMX6ULL 的定制硬件和 Hardknott 版本 Yocto OS(5.10 内核)。 注意:我已经验证了与 Warrior 版本 Yocto OS(4.19 内核)相同的代码,并且相同的代码也可以在 systemctl 服务中正常工作。
这里有人有指点吗?
I have developed one OTA(Over The Air) manager which uses "swupdate" command internally to update the firmware. This swupdate is applied by "system()" function inside OTA manager code.
My binary is working as expected and "swupdate" command is working fine if I run my binary ota_manager directly from console.
I have created one systemctl service for my binary as below:
[Unit]
Description=OTA manager service
After=syslogd.service
[Service]
Type=simple
ExecStart=/usr/bin/ota_manager
[Install]
WantedBy=multi-user.target
If I run this service, swupdate command is always failing with error:
SWUPDATE failed [0] ERROR handlers/archive_handler.c : extract : 110 : archive_read_next_header(): Pathname can't be converted from UTF-8 to current locale
I am checking swupdate error but I don't think it is a swupdate issue as it is working fine if I apply the command manually on the console or I run ota_manager binary directly from the console.
It is looking like systemctl is creating the issue.
I am using NXP IMX6ULL based custom hardware with hardknott version Yocto OS(5.10 kernel).
Note: I have validated same with warrior version Yocto OS(4.19 kernel) and same code is working fine with systemctl service as well.
Do anyone has any pointers here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
找到根本原因:
Found root cause: