forked from monero-project/monero
-
Notifications
You must be signed in to change notification settings - Fork 119
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
Kreyren
wants to merge
7
commits into
oxen-io:debian/sid
Choose a base branch
from
Kreyren:devuan/ceres
base: debian/sid
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d339515
Added openrc service file for oxen-node
Kreyren 102ad27
Remove unused docker file bcs i am lazy to implement management to
Kreyren 459c54b
Fix syntax err
Kreyren d149b02
Add shellcheck lint for the service file
Kreyren f80d52a
Update and rename oxen-node.openrc to oxen-node.init
Kreyren edb395a
Properly install init
jagerman 56d3544
Added the pre-seed so that apt is not askingFor IP
Kreyren File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
|
||
name: Test for OpenRC script 'oxen-node' | ||
on: | ||
pull_request: | ||
types: [synchronize, opened, reopened, ready_for_review] | ||
paths: | ||
- 'debian/oxen-node.openrc' | ||
env: | ||
CLICOLOR_FORCE: 1 | ||
jobs: | ||
ci: | ||
runs-on: ubuntu-latest | ||
container: debian:unstable | ||
steps: | ||
- name: Installing dependencies.. | ||
run: | | ||
apt-get update | ||
apt-get install curl lsb-release --yes | ||
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 openrc oxen-service-node --yes | ||
- name: Pulling git dir.. | ||
uses: actions/checkout@v2 | ||
- name: Testing the service file.. | ||
run: | | ||
cp "$GITHUB_WORKSPACE/debian/oxen-node.openrc" /etc/init.d/oxen-node | ||
service oxen-node status || true | ||
service oxen-node start | ||
service oxen-node status | ||
service oxen-node stop | ||
service oxen-node status || true | ||
shellcheck: | ||
runs-on: ubuntu-latest | ||
container: debian:unstable | ||
steps: | ||
- name: Installing dependencies.. | ||
run: | | ||
apt-get update | ||
apt-get install shellcheck --yes | ||
- name: Pulling git dir.. | ||
uses: actions/checkout@v2 | ||
- name: Lint the service file.. | ||
run: | | ||
shellcheck --external-sources --shell=sh "$GITHUB_WORKSPACE/debian/oxen-node.openrc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/sh | ||
# shellcheck shell=sh # Written to comply with IEEE Std 1003.1-2017 | ||
# shellcheck disable=SC2034 # Krey: OpenRC is using variables that are not expected to be set | ||
# Generated by sysd2v v0.3 -- http://www.trek.eu.org/devel/sysd2v | ||
# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing. | ||
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then | ||
set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script | ||
fi | ||
### BEGIN INIT INFO | ||
# Provides: oxen-node | ||
# Required-Start: $remote_fs | ||
# Required-Stop: $remote_fs | ||
# Should-Start: $network | ||
# Should-Stop: $network | ||
# X-Start-Before: loki-storage | ||
# X-Stop-After: loki-storage | ||
# Default-Start: 2 3 4 5 | ||
# Default-Stop: 0 1 6 | ||
# Description: Oxen network node | ||
### END INIT INFO | ||
set -a | ||
TERM=xterm | ||
set +a | ||
|
||
DESC="oxen-node" | ||
DAEMON="/usr/bin/oxend" | ||
DAEMON_ARGS="--non-interactive --config-file /etc/oxen/oxen.conf" | ||
PIDFILE="/var/run/oxen-node-sysd2v.pid" | ||
START_ARGS="--user _loki --chuid _loki --chdir /var/lib/oxen --background --make-pidfile --notify-await" # --notify-timeout infinity | ||
STOP_ARGS="--user _loki" | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 usingsysd2v
converter.