Anope IRC Services

Anope Support => 2.0.x/1.9.x Support => Topic started by: czar on December 05, 2009, 04:19:10 PM

Title: services.pid is not being created
Post by: czar on December 05, 2009, 04:19:10 PM
Perhaps someone could explain what is going wrong in this set-up and why isn't services creating a pid file?  I'm trying to ensure anope runs on reboot and that it restarts if the service isn't running. 

What happens is the service does run on crontab but the pid is never created.  So every 2 minutes services tries to reconnect and I get "11:08 !irc.example.com *** Permanent Global Q:line added for OperServ on Sat Dec  5 16:08:29 && 2009 GMT (from services.example.com: Reserved for services)" until I manually create the pid via ps aux|grep services && echo 25700 >> ~/bin/anope/bin/services.pid.  As soon as I create that file the service quits trying to reconnect and everything is fine (until reboot.)

Code: [Select]
czar@kremlin:~/bin/anope/data/backups$ crontab -l
# m h  dom mon dow   command
*/2 * * * * /home/czar/bin/Unreal3.2/ircdcron/ircdchk >/dev/null 2>&1
*/2 * * * * /home/czar/bin/anope/data/services.chk >/dev/null 2>&1

Code: [Select]
czar@kremlin:~/bin/anope/data/backups$ cat /home/czar/bin/anope/data/services.chk
#!/bin/sh

# Crontab script for Anope
#
# To know how to install the crontab, read the INSTALL file.

###############################################################
# CONFIGURATION
###############################################################

# Anope binary directory
ANOPATH=/home/czar/bin/anope/bin

# Name of the pid file
ANOPIDF=services.pid

# Name of the executable
ANOPROG=services

# Parameters to pass to the executable
ANOARGS=""
#ANOARGS="-debug"

###############################################################
#                 DON'T EDIT ANYTHING BELOW                   #
###############################################################

PATH=/bin:/usr/bin:/usr/local/bin

ANOPID=

cd $ANOPATH

if [ -f $ANOPIDF ]
then
        ANOPID=`cat $ANOPIDF`
        if [ `ps auwx | grep $ANOPROG | grep $ANOPID | grep -v -c grep` = 1 ]
        then
                exit
        fi
        rm -f $ANOPIDF
fi

./$ANOPROG $ANOARGS


Title: Re: services.pid is not being created
Post by: Naram Qashat on December 05, 2009, 04:23:01 PM
Hmm, apparently our 1.9.x example.chk isn't correct.  services.pid is stored in ~/anope/data, not ~/anope/bin.  We'll have to fix that.
Title: Re: services.pid is not being created
Post by: czar on December 10, 2009, 05:10:52 PM
Hmm, apparently our 1.9.x example.chk isn't correct.  services.pid is stored in ~/anope/data, not ~/anope/bin.  We'll have to fix that.

Updated to the latest dev build (1.9.1-p1-source) and noticed example.chk has been fixed.  Ty ;-)
Title: Re: services.pid is not being created
Post by: Charles Kingsley on December 10, 2009, 05:14:07 PM
Hm, I'm sure I fixed that before ... not a big deal, glad its sorted now.