mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-06 21:34:00 -05:00
contrib: Clean up initscripts
This commit is contained in:
@@ -1 +0,0 @@
|
||||
USER="darkfid"
|
||||
@@ -1,37 +0,0 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2023 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
depend() {
|
||||
use net
|
||||
}
|
||||
|
||||
start() {
|
||||
PWHOME="$(getent passwd $USER | awk -F: '{ print $6 }')"
|
||||
|
||||
ebegin "Starting darkfid"
|
||||
env TERM="xterm" \
|
||||
start-stop-daemon \
|
||||
--start \
|
||||
--make-pidfile \
|
||||
--pidfile /var/run/darkfid.pid \
|
||||
--background \
|
||||
--user $USER \
|
||||
--env HOME="${PWHOME:-/home/$USER}" \
|
||||
--name darkfid \
|
||||
--exec /usr/bin/screen -- \
|
||||
-L -Logfile /home/darkfid/screenlog.0 \
|
||||
-d -m -S darkfid /usr/local/bin/darkfid
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping darkfid"
|
||||
# Because we've daemonized with screen, we need to replace the PID file
|
||||
# with the real PID of the program
|
||||
pgrep -P $(cat /var/run/darkfid.pid) > /var/run/darkfid.pid
|
||||
|
||||
start-stop-daemon --stop --signal 15 \
|
||||
--pidfile /var/run/darkfid.pid
|
||||
eend $?
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
USER="faucetd"
|
||||
@@ -1,37 +0,0 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2023 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
depend() {
|
||||
use net
|
||||
}
|
||||
|
||||
start() {
|
||||
PWHOME="$(getent passwd $USER | awk -F: '{ print $6 }')"
|
||||
|
||||
ebegin "Starting faucetd"
|
||||
env TERM="xterm" \
|
||||
start-stop-daemon \
|
||||
--start \
|
||||
--make-pidfile \
|
||||
--pidfile /var/run/faucetd.pid \
|
||||
--background \
|
||||
--user $USER \
|
||||
--env HOME="${PWHOME:-/home/$USER}" \
|
||||
--name faucetd \
|
||||
--exec /usr/bin/screen -- \
|
||||
-L -Logfile /home/faucetd/screenlog.0 \
|
||||
-d -m -S faucetd /usr/local/bin/faucetd
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping faucetd"
|
||||
# Because we've daemonized with screen, we need to replace the PID file
|
||||
# with the real PID of the program
|
||||
pgrep -P $(cat /var/run/faucetd.pid) > /var/run/faucetd.pid
|
||||
|
||||
start-stop-daemon --stop --signal 15 \
|
||||
--pidfile /var/run/faucetd.pid
|
||||
eend $?
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
USER="lilith"
|
||||
@@ -1,37 +0,0 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2023 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
depend() {
|
||||
use net
|
||||
}
|
||||
|
||||
start() {
|
||||
PWHOME="$(getent passwd $USER | awk -F: '{ print $6 }')"
|
||||
|
||||
ebegin "Starting lilith"
|
||||
env TERM="xterm" DARKFI_LOG="/tmp/lilith.log" LOG_TARGETS="!MessageSubsystem::notify" \
|
||||
start-stop-daemon \
|
||||
--start \
|
||||
--make-pidfile \
|
||||
--pidfile /var/run/lilith.pid \
|
||||
--background \
|
||||
--user $USER \
|
||||
--env HOME="${PWHOME:-/home/$USER}" \
|
||||
--name lilith \
|
||||
--exec /usr/bin/screen -- \
|
||||
-L -Logfile /home/lilith/screenlog.0 \
|
||||
-d -m -S lilith /usr/local/bin/lilith
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping lilith"
|
||||
# Because we've daemonized with screen, we need to replace the PID file
|
||||
# with the real PID of the program
|
||||
pgrep -P $(cat /var/run/lilith.pid) > /var/run/lilith.pid
|
||||
|
||||
start-stop-daemon --stop --signal 15 \
|
||||
--pidfile /var/run/lilith.pid
|
||||
eend $?
|
||||
}
|
||||
5
contrib/init/openrc/README.md
Normal file
5
contrib/init/openrc/README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# OpenRC service files
|
||||
|
||||
These init files can be used with OpenRC.
|
||||
|
||||
They should be applicable for any daemon, just modify the names.
|
||||
13
contrib/init/openrc/darkfid.init
Normal file
13
contrib/init/openrc/darkfid.init
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/sbin/openrc-run
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
description="darkfid daemon"
|
||||
|
||||
command="/usr/bin/darkfid"
|
||||
command_background=true
|
||||
command_user="${USER}"
|
||||
pidfile="/run/darkfid.pid"
|
||||
|
||||
depend() {
|
||||
use net
|
||||
}
|
||||
@@ -62,4 +62,3 @@ the logger command. You can test logger output like this:
|
||||
```bash
|
||||
$ vlogger -t darky -p daemon hello123
|
||||
```
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
USER="taud"
|
||||
@@ -1,37 +0,0 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2023 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
depend() {
|
||||
use net
|
||||
}
|
||||
|
||||
start() {
|
||||
PWHOME="$(getent passwd $USER | awk -F: '{ print $6 }')"
|
||||
|
||||
ebegin "Starting taud"
|
||||
env TERM="xterm" \
|
||||
start-stop-daemon \
|
||||
--start \
|
||||
--make-pidfile \
|
||||
--pidfile /var/run/taud.pid \
|
||||
--background \
|
||||
--user $USER \
|
||||
--env HOME="${PWHOME:-/home/$USER}" \
|
||||
--name taud \
|
||||
--exec /usr/bin/screen -- \
|
||||
-L -Logfile /home/taud/screenlog.0 \
|
||||
-d -m -S taud /usr/local/bin/taud
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping taud"
|
||||
# Because we've daemonized with screen, we need to replace the PID file
|
||||
# with the real PID of the program
|
||||
pgrep -P $(cat /var/run/taud.pid) > /var/run/taud.pid
|
||||
|
||||
start-stop-daemon --stop --signal 15 \
|
||||
--pidfile /var/run/taud.pid
|
||||
eend $?
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
USER="wiki"
|
||||
@@ -1,37 +0,0 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2023 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
depend() {
|
||||
use net
|
||||
}
|
||||
|
||||
start() {
|
||||
PWHOME="$(getent passwd $USER | awk -F: '{ print $6 }')"
|
||||
|
||||
ebegin "Starting darkwikid"
|
||||
env TERM="xterm" \
|
||||
start-stop-daemon \
|
||||
--start \
|
||||
--make-pidfile \
|
||||
--pidfile /var/run/darkwikid.pid \
|
||||
--background \
|
||||
--user $USER \
|
||||
--env HOME="${PWHOME:-/home/$USER}" \
|
||||
--name darkwikid \
|
||||
--exec /usr/bin/screen -- \
|
||||
-L -Logfile /home/wiki/screenlog.0 \
|
||||
-d -m -S darkwikid /usr/local/bin/darkwikid
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping darkwikid"
|
||||
# Because we've daemonized with screen, we need to replace the PID file
|
||||
# with the real PID of the program
|
||||
pgrep -P $(cat /var/run/darkwikid.pid) > /var/run/darkwikid.pid
|
||||
|
||||
start-stop-daemon --stop --signal 15 \
|
||||
--pidfile /var/run/darkwikid.pid
|
||||
eend $?
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is part of DarkFi (https://dark.fi)
|
||||
*
|
||||
* Copyright (C) 2020-2025 Dyne.org foundation
|
||||
* Copyright (C) 2020-2026 Dyne.org foundation
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
|
||||
Reference in New Issue
Block a user