Commit 5fb487cc authored by salaun's avatar salaun
Browse files

[Autrijus Tang] Adaptations for FreeBSD ; some changes were commented :

killproc/kill && if


git-svn-id: https://subversion.renater.fr/sympa/trunk@767 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent aad4c4fe
......@@ -66,6 +66,11 @@ WWSBINDIR = $(BINDIR)
## Target directory for installing Icons
ICONSDIR = /home/httpd/icons
## Settings used in src/etc/scripts/sympa
PIDPRE = pidof -x
PIDPOST =
LOCKDIR = /var/lock/subsys
## Path to newaliases command (or what else may be called to rebuild
## Mail aliases database)
NEWALIASES = /usr/bin/newaliases
......@@ -93,6 +98,17 @@ CFLAGS = -g
# Aix4.2 (and some others unix), use gnu make !
#MAKE = @MAKE@
# FreeBSD hier(7) structure and locations
# by Autrijus Tang 2001/10/11
#ifeq ($(shell uname), FreeBSD)
# PIDPRE = ps -ax | grep
# PIDPOST = | grep perl | head -n 1 | cut -f 2 -d " "
# LOCKDIR = /var/spool/lock
# ICONSDIR = /usr/local/www/icons
# RPMTOPDIR = /usr/local/src/redhat
# OPENSSL = /usr/bin/openssl
#endif
##---------- STOP ---------- STOP ---------- STOP ---------- STOP ----------
CONFIG = $(CONFDIR)/sympa.conf
......@@ -137,7 +153,8 @@ sources: src/Makefile src/queue.c src/bouncequeue.c src/aliaswrapper.c
CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' \
USER='${USER}' GROUP='${GROUP}' \
SENDMAIL_ALIASES='${SENDMAIL_ALIASES}' NEWALIASES='${NEWALIASES}' \
NEWALIASES_ARG='${NEWALIASES_ARG}');
NEWALIASES_ARG='${NEWALIASES_ARG}' \
PIDPRE='${PIDPRE}' PIDPOST='${PIDPOST}' LOCKDIR='${LOCKDIR}');
doc: doc/sympa.tex.tpl doc/Makefile
@echo "Making doc"
......@@ -250,6 +267,7 @@ installscript:
CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' ETCBINDIR='${ETCBINDIR}' \
MAILERPROGDIR='${MAILERPROGDIR}' \
COOKIE='${COOKIE}' INITDIR='${INITDIR}' \
PIDPRE='${PIDPRE}' PIDPOST='${PIDPOST}' LOCKDIR='${LOCKDIR}' \
OPENSSL='@OPENSSL@' USER='${USER}' GROUP='${GROUP}' ICONSDIR='${ICONSDIR}' install) || exit 1;
......
......@@ -36,6 +36,9 @@ installsubstsrc:
COOKIE=$(COOKIE); export COOKIE; \
HOST=$(HOST); export HOST; \
OPENSSL=$(OPENSSL); export OPENSSL; \
PIDPRE='$(PIDPRE)'; export PIDPRE; \
PIDPOST='$(PIDPOST)'; export PIDPOST; \
LOCKDIR=$(LOCKDIR); export LOCKDIR; \
$(PERL) ../../../subst.pl $(SUBSTSRC) \
)
......
......@@ -14,11 +14,13 @@
# chkconfig: 345 95 05
# description: sympa is a powerfull mailing lists management system.
# Source function library.
. /etc/rc.d/init.d/functions
if [ ${OSTYPE} != "FreeBSD" ]; then
# Source function library.
. /etc/rc.d/init.d/functions
# Get config.
. /etc/sysconfig/network
# Get config.
. /etc/sysconfig/network
fi
# Sympa parameters
# Sympa binaries directory
......@@ -39,7 +41,7 @@ sympa_status() {
fi
# First try "pidof"
pid=`pidof -x $1.pl`
pid=`--PIDPRE-- $1.pl --PIDPOST--`
if [ "$pid" != "" ] ; then
echo "$1 (pid $pid) is active..."
return 0
......@@ -70,9 +72,9 @@ sympa_module_start() {
# startparam=""
# fi
daemon $sympadir/$1.pl $startparam
$sympadir/$1.pl $startparam &
sleep 1
pid=`pidof -x $sympadir/$1.pl`
pid=`--PIDPRE-- $sympadir/$1.pl --PIDPOST--`
if [ $pid ]; then
echo $pid > /var/run/$1.pl.pid
fi
......@@ -113,6 +115,7 @@ sympa_stop() {
if [ -f /var/run/$1.pl.pid ]; then
echo -n "Stopping module $1.pl: "
killproc $1.pl
# kill `--PIDPRE-- $1.pl --PIDPOST--`
rm -f /var/run/$1.pl.pid
echo
fi
......@@ -120,9 +123,11 @@ sympa_stop() {
# Check that networking is up.
if [ ${NETWORKING} = "no" ]
then
exit 0
if [ ${OSTYPE} != "FreeBSD" ]; then
if [ ${NETWORKING} = "no" ]
then
exit 0
fi
fi
# Check config files
......@@ -133,13 +138,13 @@ fi
# See how we were called.
case "$1" in
start)
if [ ! -f /var/lock/subsys/sympa ]; then
if [ ! -f --LOCKDIR--/sympa ]; then
echo "Starting Sympa subsystem: "
sympa_start sympa
sympa_start archived
sympa_start bounced
sympa_start task_manager
touch /var/lock/subsys/sympa
touch --LOCKDIR--/sympa
echo
else
......@@ -154,14 +159,14 @@ case "$1" in
sympa_stop archived
sympa_stop sympa
sympa_stop task_manager
if [ -f /var/lock/subsys/sympa ]; then
rm -f /var/lock/subsys/sympa
if [ -f --LOCKDIR--/sympa ]; then
rm -f --LOCKDIR--/sympa
fi
;;
status)
echo "Status of Sympa subsystem: "
echo -n "Status file for subsystem "
if [ -f /var/lock/subsys/sympa ]; then
if [ -f --LOCKDIR--/sympa ]; then
echo "found."
else
echo "NOT found."
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment