跨平台流程管理器工具

时间:2021-09-09 04:22:13

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 个解决方案

#1


What about installing ssh servers on all those platforms and handle the start/stop of processes by means of every platform own command line tools?

如何在所有这些平台上安装ssh服务器并通过每个平台自己的命令行工具处理进程的启动/停止?

To be able to access without prompt authentication I would use asymmetric key authentication without password so access would be immediate from a controlling machine to all the hosts managed.

为了能够在没有提示认证的情况下访问,我将使用不带密码的非对称密钥认证,因此可以立即从控制机器访问所有托管的主机。

So my solution would be a home-made one consisting of a bunch of scripts (.bat or .sh or whatever scripting language you want) and several ssh servers.

所以我的解决方案是一个由一堆脚本(.bat或.sh或你想要的任何脚本语言)和几个ssh服务器组成的自制解决方案。

#2


If you're willing to go all Unix-centric, Cygwin comes with a version of cron that can be run as a service on Windows. Then, you could use a common crontab file across your platforms. See http://www.noah.org/ssh/cygwin-crond.html.

如果你愿意以Unix为中心,那么Cygwin会附带一个可以在Windows上作为服务运行的cron版本。然后,您可以在您的平台上使用常见的crontab文件。见http://www.noah.org/ssh/cygwin-crond.html。

#3


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.

据说大多数真正有用的程序都是程序员抓住个人痒的直接结果。那么..如果这是你真正需要并有时间做的事情,我会说去吧。当然,它会变得相当受欢迎。除此之外,由于上述原因,我怀疑这样的程序在未来一段时间内仍然是不成文的。

#4


How about a cron implementation in Golang?

在Golang中如何实现cron?

https://godoc.org/github.com/robfig/cron

It's cross platform and issues your commands when you need it too. It distributes as a small executable. No dependencies necessary. It allows you to add crons, but funny enough, remove isn't built in.

它是跨平台的,并在您需要时发出命令。它作为一个小的可执行文件分发。没有必要的依赖。它允许你添加crons,但有趣的是,删除不是内置的。

#1


What about installing ssh servers on all those platforms and handle the start/stop of processes by means of every platform own command line tools?

如何在所有这些平台上安装ssh服务器并通过每个平台自己的命令行工具处理进程的启动/停止?

To be able to access without prompt authentication I would use asymmetric key authentication without password so access would be immediate from a controlling machine to all the hosts managed.

为了能够在没有提示认证的情况下访问,我将使用不带密码的非对称密钥认证,因此可以立即从控制机器访问所有托管的主机。

So my solution would be a home-made one consisting of a bunch of scripts (.bat or .sh or whatever scripting language you want) and several ssh servers.

所以我的解决方案是一个由一堆脚本(.bat或.sh或你想要的任何脚本语言)和几个ssh服务器组成的自制解决方案。

#2


If you're willing to go all Unix-centric, Cygwin comes with a version of cron that can be run as a service on Windows. Then, you could use a common crontab file across your platforms. See http://www.noah.org/ssh/cygwin-crond.html.

如果你愿意以Unix为中心,那么Cygwin会附带一个可以在Windows上作为服务运行的cron版本。然后,您可以在您的平台上使用常见的crontab文件。见http://www.noah.org/ssh/cygwin-crond.html。

#3


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.

据说大多数真正有用的程序都是程序员抓住个人痒的直接结果。那么..如果这是你真正需要并有时间做的事情,我会说去吧。当然,它会变得相当受欢迎。除此之外,由于上述原因,我怀疑这样的程序在未来一段时间内仍然是不成文的。

#4


How about a cron implementation in Golang?

在Golang中如何实现cron?

https://godoc.org/github.com/robfig/cron

It's cross platform and issues your commands when you need it too. It distributes as a small executable. No dependencies necessary. It allows you to add crons, but funny enough, remove isn't built in.

它是跨平台的,并在您需要时发出命令。它作为一个小的可执行文件分发。没有必要的依赖。它允许你添加crons,但有趣的是,删除不是内置的。