作者:xh7212176 | 来源:互联网 | 2023-07-29 18:27
Ineedaprogramthatisabletolaunchasetofprocessesaccordingtoascheduleconfiguration;th
I need a program that is able to launch a set of processes according to a schedule/configuration; the program would run in the background and restart the processes in case they crash.
我需要一个能够根据计划/配置启动一组进程的程序;程序将在后台运行并重新启动进程以防它们崩溃。
There are standard tools for this kind of task on both windows and unix - what I need is a cross platform program which could run on different operating systems using the same configuration.
在windows和unix上都有用于此类任务的标准工具 - 我需要的是一个跨平台程序,它可以使用相同的配置在不同的操作系统上运行。
Any portable C/C++ library which implements the basic functionality (i.e. create processes, signal process termination events etc) would be ok too.
任何实现基本功能的便携式C / C ++库(即创建进程,信号进程终止事件等)都可以。
4 个解决方案
You'd probably have to write that yourself. Its a lot of icky portability hacks for no (real) glorious purpose ... i.e. a lot of work to accomplish something that could be accomplished via other means.
你可能不得不自己写。它有很多狡猾的可携带性黑客,没有(真正的)光荣的目的......即通过其他方式完成一些事情可以完成很多工作。
Getting something to work on *nix, *bsd and MacOS would not be too terribly hard. Crafting / generating a parser to handle some kind of easy rule based configuration file would not be too hard. Adding the final Windows spice to the mix would be a royal pain in the rear. Then off you go to learn some new Python based build configuration system since not every Windows user has cygwin and a shell ... then off you go finding people to help you find bugs.
获得一些工作* nix,* bsd和MacOS不会太难。制作/生成解析器以处理某种基于规则的简单配置文件并不会太难。添加最终的Windows香料混合将是后方的皇家痛苦。然后你去学习一些新的基于Python的构建配置系统,因为不是每个Windows用户都有cygwin和shell ...然后你去寻找帮助你找到bug的人。
After a few hundred hours, you'd begin to wonder if it was really worth writing. In 2 - 3 hours, you could have cygwin, ssh and some handy shell scripts doing the job just fine.
几百个小时后,你会开始怀疑它是否真的值得写。在2-3小时内,您可以使用cygwin,ssh和一些方便的shell脚本来完成这项工作。
It is said that most really useful programs are a direct result of a programmer scratching a personal itch. So .. if this is something you really need and have time to do, I'd say go for it. Surely, it would become rather popular. Barring that, for the reasons above, I suspect such a program would remain unwritten for quite some time to come.
据说大多数真正有用的程序都是程序员抓住个人痒的直接结果。那么..如果这是你真正需要并有时间做的事情,我会说去吧。当然,它会变得相当受欢迎。除此之外,由于上述原因,我怀疑这样的程序在未来一段时间内仍然是不成文的。