diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /app-misc/conmux/files |
reinit the tree, so we can have metadata
Diffstat (limited to 'app-misc/conmux/files')
-rw-r--r-- | app-misc/conmux/files/conmux-registry.confd | 4 | ||||
-rw-r--r-- | app-misc/conmux/files/conmux-registry.initd | 31 | ||||
-rw-r--r-- | app-misc/conmux/files/conmux.confd | 14 | ||||
-rw-r--r-- | app-misc/conmux/files/conmux.initd | 39 |
4 files changed, 88 insertions, 0 deletions
diff --git a/app-misc/conmux/files/conmux-registry.confd b/app-misc/conmux/files/conmux-registry.confd new file mode 100644 index 000000000000..ac7bd8c20d5e --- /dev/null +++ b/app-misc/conmux/files/conmux-registry.confd @@ -0,0 +1,4 @@ +# Port for Registry listener +CONMAX_REGISTRY_PORT="63000" +# Log file +CONMAX_REGISTRY_LOG="/var/log/conmux-registry.log" diff --git a/app-misc/conmux/files/conmux-registry.initd b/app-misc/conmux/files/conmux-registry.initd new file mode 100644 index 000000000000..3e3179a224ab --- /dev/null +++ b/app-misc/conmux/files/conmux-registry.initd @@ -0,0 +1,31 @@ +#!/sbin/openrc-run +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +checkconfig() { + # Set sane defaults + if [ -z ${CONMUX_REGISTRY_PORT} ]; then + CONMUX_REGISTRY_PORT="63000" + fi + if [ -z ${CONMUX_REGISTRY_LOG} ]; then + CONMUX_REGISTRY_LOG="/var/log/conmux-registry.log" + fi +} + +start() { + checkconfig + # Make sure conmux finds everything + export PATH="${PATH}:/usr/share/conmux/drivers:/usr/share/conmux/helpers" + ebegin "Starting conmux registry daemon" + [ -e ${CONMUX_REGISTRY_LOG} ] && rm ${CONMUX_REGISTRY_LOG} + touch ${CONMUX_REGISTRY_LOG} + start-stop-daemon -b -m --start -p /run/conmux-registry.pid \ + --exec /usr/sbin/conmux-registry -- ${CONMUX_REGISTRY_PORT} \ + ${CONMUX_REGISTRY_LOG} +} + +stop() { + ebegin "Stopping conmux registry daemon" + start-stop-daemon --stop --pidfile /run/conmux-registry.pid + eend $? +} diff --git a/app-misc/conmux/files/conmux.confd b/app-misc/conmux/files/conmux.confd new file mode 100644 index 000000000000..7f983c9ac409 --- /dev/null +++ b/app-misc/conmux/files/conmux.confd @@ -0,0 +1,14 @@ +# Configuration file +# It should point to a valid device configuration file +# eg CONMUX_CONFIG="/etc/conmux/deviceA.cf +# +# See https://github.com/autotest/autotest/wiki/Conmux-Howto +# and https://github.com/autotest/autotest/wiki/Conmux-OriginalDocumentation +# for examples +# +# Default value is empty so the init script will fail and force you +# to create a new config +# +CONMUX_CONFIG="" +# Log file +CONMUX_LOG="/var/log/conmux.log" diff --git a/app-misc/conmux/files/conmux.initd b/app-misc/conmux/files/conmux.initd new file mode 100644 index 000000000000..b74fd28b969c --- /dev/null +++ b/app-misc/conmux/files/conmux.initd @@ -0,0 +1,39 @@ +#!/sbin/openrc-run +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + use net + need conmux-registry +} + +checkconfig() { + if [ ! -f ${CONMUX_CONFIG} ]; then + eerror "" + eerror "No conmux configuration file was found!" + eerror "Please read the conmux README file." + eerror "" + return 1 + fi + # Sane default + if [ -z ${CONMUX_LOG} ]; then + CONMUX_LOG="/var/log/conmux.log" + fi + return 0 +} + +start() { + checkconfig || exit 1 + # Make sure conmux finds everything + export PATH="${PATH}:/usr/share/conmux/drivers:/usr/share/conmux/helpers" + ebegin "Starting conmux daemon" + start-stop-daemon -m -b --start -1 ${CONMUX_LOG} \ + -2 ${CONMUX_LOG} -p /run/${SVCNAME}.pid \ + --exec /usr/sbin/conmux -- ${CONMUX_CONFIG} +} + +stop() { + ebegin "Stopping conmux daemon" + start-stop-daemon --stop --pidfile /run/${SVCNAME}.pid + eend $? +} |