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

Working runit services #1

Merged
merged 1 commit into from Feb 25, 2015
Merged

Working runit services #1

merged 1 commit into from Feb 25, 2015

Conversation

Toilal
Copy link

@Toilal Toilal commented Feb 23, 2015

Hi @chrert, thanks for working on mailinabox dockerization.

I'm on it too, and your Dockerfile seems very good as it should fix issues i've encoutered with services.

  1. The removall of upstart doesn't work because runit depends on it.
    2 ) RUN rm -f /tmp/mailinabox_apt_package_list.txt is not required, because it will be removed at the very last step of the Dockerfile.

I'll build this and give it a try on my own server.

@Toilal
Copy link
Author

Toilal commented Feb 23, 2015

When I start to run the container, it fails :

*** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
*** Running /etc/rc.local...
*** Booting runit daemon...
*** Runit started as PID 8
*** Runit exited with status 127
sh: 1: /usr/bin/sv: not found
sh: 1: /usr/bin/sv: not found
*** Killing all processes...

You may have received mail notifications about other errors, please ignore them, it was wrong... I had commented RUN DEBIAN_FRONTEND=noninteractive apt-get remove -y upstart, so many services were starting twice ...

@Toilal
Copy link
Author

Toilal commented Feb 23, 2015

I don't think it possible to remove upstart package, because runit depends on it. Removing upstart also removes runit.

@Toilal
Copy link
Author

Toilal commented Feb 23, 2015

Maybe you could simply remove init/init.d scripts that have runit script.

@chrert
Copy link
Owner

chrert commented Feb 23, 2015

Thanks for your contribution.
I will have a look at it this weekend and hopefuly I get everything working soon!

@Toilal
Copy link
Author

Toilal commented Feb 23, 2015

Thanks, i'll keep working on this branch, I start to understand how the whole thing works :)

@Toilal
Copy link
Author

Toilal commented Feb 24, 2015

It's working, but it still need some work on bind9 runit script.

FAILED: sv restart bind9
-----------------------------------------
timeout: down: bind9: 1s, normally up, want up
-----------------------------------------

There's also a problem with openkdmi :

named: error while loading shared libraries: liblwres.so.90: cannot open shared object file: Permission denied
opendkim: smfi_opensocket() failed
named: error while loading shared libraries: liblwres.so.90: cannot open shared object file: Permission denied
opendkim: smfi_opensocket() failed

Also, instead of using sv to control runit service, it would be better create symlink /usr/bin/sv to /etc/init.d/<service> for each runit service, see What about LSB init scripts compliance in runit FAQ.

Another minor issue : Some runit services are created before required files are installed by setup script. This floods the docker container logs of services failing to start for various reason.

@chrert
Copy link
Owner

chrert commented Feb 24, 2015

I wasn't aware of the fact that runit supports lsb init scripts. I think that will solve most of the issues I had!

@Toilal
Copy link
Author

Toilal commented Feb 24, 2015

@chrert sorry, but it doesn't really support lsb init scripts. Creating the symlink only make service service_name start or /etc/init.d/service_name start works by redirecting to sv command.

Writing custom scripts for runit is still required.

@Toilal
Copy link
Author

Toilal commented Feb 24, 2015

There's an issue when running docker container with --privileged flag. bind9 can't run, because of a permission issue.

This can be reproduced without runing the startup script, just after creating the container.

root@1bb894097afe:/# named --help
named: error while loading shared libraries: liblwres.so.90: cannot open shared object file: Permission denied

So i'll sugest to remove the --privileged flag for now ...

I think this is related to moby/moby#7318, and there are other issues when searching for error while loading shared libraries in docker repository.

@Toilal Toilal changed the title Small fixes Working runit services Feb 24, 2015
@chrert
Copy link
Owner

chrert commented Feb 25, 2015

@Toilal That looks very good! Thanks for your work!
There are still some issues: Sometimes not all services are started on restart. I will have a look at that!

As soon as everything is working, I will make a PR to the main repo!

chrert added a commit that referenced this pull request Feb 25, 2015
Working runit services
@chrert chrert merged commit c2c1364 into chrert:docker Feb 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants