Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

systemd .service unit file generator #20

Open
jonnor opened this issue Oct 5, 2015 · 4 comments
Open

systemd .service unit file generator #20

jonnor opened this issue Oct 5, 2015 · 4 comments
Milestone

Comments

@jonnor
Copy link
Member

jonnor commented Oct 5, 2015

We should be able to generate .service unit files for systemd, that can start MsgFlo participant(s).

Similar to to how we can generate Procfile using msgflo-procfile for starting participants on Heroku.

Useful when hosting participants directly on a Linux machine, be it a embedded device or a VM.

@jonnor jonnor changed the title systemct .service unit file generator systemd .service unit file generator Oct 5, 2015
@bergie
Copy link
Member

bergie commented Oct 5, 2015

Potentially useful also: supervisord example

@jonnor jonnor added this to the Future milestone Nov 30, 2015
@jonnor
Copy link
Member Author

jonnor commented Apr 19, 2016

systemd has a concept of a .service file template, which multiple instance can be created of. https://fedoramagazine.org/systemd-template-unit-files/
Probably it makes sense that we generate one template service file per MsgFlo component, and then use the instance mechanism to spawn one or more roles. We should also set DefaultUnit=defaultrole though, to make using instances optional.

Because systemd provides both start and stop (and unlike in sysvinit, they are reliable), and these days also supports a --user mode (no root needed to install .service files) - we can potentially use systemd for 'live-coding' with msgflo.
Persistence would be doable by calling systemctl enable ...

@jonnor
Copy link
Member Author

jonnor commented Dec 13, 2016

It would also be good to have one unit created for the entire graphs, which pulls in the individual service units for each node to realize the whole system. It is a bit unclear how to do this, but I think the pieces are:

@jonnor
Copy link
Member Author

jonnor commented Dec 14, 2016

Here is a (handwritten) example of the above approach https://github.com/jonnor/rebirth/tree/master/systemd
It seems to work fine except for one oddity systemctl restart rebirth.target does not stop/start the .services, however systemctl stop/start does.
Possibly should use PartOf directive. However not clear if this augments or replaces the Requires. http://unix.stackexchange.com/questions/212438/how-to-stop-all-units-belonging-to-the-same-target

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants