Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1] 2   Go Down

Author Topic: Strange thing happening  (Read 16409 times)

0 Members and 1 Guest are viewing this topic.

scarcorp

  • Anope User
  • Offline Offline
  • Posts: 14
    • irc.scarcorp.com.au
Strange thing happening
« on: February 18, 2008, 12:22:51 AM »

My IRC server & Anope works like a charm, great job people :)

The only thing is this:
After the server & services have been running for a few days I get this Notice:

*** Notice -- Link [@127.0.0.1.57085] cancelled, server
 services.scarcorp.com.au already exists from services.scarcorp.com.au

And it comes up every 5 minutes, which incidentally is the contrab time check I've setup.

I've looked at the contrab, the services set up etc, but can't figure it out.

Has anyone else come across this problem?

It's not terribly important since everything else works fine, but being a bit of a perfectionist I like things to run as expected hehe

Cheers,
Johnny
Logged

GhosT

  • Guest
(No subject)
« Reply #1 on: February 18, 2008, 06:23:54 AM »

You might set up crontab for anope not properly.
Logged

scarcorp

  • Anope User
  • Offline Offline
  • Posts: 14
    • irc.scarcorp.com.au
(No subject)
« Reply #2 on: February 18, 2008, 06:45:42 AM »

Thanks for your reply,

This is my crontab:

0,5,10,15,20,25,30,35,40,45,50,55 * * * * /home/ircadmin/services/services.chk >/dev/null 2>&1

And this is 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/ircadmin/services/

# 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

I have it set up to run under it's own user: ircadmin

If you see anything incorrect, I'd appreciate it if would point it to me.  I'm quite a novice at this.

Thanks again,
Johnny
Logged

katsklaw

  • Guest
(No subject)
« Reply #3 on: February 18, 2008, 11:26:15 AM »

only 2 things that cause an auto-connect attempt and that's crontab and an auto-connect entry in your link block.
Logged

scarcorp

  • Anope User
  • Offline Offline
  • Posts: 14
    • irc.scarcorp.com.au
(No subject)
« Reply #4 on: February 18, 2008, 12:08:28 PM »

Ok ... Thanks ... Funny thing is it's ok for a few days ... then it tries to connect every 5 mins ... although the service is already running & operating as expected.

Cheers,
Johnny
Logged

Jan Milants

  • Team
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 1372
(No subject)
« Reply #5 on: February 18, 2008, 12:15:34 PM »

yeah.. i have experienced and seen this with others before... for some reason the services.pid file disappears and then the cronjob thinks anope isn't running anymore and tries to start a new instance... which is then rejected by the ircd of course.
A quick fix is to recreate the services.pid with anopes pid in it, but that won't prevent it from happening again...
Logged
If you like me donate coins to 1FBmZVT4J8WAUMHKqpWhgNVj3XXnRN1cCk :)

scarcorp

  • Anope User
  • Offline Offline
  • Posts: 14
    • irc.scarcorp.com.au
(No subject)
« Reply #6 on: February 18, 2008, 12:18:58 PM »

Maybe I'll try creating a copy of the pid file and add a crontab to check for it's existence, then have it copied.
We'll see
:)
Logged

scarcorp

  • Anope User
  • Offline Offline
  • Posts: 14
    • irc.scarcorp.com.au
(No subject)
« Reply #7 on: February 18, 2008, 04:10:12 PM »

No didn't work ... It's a mistery ... everthing seems setup up ok!
Logged

scarcorp

  • Anope User
  • Offline Offline
  • Posts: 14
    • irc.scarcorp.com.au
(No subject)
« Reply #8 on: February 19, 2008, 06:33:26 AM »

Oh well, apart from a bit of extra CPU processing time, it's not a real drama.
If anyone has experienced this before, or know of a solution, your thoughts would be welcome.

I wonder if it has anything to do with crontab itself?  That's a little out of my depth lol

Thanks all.
:)

[Edited on 19-2-08 by scarcorp]
Logged

katsklaw

  • Guest
(No subject)
« Reply #9 on: February 19, 2008, 09:58:48 PM »

Actually now that I think about it. It's been reported in the past that some users that use the anope's example.chk cron script found that their pid files get deleted at the wrong times. This is an occasional occurance adn without that pid file the check script will attept to start Anope, even if it's running.

Personally I use a custom script and haven't had such bad luck.
Logged

scarcorp

  • Anope User
  • Offline Offline
  • Posts: 14
    • irc.scarcorp.com.au
(No subject)
« Reply #10 on: February 21, 2008, 10:20:40 PM »

Problem solved!
I simply added a crontab entry to copy a backup of services.pid and after a few days it seems to be ok.

Many thanks for everyone who helped :)

Cheers,
Johnny
:)
Logged

scarcorp

  • Anope User
  • Offline Offline
  • Posts: 14
    • irc.scarcorp.com.au
(No subject)
« Reply #11 on: February 26, 2008, 12:03:14 AM »

Back to square one again!

I've done away with services.chk there seems to be an error in the script, I'm no expert at writing scripts, but it seems the script's logic deletes the services.chk file, and then runs ./services again.

if [ -f $ANOPIDF ]     <------ this checks if services.pid exists
then
ANOPID=`cat $ANOPIDF`   <--------- if does it gets the pid number
if [ `ps auwx | grep $ANOPROG | grep $ANOPID | grep -v -c grep` = 1 ]    <------- this checks if the service is running
then
exit      <--------- yes it is running so it exits the script.
fi
rm -f $ANOPIDF     <------- no it's not, so it deletes the pid file
fi

./$ANOPROG $ANOARGS     <-------- starts services again.

Problem is for some reason the script deletes the pid file and then on it's next check it tries to run services even though its already running!

Oh well...
Cheerrs.
Logged

Jan Milants

  • Team
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 1372
(No subject)
« Reply #12 on: February 26, 2008, 12:08:22 AM »

The problem is known... what isn't known is what causes it, since it is only a small minority of people that ever experience this problem, and even then it doesn't always happen again...
Logged
If you like me donate coins to 1FBmZVT4J8WAUMHKqpWhgNVj3XXnRN1cCk :)

katsklaw

  • Guest
(No subject)
« Reply #13 on: February 26, 2008, 11:09:18 AM »

several people tend to use a modified version of the chk script that comes with UnrealIRCd and have better luck.
Logged

scarcorp

  • Anope User
  • Offline Offline
  • Posts: 14
    • irc.scarcorp.com.au
(No subject)
« Reply #14 on: February 26, 2008, 11:41:01 AM »

Would someone care to supply me with one of their modified scripts?

Johnny
Logged

katsklaw

  • Guest
(No subject)
« Reply #15 on: February 26, 2008, 08:26:03 PM »

?? .. user the one that come with Unreal and put anopes name in it .. it's not that hard.
Logged

TommyGun

  • Anope User
  • Offline Offline
  • Posts: 11
(No subject)
« Reply #16 on: March 17, 2008, 06:50:29 PM »

katsklaw, could you post your .chk file maybe? Im having this problem too, cant get it fixed.

Thanks
Logged

katsklaw

  • Guest
(No subject)
« Reply #17 on: March 18, 2008, 03:38:15 AM »

Quote
Originally posted by TommyGun
katsklaw, could you post your .chk file maybe? Im having this problem too, cant get it fixed.

Thanks


What IRCd do you use?
Logged

scarcorp

  • Anope User
  • Offline Offline
  • Posts: 14
    • irc.scarcorp.com.au
(No subject)
« Reply #18 on: March 18, 2008, 05:37:02 AM »

I noticed that I had crontabs setup as root as well as "ircadmin", after sorting that out and just using the ircdchk & crontab under owner "ircadmin" the problem has resolved itself.
<well - I am rather new at all this but its fun!>

Cheers everyone.:)
Logged

TommyGun

  • Anope User
  • Offline Offline
  • Posts: 11
(No subject)
« Reply #19 on: March 18, 2008, 05:19:30 PM »

Quote
Originally posted by katsklaw
Quote
Originally posted by TommyGun
katsklaw, could you post your .chk file maybe? Im having this problem too, cant get it fixed.

Thanks


What IRCd do you use?


UnrealIRCD
Logged

katsklaw

  • Guest
(No subject)
« Reply #20 on: March 19, 2008, 03:47:38 AM »

then you need to use the Unreal .chk file like I already suggested. It's not hard to edit for Anope.
Logged

TommyGun

  • Anope User
  • Offline Offline
  • Posts: 11
(No subject)
« Reply #21 on: March 19, 2008, 09:54:11 PM »

I know, but im not really sure about the edits. Is this correct?

Code: [Select]
#!/bin/sh

# The path to the services binary
ircdexe="/home/tommygun/services"

# The path to the services pid file
ircdname="/home/tommygun/services/services.pid"

########## you probably don't need to change anything below here ##########
if test -r $ircdname; then
  # there is a pid file -- is it current?
  ircdpid=`cat $ircdname`
  if `kill -CHLD $ircdpid >/dev/null 2>&1`; then
    # it's still going
    # back out quietly
    exit 0
  fi
  echo "Anope Crontab notice:"
  echo ""
  echo "Stale $ircdname file (erasing it)"
  rm -f $ircdname
fi
echo ""
echo "Couldn't find services running.  Reloading it..."
echo ""
$ircdexe
Logged

Jobe

  • Contributor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 1023
    • Anope IRC Services
(No subject)
« Reply #22 on: March 20, 2008, 09:27:32 AM »

TommyGun, for ircdexe it should be /home/tommygun/services/services assuming youre in /home/tommygun/services when you type ./services
Logged
Your IP: ()
My IRC Status:

Come along and visit http://www.anopequotes.org/

TommyGun

  • Anope User
  • Offline Offline
  • Posts: 11
(No subject)
« Reply #23 on: March 21, 2008, 05:19:48 PM »

Ah right, thanks. And how to get the pid back? Because now;

bash-3.00$ /home/tommygun/services/services.chk

Couldn't find services running. Reloading it...

IRC: [18:19] -irc.gamergun.com- *** Notice -- Link [@127.0.0.1.51132] cancelled, server services.gamergun.com already exists from services.gamergun.com
Logged

katsklaw

  • Guest
(No subject)
« Reply #24 on: March 21, 2008, 06:51:05 PM »

kill services then start services
Logged
Pages: [1] 2   Go Up