need help making boot script for unrealIRCd

Discussion in 'Programming/Scripts' started by staticanime, Dec 27, 2008.

  1. staticanime

    staticanime New Member

    Can anyone help/make me a script to be up in /etc/init.d/ to start, stop, restart & reload unreal-ircd??

    All the info needed is here (screenshot from the AdmIRC module for Webmin)
     
  2. falko

    falko Super Moderator ISPConfig Developer

    Which distribution are you using? How did you install unreal-ircd?
     
  3. staticanime

    staticanime New Member

    I installed Unreal-ircD 3.2.7 from source, and I'm running Ubuntu server 8.04.1

    EDIT: I managed to get it working by editing the script /usr/share/unreal-ircd/unreal and changed the path to the binary
    EDIT2: Or maybe not :(

    Anyway, here is my bootscript stored in /etc/init.d/unrealircd
    Code:
    #!/bin/sh
    # Starts and stops UnrealIRCd
    
    case "$1" in
    'start')
    	su - unreal
            /usr/share/unreal-ircd/unreal start
            RETVAL=$?
            ;;
    'stop')
            /usr/share/unreal-ircd/unreal stop
            RETVAL=$?
            ;;
    'restart')
            /usr/share/unreal-ircd/unreal restart
            RETVAL=$?
            ;;
    *)
            echo "Usage: $0 { start | stop | restart}"
            RETVAL=1
            ;;
    esac
    exit $RETVAL
    
    but it doesn't work too well, it just seems to run the su - unreal command, it won't run any other commands until I type exit in the unreal shell :S

    PS. the user unreal has the home directory of /usr/share/unreal-ircd/, and has full ownership of all files related to unrealIRCd, if that helps.
    PPS the reason for the su - unreal is cause I don't want the daemon running as root
     
    Last edited: Dec 27, 2008
  4. falko

    falko Super Moderator ISPConfig Developer

    What happens when you leave it out? I think the server should be started as root - it might then switch to another user afterwards (don't now unreal-ircd, but that's how many other daemons do it).
     
  5. staticanime

    staticanime New Member

    Yeah, the IRC daemon just stays running as root if I leave out the su - unreal, so I'm stumped :S
     
  6. zcworld

    zcworld New Member

    ok
    not sure if you installed yours from an package or compile / config it fully yourself if you installed from an packaged than it maybe bit a tad diff from this ...
    this is what i used for mine due to i compile it myself :) hope its helps out a little :)


    ** UPDATE ** i re read your post
    change the path to the file and than try it see if thats works for you
    to see if it works or not make sure the server is stoped and have an IRC client trying to connect to your box IP and wait 4 mins
    if connected than its works if not arrr yell out
    PS ... i would of used the /home folder to install / run the IRCD from .. but thats just me

    heads up if its works nor not
    try this
    log into your irc user account <i used ircadmin>
    than
    check ur ~/bin folder to see if you got a file called "ircdchk"

    if so than you run this command
    crontab -e
    add in to the crontab window this line
    */2 * * * * /home/ircadmin/bin/ircdchk >/dev/null 2>&1


    save it

    when your server boots it will check to see if the server is running every two mins if not it will start it
    and if the server was running and crashed or stoped it and didn't restart it , it will auto restart it for you as far as i can remember

    its being a while

    hope its helps

    and remember to do this as the IRCADMIN user or what you call it


    if you dont have the file called " ircdchk"

    do an search for it on your system and see if you can find it
     
    Last edited: Dec 30, 2008

Share This Page