From 4cb693e606dc2f84560c5c88411a4411090bc3e9 Mon Sep 17 00:00:00 2001 From: x Date: Thu, 1 Jan 2026 11:29:14 +0000 Subject: [PATCH] contrib: Clean up initscripts --- contrib/init/darkfid.confd | 1 - contrib/init/darkfid.initd | 37 ------------------- contrib/init/faucetd.confd | 1 - contrib/init/faucetd.initd | 37 ------------------- contrib/init/lilith.confd | 1 - contrib/init/lilith.initd | 37 ------------------- contrib/init/openrc/README.md | 5 +++ contrib/init/openrc/darkfid.init | 13 +++++++ contrib/{runit-init => init/runit}/README.md | 1 - .../runit}/darkirc/log/run | 0 .../{runit-init => init/runit}/darkirc/run | 0 .../{runit-init => init/runit}/taud/log/run | 0 contrib/{runit-init => init/runit}/taud/run | 0 contrib/init/taud.confd | 1 - contrib/init/taud.initd | 37 ------------------- contrib/init/wikid.confd | 1 - contrib/init/wikid.initd | 37 ------------------- contrib/license.header | 2 +- 18 files changed, 19 insertions(+), 192 deletions(-) delete mode 100644 contrib/init/darkfid.confd delete mode 100644 contrib/init/darkfid.initd delete mode 100644 contrib/init/faucetd.confd delete mode 100644 contrib/init/faucetd.initd delete mode 100644 contrib/init/lilith.confd delete mode 100644 contrib/init/lilith.initd create mode 100644 contrib/init/openrc/README.md create mode 100644 contrib/init/openrc/darkfid.init rename contrib/{runit-init => init/runit}/README.md (99%) rename contrib/{runit-init => init/runit}/darkirc/log/run (100%) rename contrib/{runit-init => init/runit}/darkirc/run (100%) rename contrib/{runit-init => init/runit}/taud/log/run (100%) rename contrib/{runit-init => init/runit}/taud/run (100%) delete mode 100644 contrib/init/taud.confd delete mode 100644 contrib/init/taud.initd delete mode 100644 contrib/init/wikid.confd delete mode 100644 contrib/init/wikid.initd diff --git a/contrib/init/darkfid.confd b/contrib/init/darkfid.confd deleted file mode 100644 index 8492bab40..000000000 --- a/contrib/init/darkfid.confd +++ /dev/null @@ -1 +0,0 @@ -USER="darkfid" diff --git a/contrib/init/darkfid.initd b/contrib/init/darkfid.initd deleted file mode 100644 index 5553e47fb..000000000 --- a/contrib/init/darkfid.initd +++ /dev/null @@ -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 $? -} diff --git a/contrib/init/faucetd.confd b/contrib/init/faucetd.confd deleted file mode 100644 index ed4e586c8..000000000 --- a/contrib/init/faucetd.confd +++ /dev/null @@ -1 +0,0 @@ -USER="faucetd" diff --git a/contrib/init/faucetd.initd b/contrib/init/faucetd.initd deleted file mode 100644 index cd407dfe5..000000000 --- a/contrib/init/faucetd.initd +++ /dev/null @@ -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 $? -} diff --git a/contrib/init/lilith.confd b/contrib/init/lilith.confd deleted file mode 100644 index c1660eb9e..000000000 --- a/contrib/init/lilith.confd +++ /dev/null @@ -1 +0,0 @@ -USER="lilith" diff --git a/contrib/init/lilith.initd b/contrib/init/lilith.initd deleted file mode 100644 index 96059c74d..000000000 --- a/contrib/init/lilith.initd +++ /dev/null @@ -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 $? -} diff --git a/contrib/init/openrc/README.md b/contrib/init/openrc/README.md new file mode 100644 index 000000000..a4e80870d --- /dev/null +++ b/contrib/init/openrc/README.md @@ -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. diff --git a/contrib/init/openrc/darkfid.init b/contrib/init/openrc/darkfid.init new file mode 100644 index 000000000..d29b832ea --- /dev/null +++ b/contrib/init/openrc/darkfid.init @@ -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 +} diff --git a/contrib/runit-init/README.md b/contrib/init/runit/README.md similarity index 99% rename from contrib/runit-init/README.md rename to contrib/init/runit/README.md index fc826b060..e0f6a5c57 100644 --- a/contrib/runit-init/README.md +++ b/contrib/init/runit/README.md @@ -62,4 +62,3 @@ the logger command. You can test logger output like this: ```bash $ vlogger -t darky -p daemon hello123 ``` - diff --git a/contrib/runit-init/darkirc/log/run b/contrib/init/runit/darkirc/log/run similarity index 100% rename from contrib/runit-init/darkirc/log/run rename to contrib/init/runit/darkirc/log/run diff --git a/contrib/runit-init/darkirc/run b/contrib/init/runit/darkirc/run similarity index 100% rename from contrib/runit-init/darkirc/run rename to contrib/init/runit/darkirc/run diff --git a/contrib/runit-init/taud/log/run b/contrib/init/runit/taud/log/run similarity index 100% rename from contrib/runit-init/taud/log/run rename to contrib/init/runit/taud/log/run diff --git a/contrib/runit-init/taud/run b/contrib/init/runit/taud/run similarity index 100% rename from contrib/runit-init/taud/run rename to contrib/init/runit/taud/run diff --git a/contrib/init/taud.confd b/contrib/init/taud.confd deleted file mode 100644 index 987f51a53..000000000 --- a/contrib/init/taud.confd +++ /dev/null @@ -1 +0,0 @@ -USER="taud" diff --git a/contrib/init/taud.initd b/contrib/init/taud.initd deleted file mode 100644 index 77a858e6d..000000000 --- a/contrib/init/taud.initd +++ /dev/null @@ -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 $? -} diff --git a/contrib/init/wikid.confd b/contrib/init/wikid.confd deleted file mode 100644 index 55460e652..000000000 --- a/contrib/init/wikid.confd +++ /dev/null @@ -1 +0,0 @@ -USER="wiki" diff --git a/contrib/init/wikid.initd b/contrib/init/wikid.initd deleted file mode 100644 index 63418c5fe..000000000 --- a/contrib/init/wikid.initd +++ /dev/null @@ -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 $? -} diff --git a/contrib/license.header b/contrib/license.header index 43408be34..7a5486073 100644 --- a/contrib/license.header +++ b/contrib/license.header @@ -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