From 2d1af667b96d9f8d80a4aec217d8a1f48a946bb2 Mon Sep 17 00:00:00 2001 From: zachir Date: Thu, 6 Jun 2024 15:25:36 -0500 Subject: Add runit user services as well --- .gitignore | 3 +++ runit/conf/logind.conf | 54 +++++++++++++++++++++++++++++++++++++++ runit/sv/dunst/conf | 9 +++++++ runit/sv/dunst/log/run | 12 +++++++++ runit/sv/dunst/run | 5 ++++ runit/sv/mako/conf | 9 +++++++ runit/sv/mako/down | 0 runit/sv/mako/log/run | 12 +++++++++ runit/sv/mako/run | 5 ++++ runit/sv/mpd-mpris/conf | 9 +++++++ runit/sv/mpd-mpris/log/run | 12 +++++++++ runit/sv/mpd-mpris/run | 8 ++++++ runit/sv/mpd-notification/conf | 9 +++++++ runit/sv/mpd-notification/log/run | 12 +++++++++ runit/sv/mpd-notification/run | 9 +++++++ runit/sv/mpd/conf | 9 +++++++ runit/sv/mpd/log/run | 12 +++++++++ runit/sv/mpd/run | 8 ++++++ runit/sv/pipewire-pulse/conf | 12 +++++++++ runit/sv/pipewire-pulse/log/run | 12 +++++++++ runit/sv/pipewire-pulse/run | 12 +++++++++ runit/sv/wireplumber/conf | 12 +++++++++ runit/sv/wireplumber/log/run | 12 +++++++++ runit/sv/wireplumber/run | 12 +++++++++ 24 files changed, 269 insertions(+) create mode 100644 runit/conf/logind.conf create mode 100644 runit/sv/dunst/conf create mode 100755 runit/sv/dunst/log/run create mode 100755 runit/sv/dunst/run create mode 100644 runit/sv/mako/conf create mode 100644 runit/sv/mako/down create mode 100755 runit/sv/mako/log/run create mode 100755 runit/sv/mako/run create mode 100644 runit/sv/mpd-mpris/conf create mode 100755 runit/sv/mpd-mpris/log/run create mode 100755 runit/sv/mpd-mpris/run create mode 100644 runit/sv/mpd-notification/conf create mode 100755 runit/sv/mpd-notification/log/run create mode 100755 runit/sv/mpd-notification/run create mode 100644 runit/sv/mpd/conf create mode 100755 runit/sv/mpd/log/run create mode 100755 runit/sv/mpd/run create mode 100644 runit/sv/pipewire-pulse/conf create mode 100755 runit/sv/pipewire-pulse/log/run create mode 100755 runit/sv/pipewire-pulse/run create mode 100644 runit/sv/wireplumber/conf create mode 100755 runit/sv/wireplumber/log/run create mode 100755 runit/sv/wireplumber/run diff --git a/.gitignore b/.gitignore index 2a68078..2c4e417 100644 --- a/.gitignore +++ b/.gitignore @@ -210,6 +210,9 @@ Resonant DSP/ retroarch/ rncbc.org/ rtorrent/ +runit/sv/*/supervise +runit/sv/*/*/supervise +runit/runsvdir/* RVXX EXEX.settings RVXX v2/ RVXX v2.settings diff --git a/runit/conf/logind.conf b/runit/conf/logind.conf new file mode 100644 index 0000000..c31f33a --- /dev/null +++ b/runit/conf/logind.conf @@ -0,0 +1,54 @@ +# This file is part of elogind. +# +# elogind is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# Entries in this file show the compile time defaults. +# You can change settings by editing this file. +# Defaults can be restored by simply deleting this file. +# +# See logind.conf(5) for details. + +[Login] +KillUserProcesses=yes +#KillOnlyUsers= +#KillExcludeUsers=root +#InhibitDelayMaxSec=5 +#HandlePowerKey=poweroff +#HandleSuspendKey=suspend +#HandleHibernateKey=hibernate +#HandleLidSwitch=suspend +#HandleLidSwitchExternalPower=suspend +#HandleLidSwitchDocked=ignore +#PowerKeyIgnoreInhibited=no +#SuspendKeyIgnoreInhibited=no +#HibernateKeyIgnoreInhibited=no +#LidSwitchIgnoreInhibited=yes +#HoldoffTimeoutSec=30s +#IdleAction=ignore +#IdleActionSec=30min +#RuntimeDirectorySize=10% +#RuntimeDirectoryInodes=400k +#RemoveIPC=yes +#InhibitorsMax=8192 +#SessionsMax=8192 + +[Sleep] +#AllowSuspend=yes +#AllowHibernation=yes +#AllowSuspendThenHibernate=yes +#AllowHybridSleep=yes +#AllowPowerOffInterrupts=no +#BroadcastPowerOffInterrupts=yes +#AllowSuspendInterrupts=no +#BroadcastSuspendInterrupts=yes +#HandleNvidiaSleep=no +#SuspendState=mem standby freeze +#SuspendMode= +#HibernateState=disk +#HibernateMode=platform shutdown +#HybridSleepState=disk +#HybridSleepMode=suspend platform shutdown +#HibernateDelaySec=10800 diff --git a/runit/sv/dunst/conf b/runit/sv/dunst/conf new file mode 100644 index 0000000..88353ef --- /dev/null +++ b/runit/sv/dunst/conf @@ -0,0 +1,9 @@ +# -*- mode: sh; -*- + +# Additional command line arguments for pipewire(1). +OPTS='' + +# Setting this to 1 enables logging, any other value - disables. +LOGGING_ENABLE=1 +# The directory will be created for you, if logging is enabled. +LOG_DIR="$HOME/.local/var/log/dunst" diff --git a/runit/sv/dunst/log/run b/runit/sv/dunst/log/run new file mode 100755 index 0000000..09818ce --- /dev/null +++ b/runit/sv/dunst/log/run @@ -0,0 +1,12 @@ +#!/bin/sh + +[ -r ../conf ] && . ../conf + +if [ "${LOGGING_ENABLE}x" = "1x" ]; then + # Create the log directory if not exists. + [ -d "${LOG_DIR:-}" ] || mkdir -p "${LOG_DIR:-}" + + exec svlogd -tt "${LOG_DIR:-}" +else + exec chpst -b mpd-log-null cat >/dev/null +fi diff --git a/runit/sv/dunst/run b/runit/sv/dunst/run new file mode 100755 index 0000000..1c0aa88 --- /dev/null +++ b/runit/sv/dunst/run @@ -0,0 +1,5 @@ +#!/bin/sh + +[ -r ./conf ] && . ./conf + +exec dunst ${OPTS:-} 2>&1 diff --git a/runit/sv/mako/conf b/runit/sv/mako/conf new file mode 100644 index 0000000..6bb79d1 --- /dev/null +++ b/runit/sv/mako/conf @@ -0,0 +1,9 @@ +# -*- mode: sh; -*- + +# Additional command line arguments for pipewire(1). +OPTS='' + +# Setting this to 1 enables logging, any other value - disables. +LOGGING_ENABLE=1 +# The directory will be created for you, if logging is enabled. +LOG_DIR="$HOME/.local/var/log/mako" diff --git a/runit/sv/mako/down b/runit/sv/mako/down new file mode 100644 index 0000000..e69de29 diff --git a/runit/sv/mako/log/run b/runit/sv/mako/log/run new file mode 100755 index 0000000..09818ce --- /dev/null +++ b/runit/sv/mako/log/run @@ -0,0 +1,12 @@ +#!/bin/sh + +[ -r ../conf ] && . ../conf + +if [ "${LOGGING_ENABLE}x" = "1x" ]; then + # Create the log directory if not exists. + [ -d "${LOG_DIR:-}" ] || mkdir -p "${LOG_DIR:-}" + + exec svlogd -tt "${LOG_DIR:-}" +else + exec chpst -b mpd-log-null cat >/dev/null +fi diff --git a/runit/sv/mako/run b/runit/sv/mako/run new file mode 100755 index 0000000..266f521 --- /dev/null +++ b/runit/sv/mako/run @@ -0,0 +1,5 @@ +#!/bin/sh + +[ -r ./conf ] && . ./conf + +exec mako ${OPTS:-} 2>&1 diff --git a/runit/sv/mpd-mpris/conf b/runit/sv/mpd-mpris/conf new file mode 100644 index 0000000..7b43455 --- /dev/null +++ b/runit/sv/mpd-mpris/conf @@ -0,0 +1,9 @@ +# -*- mode: sh; -*- + +# Additional command line arguments for pipewire(1). +OPTS='-network unix' + +# Setting this to 1 enables logging, any other value - disables. +LOGGING_ENABLE=0 +# The directory will be created for you, if logging is enabled. +LOG_DIR="$HOME/.local/var/log/mpd-mpris" diff --git a/runit/sv/mpd-mpris/log/run b/runit/sv/mpd-mpris/log/run new file mode 100755 index 0000000..09818ce --- /dev/null +++ b/runit/sv/mpd-mpris/log/run @@ -0,0 +1,12 @@ +#!/bin/sh + +[ -r ../conf ] && . ../conf + +if [ "${LOGGING_ENABLE}x" = "1x" ]; then + # Create the log directory if not exists. + [ -d "${LOG_DIR:-}" ] || mkdir -p "${LOG_DIR:-}" + + exec svlogd -tt "${LOG_DIR:-}" +else + exec chpst -b mpd-log-null cat >/dev/null +fi diff --git a/runit/sv/mpd-mpris/run b/runit/sv/mpd-mpris/run new file mode 100755 index 0000000..3883e70 --- /dev/null +++ b/runit/sv/mpd-mpris/run @@ -0,0 +1,8 @@ +#!/bin/sh + +# Wait for the PipeWire Pulse daemon to start. +sv check "$HOME/.config/runit/sv/mpd" >/dev/null || exit 1 + +[ -r ./conf ] && . ./conf + +exec mpd-mpris ${OPTS:--network unix} 2>&1 diff --git a/runit/sv/mpd-notification/conf b/runit/sv/mpd-notification/conf new file mode 100644 index 0000000..e0b9aa3 --- /dev/null +++ b/runit/sv/mpd-notification/conf @@ -0,0 +1,9 @@ +# -*- mode: sh; -*- + +# Additional command line arguments for pipewire(1). +OPTS='' + +# Setting this to 1 enables logging, any other value - disables. +LOGGING_ENABLE=0 +# The directory will be created for you, if logging is enabled. +LOG_DIR="$HOME/.local/var/log/mpd-notification" diff --git a/runit/sv/mpd-notification/log/run b/runit/sv/mpd-notification/log/run new file mode 100755 index 0000000..09818ce --- /dev/null +++ b/runit/sv/mpd-notification/log/run @@ -0,0 +1,12 @@ +#!/bin/sh + +[ -r ../conf ] && . ../conf + +if [ "${LOGGING_ENABLE}x" = "1x" ]; then + # Create the log directory if not exists. + [ -d "${LOG_DIR:-}" ] || mkdir -p "${LOG_DIR:-}" + + exec svlogd -tt "${LOG_DIR:-}" +else + exec chpst -b mpd-log-null cat >/dev/null +fi diff --git a/runit/sv/mpd-notification/run b/runit/sv/mpd-notification/run new file mode 100755 index 0000000..a643d56 --- /dev/null +++ b/runit/sv/mpd-notification/run @@ -0,0 +1,9 @@ +#!/bin/sh + +# Wait for the PipeWire Pulse daemon to start. +sv check "$HOME/.config/runit/sv/mpd" >/dev/null || exit 1 +sv check "$HOME/.config/runit/sv/mako" >/dev/null || exit 1 + +[ -r ./conf ] && . ./conf + +exec mpd-notification ${OPTS:-} 2>&1 diff --git a/runit/sv/mpd/conf b/runit/sv/mpd/conf new file mode 100644 index 0000000..ca3a82f --- /dev/null +++ b/runit/sv/mpd/conf @@ -0,0 +1,9 @@ +# -*- mode: sh; -*- + +# Additional command line arguments for pipewire(1). +OPTS='' + +# Setting this to 1 enables logging, any other value - disables. +LOGGING_ENABLE=0 +# The directory will be created for you, if logging is enabled. +LOG_DIR="$HOME/.local/var/log/mpd" diff --git a/runit/sv/mpd/log/run b/runit/sv/mpd/log/run new file mode 100755 index 0000000..09818ce --- /dev/null +++ b/runit/sv/mpd/log/run @@ -0,0 +1,12 @@ +#!/bin/sh + +[ -r ../conf ] && . ../conf + +if [ "${LOGGING_ENABLE}x" = "1x" ]; then + # Create the log directory if not exists. + [ -d "${LOG_DIR:-}" ] || mkdir -p "${LOG_DIR:-}" + + exec svlogd -tt "${LOG_DIR:-}" +else + exec chpst -b mpd-log-null cat >/dev/null +fi diff --git a/runit/sv/mpd/run b/runit/sv/mpd/run new file mode 100755 index 0000000..b57d5ac --- /dev/null +++ b/runit/sv/mpd/run @@ -0,0 +1,8 @@ +#!/bin/sh + +# Wait for the PipeWire Pulse daemon to start. +sv check "$HOME/.config/runit/sv/pipewire-pulse" >/dev/null || exit 1 + +[ -r ./conf ] && . ./conf + +exec mpd --no-daemon --stderr ${OPTS:-} 2>&1 diff --git a/runit/sv/pipewire-pulse/conf b/runit/sv/pipewire-pulse/conf new file mode 100644 index 0000000..606eac5 --- /dev/null +++ b/runit/sv/pipewire-pulse/conf @@ -0,0 +1,12 @@ +# -*- mode: sh; -*- + +# Additional command line arguments for pipewire-pulse. +OPTS='' + +# Setting this to 1 enables logging, any other value - disables. +LOGGING_ENABLE=0 +# Set the pipewire log level. +# See: https://docs.pipewire.org/page_daemon.html#sec_logging +LOG_LEVEL=1 +# The directory will be created for you, if logging is enabled. +LOG_DIR="$HOME/.local/var/log/pipewire-pulse" diff --git a/runit/sv/pipewire-pulse/log/run b/runit/sv/pipewire-pulse/log/run new file mode 100755 index 0000000..ba8236e --- /dev/null +++ b/runit/sv/pipewire-pulse/log/run @@ -0,0 +1,12 @@ +#!/bin/sh + +[ -r ../conf ] && . ../conf + +if [ "${LOGGING_ENABLE}x" = "1x" ]; then + # Create the log directory if not exists. + [ -d "${LOG_DIR}" ] || mkdir -p "${LOG_DIR}" + + exec svlogd -tt "${LOG_DIR}" +else + exec chpst -b pipewire-pulse-log-null cat >/dev/null +fi diff --git a/runit/sv/pipewire-pulse/run b/runit/sv/pipewire-pulse/run new file mode 100755 index 0000000..0e43d6f --- /dev/null +++ b/runit/sv/pipewire-pulse/run @@ -0,0 +1,12 @@ +#!/bin/sh + +# Wait for the PipeWire Media Session daemon to start. +sv check "$HOME/.config/runit/sv/wireplumber" >/dev/null || exit 1 + +[ -r ./conf ] && . ./conf + +if [ "${LOGGING_ENABLE}x" = "1x" -a -n "${LOG_LEVEL}" ]; then + export PIPEWIRE_DEBUG="${LOG_LEVEL}" +fi + +exec pipewire-pulse ${OPTS:-} 2>&1 diff --git a/runit/sv/wireplumber/conf b/runit/sv/wireplumber/conf new file mode 100644 index 0000000..d712f03 --- /dev/null +++ b/runit/sv/wireplumber/conf @@ -0,0 +1,12 @@ +# -*- mode: sh; -*- + +# Additional command line arguments for wireplumber. +OPTS='' + +# Setting this to 1 enables logging, any other value - disables. +LOGGING_ENABLE=0 +# Set the wireplumber log level. +# See: https://pipewire.pages.freedesktop.org/wireplumber/daemon-logging.html +LOG_LEVEL=2 +# The directory will be created for you, if logging is enabled. +LOG_DIR="$HOME/.local/var/log/wireplumber" diff --git a/runit/sv/wireplumber/log/run b/runit/sv/wireplumber/log/run new file mode 100755 index 0000000..aa89d14 --- /dev/null +++ b/runit/sv/wireplumber/log/run @@ -0,0 +1,12 @@ +#!/bin/sh + +[ -r ../conf ] && . ../conf + +if [ "${LOGGING_ENABLE}x" == "1x" ]; then + # Create the log directory if not exists. + [ -d "${LOG_DIR}" ] || mkdir -p "${LOG_DIR}" + + exec svlogd -tt "${LOG_DIR}" +else + exec chpst -b wireplumber-log-null cat >/dev/null +fi diff --git a/runit/sv/wireplumber/run b/runit/sv/wireplumber/run new file mode 100755 index 0000000..5fb9edc --- /dev/null +++ b/runit/sv/wireplumber/run @@ -0,0 +1,12 @@ +#!/bin/sh + +# Wait for the PipeWire daemon to start. +sv check "$HOME/.config/runit/sv/pipewire" >/dev/null || exit 1 + +[ -r ./conf ] && . ./conf + +if [ "${LOGGING_ENABLE}x" = "1x" -a -n "${LOG_LEVEL}" ]; then + export WIREPLUMBER_DEBUG="${LOG_LEVEL}" +fi + +exec wireplumber ${OPTS:-} 2>&1 -- cgit v1.2.3