monsieurp    14/12/14 18:56:07

  Added:                srsd.init srsd.conf
  Log:
  Revision bump: add {init,conf}.d files as requested by user. Fix #462920.
  
  (Portage version: 2.2.14/cvs/Linux x86_64, unsigned Manifest commit)

Revision  Changes    Path
1.1                  dev-perl/Mail-SRS/files/srsd.init

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-perl/Mail-SRS/files/srsd.init?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-perl/Mail-SRS/files/srsd.init?rev=1.1&content-type=text/plain

Index: srsd.init
===================================================================
#!/sbin/runscript
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-perl/Mail-SRS/files/srsd.init,v 1.1 
2014/12/14 18:56:07 monsieurp Exp $

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 $?
}



1.1                  dev-perl/Mail-SRS/files/srsd.conf

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-perl/Mail-SRS/files/srsd.conf?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-perl/Mail-SRS/files/srsd.conf?rev=1.1&content-type=text/plain

Index: srsd.conf
===================================================================
# conf.d file for srsd
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-perl/Mail-SRS/files/srsd.conf,v 1.1 
2014/12/14 18:56:07 monsieurp Exp $

# 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}
"




Reply via email to