Following on from my monotone thread, I now know how to set up a service in SME Server and run a process in the foreground. The process I am running is monotone, the distributed change control system, as a server.
Now, I wish to run several of these services, each listening on a different port and connected to a different monotone repository. So far as I can see, a single service can run just one process. If that process happens to spawn several children, and provides supervision for those children (e.g. httpd) then that is fine, but if I want to run more than one forground process, then it seems that it must be done from several different services.
So, the question is: am I understanding this correctly? Do I really need to set up a separate service for each of my monotone repository servers? If so, and assuming the list of repositories and ports is located in a configuration file, how would I automate creating as many or as few services as I need? Would I have one startup service that creates additional services on-the-fly when it starts up, and starts them all as a group?
Or, is there some other way of doing this?
The service processes I would want to start up are basically of this form:
exec useruidgid mtn /usr/local/bin/mtn --db=foo.db --bind=example.com:12000
exec useruidgid mtn /usr/local/bin/mtn --db=bar.db --bind=example.com:12001
etc.
The databases and port bindings will be configured through a file or admin screen.
-- Jason