Configuring a new service to run on startup On RedHat Ent4

On RedHad Ent4.0,  I currently start this program from the command line with two options,  Deamon Mode and listen on port 443.
I don't know linux . . . . how do I get this to run on startup ?   Please explain it like you would to your mother . . . thanks  

        /opt/nessus/sbin/nessusd -D -p443
swbruce21Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pjedmondCommented:
Easy option is to add the above command line to /etc/rc.local

After all the main daemon scripts are run, this file is executed, and all the commands in it (including the above line that you are about to add) are run.

Voila... :)

0
m1tk4Commented:
On a redhat, you'll be much better of by installing Nessus as an RPM and starting it as all services are supposed to be started, i.e. through /etc/init.d.

http://www.nessus.org/documentation/nessus_3.0_installation_guide.pdf

If you did use an RPM, try if

service nessusd start

works. If it does, all you have to do is enable it by default. run

ntsysv

from command line and scroll down in the list of services until you see nessusd. The services that have [*] start by default, the ones that have [ ] don't. To switch it to start by default press space. Quit ntsysv with saving.

Another way to check if it's enabled by default is:

chkconfig --list | grep nessus

SHould output something like this:

nessusd        0:off   1:off   2:off   3:off   4:off   5:off   6:off

You need to enable it to run in levels 3 and 5, this is done by

chkconfig --level 3 nessusd on
chkconfig --level 5 nessusd on

and then check it again with chkconfig --list | grep nessus
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
swbruce21Author Commented:
Re: Comment from m1tk4

That is how it is installed, however the listening port number is hardwired into the executable and I need a different port number in order to reach this nessus server when confined in an environment that only permits outbout access on 80 and 443.

The alternate listening port is a switch option . . . can that be implemented in the manner that you suggest ?

Thanks
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

m1tk4Commented:
yes, there has to be a way - can you post the contents of /etc/rc.d/init.d/nessusd here?
0
swbruce21Author Commented:
#!/bin/sh
#
# chkconfig: - 90 34
# description: Starts and stops the Nessus Scanner
#


# Source function library.
if [ -f /etc/init.d/functions ] ; then
  . /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
  . /etc/rc.d/init.d/functions
else
  exit 0
fi

# Avoid using root's TMPDIR
unset TMPDIR

# Source networking configuration.
. /etc/sysconfig/network


# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0


test -x /opt/nessus//sbin/nessusd || {
      echo "Nessus not properly installed"
      exit 1
      }

RETVAL=0
Here it is.  The -q switch shown below  is  documented with the other command line options

start() {
        KIND="Nessus"
      echo -n $"Starting $KIND services: "
      daemon /opt/nessus//sbin/nessusd -q -D
      RETVAL=0
      echo
      return 0
}      

stop() {
        KIND="Nessus"
      echo -n $"Shutting down $KIND services: "
      test -f /opt/nessus//var/nessus/nessusd.pid && kill `cat /opt/nessus//var/nessus/nessusd.pid`
      RETVAL=$?
      sleep 4
      echo
      return 0
}      

restart() {
      stop
      start
}      


case "$1" in
  start)
        start
      ;;
  stop)
        stop
      ;;
  restart)
        restart
      ;;
  *)
      echo $"Usage: $0 {start|stop|restart}"
      exit 1
esac

exit $?
0
pjedmondCommented:
Well that's easy - change:

    daemon /opt/nessus/sbin/nessusd -q -D

to be:

   daemon /opt/nessus/sbin/nessusd -q -D -p443

in the start() routine.

0
swbruce21Author Commented:
Thanks guys.  After being pointed to the /etc/rc.d/init.d/nessusd script the problem was solved.  Splitting the points equally because I appreciate the help from both.  
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.