summaryrefslogtreecommitdiff
path: root/dev-perl/Mail-SRS/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-perl/Mail-SRS/files
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-perl/Mail-SRS/files')
-rw-r--r--dev-perl/Mail-SRS/files/srsd.conf56
-rw-r--r--dev-perl/Mail-SRS/files/srsd.init53
2 files changed, 109 insertions, 0 deletions
diff --git a/dev-perl/Mail-SRS/files/srsd.conf b/dev-perl/Mail-SRS/files/srsd.conf
new file mode 100644
index 000000000000..6d40344866fb
--- /dev/null
+++ b/dev-perl/Mail-SRS/files/srsd.conf
@@ -0,0 +1,56 @@
+# conf.d file for srsd
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# Options available (copied from the man page):
+#
+# --separator
+# String, specified at most once. Defaults to $SRSSEP ("=").
+# Specify the initial separator for the SRS address. See Mail::SRS for
+# details.
+#
+SRSD_SEPARATOR='='
+
+#
+# --secret
+# String, may be specified multiple times, at least one of --secret or
+# --secretfile must be specified.
+#
+# --secret will specify a primary secret and override --secretfile if both are
+# specified. However, secrets read from --secretfile will still be used for
+# decoding if both are specified.
+#
+# Specify an SRS secret. The first specified secret is used for encoding. All
+# secrets are used for decoding.
+#
+# This is a dummy value. Change it to something more relevant.
+SRSD_SECRET_STRING='mysecretstring'
+
+#
+# --secretfile
+# String, specified at most once, at least one of --secret or --secretfile must
+# be specified.
+#
+# A file to read for secrets. Secrets are specified once per line. The first
+# specified secret is used for encoding. Secrets are written one per line. Blank
+# lines and lines starting with a # are ignored. If --secret is not given, then
+# the secret file must be nonempty.
+#
+# This is a dummy value. Change the value as you see fit.
+# SRSD_SECRET_FILE='/etc/mysecretfile'
+
+#
+# --hashlength
+# Integer, may be specified at most once, defaults to 4.
+SRSD_HASHLENGHT=4
+
+#
+# Note: You cannot use both --secret and --secretfile options.
+# The former will override the latter.
+
+# Stick options you wish to use in SRSD_OPTS
+SRSD_OPTS="
+--secret=${SRSD_SECRET_STRING}
+--separator=${SRSD_SEPARATOR}
+--hashlength=${SRSD_HASHLENGHT}
+"
diff --git a/dev-perl/Mail-SRS/files/srsd.init b/dev-perl/Mail-SRS/files/srsd.init
new file mode 100644
index 000000000000..9862a29da2f9
--- /dev/null
+++ b/dev-perl/Mail-SRS/files/srsd.init
@@ -0,0 +1,53 @@
+#!/sbin/openrc-run
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+pidfile="/var/run/srsd.pid"
+command="/usr/bin/srsd"
+command_args="${SRSD_OPTS}"
+
+depend() {
+ use logger
+}
+
+start_pre() {
+ if [[ ! -z ${SRSD_SECRET_FILE} ]]; then
+ # check for secret file
+ checkpath --file --owner root:root --mode 0644 ${SRSD_SECRET_FILE}
+
+ # srsd complains if the secret file is empty
+ # check for characters in it
+ grep -q '.' ${SRSD_SECRET_FILE}
+
+ # grep returns 0 if a match has been found
+ # 1 otherwise
+ local retval=$?
+ if [[ $retval -ne 0 ]]; then
+ eerror "Secret file \"${SRSD_SECRET_FILE}\" must NOT be empty."
+ return 1
+ fi
+ fi
+
+ return 0
+}
+
+start() {
+ ebegin 'Starting srsd'
+ start-stop-daemon \
+ --start \
+ --background \
+ --pidfile ${pidfile} \
+ --make-pidfile \
+ --exec ${command} \
+ -- ${command_args}
+ eend $?
+}
+
+stop() {
+ ebegin 'Stopping srsd'
+ start-stop-daemon \
+ --stop \
+ --pidfile ${pidfile} \
+ --exec ${command}
+ eend $?
+}