From d904771c3a09ec9c456d4f3b3de39c360cfda7c6 Mon Sep 17 00:00:00 2001 From: Pav Lucistnik Date: Thu, 21 Jul 2005 15:07:44 +0000 Subject: [PATCH] - Move .pid file to /var/run PR: ports/83089 Submitted by: Radim Kolar Approved by: maintainer timeout (14 days) --- irc/ircd-hybrid/Makefile | 2 +- irc/ircd-hybrid/files/include-config.h.pre-patch | 15 ++++++++++++--- irc/ircd-hybrid/files/ircd-hybrid.sh | 9 +++++++-- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/irc/ircd-hybrid/Makefile b/irc/ircd-hybrid/Makefile index 4a682764dc14..d2f2890db83f 100644 --- a/irc/ircd-hybrid/Makefile +++ b/irc/ircd-hybrid/Makefile @@ -7,7 +7,7 @@ PORTNAME= ircd-hybrid PORTVERSION= 7.0.2 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= irc ipv6 MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_EXTENDED} MASTER_SITE_SUBDIR= ircd-hybrid diff --git a/irc/ircd-hybrid/files/include-config.h.pre-patch b/irc/ircd-hybrid/files/include-config.h.pre-patch index af4df1dee821..d6c77943e5c5 100644 --- a/irc/ircd-hybrid/files/include-config.h.pre-patch +++ b/irc/ircd-hybrid/files/include-config.h.pre-patch @@ -1,5 +1,5 @@ ---- include/config.h.orig Thu Feb 6 01:46:11 2003 -+++ include/config.h Thu Jan 29 20:16:13 2004 +--- include/config.h.orig Sun Oct 26 03:08:12 2003 ++++ include/config.h Thu Jul 7 11:27:45 2005 @@ -90,7 +90,9 @@ /*#define IRCD_PREFIX "IRCD$BASEDIR:"*/ #define DPATH "IRCD$BASEDIR:" @@ -10,7 +10,7 @@ #define LOGPATH "IRCD$LOGDIR:" #undef MODPATH -@@ -134,13 +136,13 @@ +@@ -137,13 +139,13 @@ /* dirs */ #define DPATH IRCD_PREFIX #define BINPATH IRCD_PREFIX "/bin/" @@ -30,3 +30,12 @@ /* files */ #define SPATH BINPATH "/ircd" /* ircd executable */ +@@ -158,7 +160,7 @@ + #define RPATH ETCPATH "/ircd.rsa" /* ircd rsa private keyfile */ + #define MPATH ETCPATH "/ircd.motd" /* MOTD file */ + #define LPATH LOGPATH "/ircd.log" /* ircd logfile */ +-#define PPATH ETCPATH "/ircd.pid" /* pid file */ ++#define PPATH "/var/run/ircd.pid" /* pid file */ + #define OPATH ETCPATH "/opers.motd" /* oper MOTD file */ + #define LIPATH ETCPATH "/links.txt" /* cached links file */ + #endif /* !VMS */ diff --git a/irc/ircd-hybrid/files/ircd-hybrid.sh b/irc/ircd-hybrid/files/ircd-hybrid.sh index 4e2918d5b67d..10751d94a161 100644 --- a/irc/ircd-hybrid/files/ircd-hybrid.sh +++ b/irc/ircd-hybrid/files/ircd-hybrid.sh @@ -1,14 +1,19 @@ #!/bin/sh +PIDFILE=/var/run/ircd.pid + if [ $# -eq 0 -o x$1 = xstart ]; then if [ -x %PREFIX%/bin/ircd ]; then + touch $PIDFILE + chown ircd $PIDFILE su -fm ircd -c %PREFIX%/bin/ircd && echo ' ircd' fi fi if [ x$1 = xstop ]; then - if [ -f %PREFIX%/etc/ircd.pid ]; then - kill `cat %PREFIX%/etc/ircd.pid` + if [ -s $PIDFILE ]; then + kill `cat $PIDFILE` else # oh well killall ircd fi + rm -f $PIDFILE fi