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

Compatibility for OpenRC to manage oxen service node #1395

Open
wants to merge 7 commits into
base: debian/sid
Choose a base branch
from

Conversation

Kreyren
Copy link

@Kreyren Kreyren commented Jan 21, 2021

Untitled

MAINTAINERS: Squash using GItHub.

Fixes: oxen-io/lokinet#1519
Transferred from: oxen-io/lokinet#1520

This should also make it compatible with devuan https://www.devuan.org/, consider adding release.

The test can be seen working in Kreyren#1

Fixes: oxen-io/lokinet#1519

Signed-off-by: Jacob Hrbek <kreyren@fsfe.org>
publish that to to he dockerhub

make the test to work on all branches with the file

Signed-off-by: Jacob Hrbek <kreyren@fsfe.org>
Signed-off-by: Jacob Hrbek <kreyren@fsfe.org>
Signed-off-by: Jacob Hrbek <kreyren@fsfe.org>
DESC="oxen-node"
DAEMON="/usr/bin/oxend"
DAEMON_ARGS="--non-interactive --config-file /etc/oxen/oxen.conf"
PIDFILE="/var/run/oxen-node-sysd2v.pid"
Copy link
Member

Choose a reason for hiding this comment

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

Any particular reason for this pid filename convention?

Copy link
Author

Choose a reason for hiding this comment

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

Not really.. This part was generated by the mentioned script

Copy link
Author

Choose a reason for hiding this comment

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

Where afaik the concern are systems with both systemd compatibility and openrc runner?

Copy link
Member

Choose a reason for hiding this comment

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

No, systemd doesn't write a pidfile, and AFAIK systemd will ignore a sysvinit script in /etc/init.d/whatever as long as a systemd service file is installed.

Copy link
Author

Choose a reason for hiding this comment

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

Seems sane for me to not use the sysd2v then.. Note script generated using sysd2v converter.

@jagerman
Copy link
Member

Currently this isn't installing this init script with the oxend package. I think it should be enough to rename it to debian/oxen-node.init to have debhelper automatically notice and install it into /etc/init.d/oxen-node.

@Kreyren Kreyren requested a review from jagerman January 30, 2021 21:21
@jagerman
Copy link
Member

jagerman commented Jan 30, 2021

Oops, that name wasn't quite right and it needed an addition to the rules file; I pushed a commit to fix it.

Can you give the resulting debs a try and let me know if it works?

https://oxen.rocks/jagerman/loki/devuan-ceres/deb-sid-20210130T222203Z-edb395a6d/

Edit: you should only need liboxen and oxend

@Kreyren
Copy link
Author

Kreyren commented Feb 1, 2021

@jagerman Installation LGTM:

https://gist.github.com/Kreyren/6af81ca6f52c7862564c27fb0c983e6c

But the startup fails:

root@d6ef928b56a6:/# service oxen-node status
oxend is not running ... failed!
root@d6ef928b56a6:/# service oxen-node start 
Starting oxen-node: oxend.
root@d6ef928b56a6:/# service oxen-node status
oxend is not running ... failed!
root@d6ef928b56a6:/# grep FATAL /var/log/oxen/oxen.log 
2021-02-01 11:29:21.805	    7fb5aeff9140	INFO	logging	contrib/epee/src/mlog.cpp:255	New log categories: *:WARNING,net:FATAL,net.http:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,serialization:FATAL,logging:INFO,msgwriter:INFO
2021-02-01 11:30:04.340	    7fed916b8140	INFO	logging	contrib/epee/src/mlog.cpp:255	New log categories: *:WARNING,net:FATAL,net.http:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,serialization:FATAL,logging:INFO,msgwriter:INFO
2021-02-01 11:30:04.342	    7fed916b8140	FATAL	net	contrib/epee/include/epee/net/abstract_tcp_server2.inl:958	Error starting server: Failed to bind IPv4 (set to required)

Which seems like configuration issue with the IP?

@Kreyren
Copy link
Author

Kreyren commented Feb 1, 2021

Quick dockerfile to reproduce the environment:

FROM debian:unstable

ENV DEBIAN_FRONTEND=noninteractive

RUN true \
	&& apt-get update \
	&& apt-get install --yes \
		lsb-release curl \
	&& curl -so /etc/apt/trusted.gpg.d/oxen.gpg https://deb.oxen.io/pub.gpg \
	&& echo "deb https://deb.oxen.io $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/oxen.list \
	&& apt-get update \
	&& apt-get install --yes openrc \
	&& curl -so "liboxen8.1.5_8.1.5-1_amd64.deb" "https://oxen.rocks/jagerman/loki/devuan-ceres/deb-sid-20210130T222203Z-edb395a6d/liboxen8.1.5_8.1.5-1_amd64.deb" \
	&& curl -so "oxend_8.1.5-1_amd64.deb" "https://oxen.rocks/jagerman/loki/devuan-ceres/deb-sid-20210130T222203Z-edb395a6d/oxend_8.1.5-1_amd64.deb" \
	&& apt-get install --yes ./liboxen8.1.5_8.1.5-1_amd64.deb ./oxend_8.1.5-1_amd64.deb \
	&& apt-get autoremove -y \
  && rm -rf /var/lib/apt/lists/* \
	&& { service oxen-node status || true ;} \
	&& { service oxen-node start || true ;} \
	&& { service oxen-node status || true ;} \
	&& { service oxen-node stop || true ;} \
	&& { service oxen-node status || true ;}

@jagerman
Copy link
Member

jagerman commented Feb 1, 2021

That error generally means that an oxend is already running, bound to the p2p port. I suspect it is running already here via systemd?

@Kreyren
Copy link
Author

Kreyren commented Feb 3, 2021

That error generally means that an oxend is already running, bound to the p2p port. I suspect it is running already here via systemd?

It was running, but killing the oxend didn't help

https://gist.githubusercontent.com/Kreyren/ba2f330b4a18288f3b7f064c1bb26a86/raw/71e2770b37ff322543ec1ce1becb235b932d8834/gistfile1.txt

@Kreyren
Copy link
Author

Kreyren commented Feb 3, 2021

FWIW that looks to me as issue not relevant to the proposed OpenRC integration.

@PopeNobody
Copy link

Quick dockerfile to reproduce the environment:

FROM debian:unstable

ENV DEBIAN_FRONTEND=noninteractive

RUN true \
	&& apt-get update \
	&& apt-get install --yes \
		lsb-release curl \
	&& curl -so /etc/apt/trusted.gpg.d/oxen.gpg https://deb.oxen.io/pub.gpg \
	&& echo "deb https://deb.oxen.io $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/oxen.list \
	&& apt-get update \
	&& apt-get install --yes openrc \
	&& curl -so "liboxen8.1.5_8.1.5-1_amd64.deb" "https://oxen.rocks/jagerman/loki/devuan-ceres/deb-sid-20210130T222203Z-edb395a6d/liboxen8.1.5_8.1.5-1_amd64.deb" \
	&& curl -so "oxend_8.1.5-1_amd64.deb" "https://oxen.rocks/jagerman/loki/devuan-ceres/deb-sid-20210130T222203Z-edb395a6d/oxend_8.1.5-1_amd64.deb" \
	&& apt-get install --yes ./liboxen8.1.5_8.1.5-1_amd64.deb ./oxend_8.1.5-1_amd64.deb \
	&& apt-get autoremove -y \
  && rm -rf /var/lib/apt/lists/* \
	&& { service oxen-node status || true ;} \
	&& { service oxen-node start || true ;} \
	&& { service oxen-node status || true ;} \
	&& { service oxen-node stop || true ;} \
	&& { service oxen-node status || true ;}

This is failing on the install of the downloaded archives, perhaps they are signed with a key I don't have?

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.

3 participants