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

Proposal: Integrate s6-rc into the overlay to handle service dependencies elegantly #123

Closed
glerchundi opened this issue Dec 17, 2015 · 10 comments

Comments

@glerchundi
Copy link
Member

Coming from #112

@dreamcat4
Copy link

Is this program s6-rc, also needed to start and stop services?

I can see in skanet documents there is a down file can put next to run in the services.d folder. Which makes avoid starting the service automatically. However I would also like to stop a service which was already running.

Or else should we make some shell script to do this without s6-rc program?

For example:

#!/bin/sh
# stop service

touch /etc/services.d/$1/down

# do something to kill supervised service
# it will try to restart the service but see "down" file, and know not to

and

#!/bin/sh
# start service

rm /etc/services.d/$1/down
# do something to start the supervised service

@skarnet
Copy link
Contributor

skarnet commented Mar 3, 2016

Starting a machine with all services down and having a script that brings them up one by one is a viable solution. However, if you're going to do something like this, it means you have dependencies between services, so you'll want readiness notification, etc. etc. and ultimately it would be simpler to use s6-rc to get your machine running.

It's possible to use s6-rc with Docker, but I don't think s6-overlay is the project for this. Dependency management is a complex thing and it's difficult to provide a framework for it without saying "provide the compiled service database yourself", which would be a high entry barrier.

@Adirelle
Copy link

I have started a project around s6-rc for containers : https://github.com/Adirelle/s6rc-overlay

It started as a base image for building development images. I extracted the scripts and switched to just-containers/skaware for the binaries (thanks for the work). Right now, it is still in an early stage and lacks documentation but it should work.

But as @skarnet said, dependency management isn't easy.

@jjlorenzo
Copy link
Contributor

Hi any progress on this? thanks

@skarnet
Copy link
Contributor

skarnet commented Mar 24, 2019

I have a s6-frontend project in the making, which aims to integrate s6, s6-rc, and (when applicable, so not in containers) s6-linux-init together with a friendly interface and bundled policy for easy integration in distributions. It will be as lightweight as the rest of the stack, so usable in containers; however, I don't expect to release it before 2020 or 2021, so it doesn't help you for now.

@jjlorenzo
Copy link
Contributor

Thanks so much @skarnet, I have a very single integration almost completed of s6 and s6-rc for docker containers. I know that some people don't like the idea of fat containers, but they work for me and I'm really grateful for you job that allows me to implement what I want with a minimal footprint.

Comparing to s6-overlay, it doesn't contain any abstraction specific to containers. I've used heavily s6-linux-init to understand how to put the pieces together.

I plan to release my work(progress) asap in case someone want to take a look.

@xZero707
Copy link

Hey, @skarnet. Any update on s6-frontend?

@skarnet
Copy link
Contributor

skarnet commented Jan 11, 2022

Not yet - however, the new version of s6-overlay, v3, will be out very soon, and it includes s6-rc integration, so while waiting for s6-frontend, you'll be able to add dependencies to your services!

@xZero707
Copy link

Amazing! Thank you very much for getting back to us. Appreciate it!

@skarnet
Copy link
Contributor

skarnet commented Jan 20, 2022

v3.0.0.0 is out! (Source only at the moment; pre-built tarballs to come as soon as CI/CD is set up.)
You can now write your own services as s6-rc source definition directories in /etc/s6-overlay/s6-rc.d; to start them automatically, make them a part of the user bundle by creating empty files with the name of your services in /etc/s6-overlay/s6-rc.d/user/contents.d.
Enjoy!

@skarnet skarnet closed this as completed Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants