Closed cadorn closed 11 years ago
no clue
maybe implement it with libuv
, i was thinking about that for some time now but didnt even start anything yet since i am not very fluent in C
@cadorn
I've implemented long ago for mongrel-service (a gem for old Mongrel webserver) some logic to launch and monitor background processes.
It was written in FreeBASIC:
https://github.com/luislavena/mongrel_service
What the service did (console process) is monitor every 5 seconds if the child process was terminated:
I've managed to refresh this code into something cleaner:
https://github.com/luislavena/service_wrapper
The implementation of ConsoleProcess
is cleaner:
https://github.com/luislavena/service_wrapper/blob/master/inc/console_process.bi
But service_wrapper
no longer restart the process if it dies:
https://github.com/luislavena/service_wrapper/blob/master/src/service_wrapper.bas#L69-L72
Checking running
can be used.
service_wrapper is a naive approach to run Windows services. There are other tools like nssm that you might try too.
That of course, if you want to run things as service. If not, you could use console_process
code and create something that mimics mon. Pretty much that is the building block.
Cheers.
@luislavena Thanks a lot for your info. I'll have to take a look at that when this becomes a priority. Maybe someone will beat me to writing a mon-style wrapper before then ;)
going to close for now, i wouldn't be able to maintain a windows thing anyway
@visionmedia yeah, even if you wanted, mon codebase would get complicated to support both platforms and workaround Windows limitations. Perhaps someone can work on mon.exe
that is CLI compatible.
@cadorn send me an email if you find interest in build such thing or issues with service_wrapper/mini_service libraries.
I was wondering what it would take or if there is a windows equivalent for what
mon
does.I am trying to get my toolchain running cross-platform and am looking for
mon for windows
.