2

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.

Any portable C/C++ library which implements the basic functionality (i.e. create processes, signal process termination events etc) would be ok too.

CloudyMarble
  • 36,908
  • 70
  • 97
  • 130
  • Hi Jon - did you ever find a solution to this? Even for just Windows? I have a similar need and have hand-crafted a ProcessManager class that can start processes, stop them, and send/receive signals. However, I would still rather use something more standard if it exists? Thanks. – Chad Jun 14 '10 at 19:33

5 Answers5

1

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.

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.

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.

Tim Post
  • 33,371
  • 15
  • 110
  • 174
0

How about a cron implementation in Golang?

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.

Adam
  • 3,311
  • 1
  • 18
  • 9
0

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?

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.

Fernando Miguélez
  • 11,196
  • 6
  • 36
  • 54
0

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.

Brian Clapper
  • 25,705
  • 7
  • 65
  • 65
0

supervisord is a userspace process manager, written in python, for unix and windows

supervisord shares some of the same goals of programs like launchd, daemontools, and runit. Unlike some of these programs, it is not meant to be run as a substitute for init as “process id 1”. Instead it is meant to be used to control processes related to a project or a customer, and is meant to start like any other program at boot time.

related: running supervisord-unix on cygwin on windows (probably not needed with the windows version of supervisor)

milahu
  • 2,447
  • 1
  • 18
  • 25