Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个应用程序,它在菜单中列出了其他应用程序,目标是始终检查哪些是“活动的”,并根据它们是活动的还是禁用的来对它们进行排序。不幸的是,这些应用程序虽然目前是使用单一框架构建的,但将来可能会使用其他东西构建。所以我想到的一种方法是以某种方式经常检查应用程序的 systemctl 状态。我不需要通过这个应用程序运行系统,只需检查列表中的每个应用程序是否“实时”。有什么方法可以使用 C++ 检查和解析进程的 systemctl 状态吗?