SOURCES: gnokii.smsd.config (NEW), gnokii.smsd.init (NEW) - Releas...

matkor matkor at pld-linux.org
Wed Sep 6 05:58:55 CEST 2006


Author: matkor                       Date: Wed Sep  6 03:58:55 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- Release 2 by lm at zork dot pl.
- added init scritps and sysconfig for smsd with multiple phone support.
- added logrotate configuration for smsd

---- Files affected:
SOURCES:
   gnokii.smsd.config (NONE -> 1.1)  (NEW), gnokii.smsd.init (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/gnokii.smsd.config
diff -u /dev/null SOURCES/gnokii.smsd.config:1.1
--- /dev/null	Wed Sep  6 05:58:55 2006
+++ SOURCES/gnokii.smsd.config	Wed Sep  6 05:58:50 2006
@@ -0,0 +1,23 @@
+# Configuration file for gnokii smsd daemon
+
+# Database type. Could be pq or mysql
+DBTYPE=pq
+
+DBNAME=sms
+DBUSER=zork
+DBPASS=
+DBHOST=localhost
+
+# Available phones from gnokirc. If empty then smsd is started for phone
+# listed in [global] section in /etc/gnokiirc
+# For each phone index listed here one smsd instance is spawned
+# Put indexes of phone entries in gnokiirc file. 0 is [global] section
+# 1 is next section etc...
+PHONES="0"
+
+# pooling interval for incoming sms's in seconds. Default is 1 sec.
+INTERVAL=1
+
+# max number of sms messages for dumb mode. Leave empty for defaults
+MAXSMS_IN_DUMB_MODE=
+

================================================================
Index: SOURCES/gnokii.smsd.init
diff -u /dev/null SOURCES/gnokii.smsd.init:1.1
--- /dev/null	Wed Sep  6 05:58:55 2006
+++ SOURCES/gnokii.smsd.init	Wed Sep  6 05:58:50 2006
@@ -0,0 +1,105 @@
+#!/bin/sh
+#
+# $Id$
+#
+# smsd			smsd 
+#
+# chkconfig:	345 42 58
+#
+# description:	gnokii smsd daemon
+#	
+
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Get service config
+[ -f /etc/sysconfig/smsd ] && . /etc/sysconfig/smsd
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+	if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+		msg_network_down smsd
+		exit 1
+	fi
+else
+	exit 0
+fi
+
+if [ "x$DBPASS" = "x" ]; then
+	DB_PASS="-p $DBPASS";
+fi
+
+if [ "x$PHONES" = "x" ]; then
+	PHONES=0;
+fi
+
+if [ "x$MAXSMS_IN_DUMB_MODE" = "x" ]; then
+	MAXSMS="";
+else
+	MAXSMS="-s $MAXSMS_IN_DUMB_MODE"
+fi
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+	# Check if the service is already running?
+	if [ ! -f /var/lock/subsys/smsd ]; then
+#		echo "phones: $PHONES"
+		first=yes;
+		for number in $PHONES; do 
+			msg_starting "smsd (phone $number)"
+			daemon --fork "/usr/sbin/smsd -u $DBUSER -p $DB_PASS -d $DBNAME -c $DBHOST -m $DBTYPE -i $INTERVAL $MAXSMS >/var/log/smsd/smsd_phone_$number 2>&1"
+			if [ $? -ne 0 ]; then
+				echo "Warning: smsd for phone $number could not start";
+			fi
+		done;
+#		daemon /usr/bin/distccd --daemon --user distcc --log-file /var/log/distcc `for ip in $DISTCC_HOSTS_ALLOW; do echo -n "--allow $ip "; done` $DISTCC_OPTS
+		RETVAL=$?
+		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/smsd		
+	else
+		msg_already_running smsd
+	fi
+	;;
+  stop)
+	if [ -f /var/lock/subsys/smsd ]; then
+		msg_stopping smsd
+		killproc smsd
+		rm -f /var/run/smsd.pid /var/lock/subsys/smsd >/dev/null 2>&1
+	else
+		msg_not_running smsd
+	fi	
+	;;
+  restart)
+	$0 stop
+	$0 start
+	exit $?
+	;;
+  status)
+	status smsd
+	exit $?
+	;;
+#  reload|force-reload)
+#	if [ -f /var/lock/subsys/smsd ]; then
+#		msg_reloading smsd
+#		killproc smsd -HUP
+#		RETVAL=$?
+#	else
+#		msg_not_running smsd >&2
+#		exit 7
+#	fi
+#	;;
+  *)
+	msg_usage "$0 {start|stop|restart|status}"
+	exit 3
+esac
+
+exit $RETVAL
+
+# This must be last line !
+# vi:syntax=sh:tw=78:ts=8:sw=4
+
================================================================


More information about the pld-cvs-commit mailing list