热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

跨平台流程管理器工具-Acrossplatformprocessmanagertool

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

#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,但有趣的是,删除不是内置的。


推荐阅读
  • 本文讨论了在Windows 8上安装gvim中插件时出现的错误加载问题。作者将EasyMotion插件放在了正确的位置,但加载时却出现了错误。作者提供了下载链接和之前放置插件的位置,并列出了出现的错误信息。 ... [详细]
  • 成功安装Sabayon Linux在thinkpad X60上的经验分享
    本文分享了作者在国庆期间在thinkpad X60上成功安装Sabayon Linux的经验。通过修改CHOST和执行emerge命令,作者顺利完成了安装过程。Sabayon Linux是一个基于Gentoo Linux的发行版,可以将电脑快速转变为一个功能强大的系统。除了作为一个live DVD使用外,Sabayon Linux还可以被安装在硬盘上,方便用户使用。 ... [详细]
  • 微软评估和规划(MAP)的工具包介绍及应用实验手册
    本文介绍了微软评估和规划(MAP)的工具包,该工具包是一个无代理工具,旨在简化和精简通过网络范围内的自动发现和评估IT基础设施在多个方案规划进程。工具包支持库存和使用用于SQL Server和Windows Server迁移评估,以及评估服务器的信息最广泛使用微软的技术。此外,工具包还提供了服务器虚拟化方案,以帮助识别未被充分利用的资源和硬件需要成功巩固服务器使用微软的Hyper - V技术规格。 ... [详细]
  • 基于PgpoolII的PostgreSQL集群安装与配置教程
    本文介绍了基于PgpoolII的PostgreSQL集群的安装与配置教程。Pgpool-II是一个位于PostgreSQL服务器和PostgreSQL数据库客户端之间的中间件,提供了连接池、复制、负载均衡、缓存、看门狗、限制链接等功能,可以用于搭建高可用的PostgreSQL集群。文章详细介绍了通过yum安装Pgpool-II的步骤,并提供了相关的官方参考地址。 ... [详细]
  • Commit1ced2a7433ea8937a1b260ea65d708f32ca7c95eintroduceda+Clonetraitboundtom ... [详细]
  • Centos7.6安装Gitlab教程及注意事项
    本文介绍了在Centos7.6系统下安装Gitlab的详细教程,并提供了一些注意事项。教程包括查看系统版本、安装必要的软件包、配置防火墙等步骤。同时,还强调了使用阿里云服务器时的特殊配置需求,以及建议至少4GB的可用RAM来运行GitLab。 ... [详细]
  • 本文介绍了如何使用Express App提供静态文件,同时提到了一些不需要使用的文件,如package.json和/.ssh/known_hosts,并解释了为什么app.get('*')无法捕获所有请求以及为什么app.use(express.static(__dirname))可能会提供不需要的文件。 ... [详细]
  • 本文详细介绍了git常用命令及其操作方法,包括查看、添加、提交、删除、找回等操作,以及如何重置修改文件、抛弃工作区修改、将工作文件提交到本地暂存区、从版本库中删除文件等。同时还介绍了如何从暂存区恢复到工作文件、恢复最近一次提交过的状态,以及如何合并多个操作等。 ... [详细]
  • VueCLI多页分目录打包的步骤记录
    本文介绍了使用VueCLI进行多页分目录打包的步骤,包括页面目录结构、安装依赖、获取Vue CLI需要的多页对象等内容。同时还提供了自定义不同模块页面标题的方法。 ... [详细]
  • 本文介绍了Python语言程序设计中文件和数据格式化的操作,包括使用np.savetext保存文本文件,对文本文件和二进制文件进行统一的操作步骤,以及使用Numpy模块进行数据可视化编程的指南。同时还提供了一些关于Python的测试题。 ... [详细]
  • Iamtryingtocreateanarrayofstructinstanceslikethis:我试图创建一个这样的struct实例数组:letinstallers: ... [详细]
  • 本文介绍了在RHEL 7中的系统日志管理和网络管理。系统日志管理包括rsyslog和systemd-journal两种日志服务,分别介绍了它们的特点、配置文件和日志查询方式。网络管理主要介绍了使用nmcli命令查看和配置网络接口的方法,包括查看网卡信息、添加、修改和删除配置文件等操作。 ... [详细]
  • Introduction(简介)Forbeingapowerfulobject-orientedprogramminglanguage,Cisuseda ... [详细]
  • 本博文基于《Amalgamationofproteinsequence,structureandtextualinformationforimprovingprote ... [详细]
  • Django + Ansible 主机管理(有源码)
    本文给大家介绍如何利用DjangoAnsible进行Web项目管理。Django介绍一个可以使Web开发工作愉快并且高效的Web开发框架,能够以最小的代价构建和维护高 ... [详细]
author-avatar
xh7212176
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有