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

Create systemd socket activation. #81

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Kubuxu
Copy link

@Kubuxu Kubuxu commented Nov 17, 2015

In future the socket activation IMHO should be standard way of starting
cjdns. Thanks to that configurators don't have to know anything about
cjdroute placement to start cjdns and it makes starting it much much easier,

I would like to hear your input about socket activation in general.

In this scheme configurator would connect /run/cjdns/cjdns.socket UNIX socket which causes new instance of cjdns to start. It then has to send initial configuration (admin info and private key) and switch to admin port.

This is experimental and needs yet to be tested. (possibly by allowing current configurator to be stand-alone).

Implementation for initd systems is possible (inetd).

@Kubuxu Kubuxu force-pushed the hype/socket-activ branch 2 times, most recently from 3f12e84 to a31f27b Compare November 17, 2015 15:55
@kyrias
Copy link

kyrias commented Nov 17, 2015

using /usr/bin/env is completely superfluous since just cjdroute would look it up according to $PATH anyway.

@@ -0,0 +1,4 @@
#!/usr/bin/env sh
PIPE_NAME="client-core-$(tr -cd 'a-f0-9' < /dev/urandom | head -c 8)"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonder if it'd be nicer to use openssl rand -hex 8 instead of shelling out to two utils?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both those utils are available in basic installation.
Either way I will be swapping this script with a C program.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's part of the systemd stuff, it should be in contrib/systemd/

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's to support inetd-style socket activation, so not systemd-specific.

In future the socket activation IMHO should be standard way of starting
cjdns. Thanks to that configurators don't have to know anything about
cjdroute placement to start cjdns.
This solves netcat incompatiblity issues.
@Kubuxu
Copy link
Author

Kubuxu commented Dec 10, 2015

The trap was reworked to be C program. I'd need some external configuration to test it (or I might have to start writing my own).

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

Successfully merging this pull request may close these issues.

2 participants