KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

RMA Startup script for Red Hat 9

 
Post new topic   Reply to topic    KS-Soft Forum Index -> RMA for UNIX
View previous topic :: View next topic  
Author Message
ikevin



Joined: 08 Sep 2005
Posts: 2

PostPosted: Thu Sep 08, 2005 12:26 am    Post subject: RMA Startup script for Red Hat 9 Reply with quote

how to add Startup sciprt for Redt Hat 9 that make it start automatic ?
thx a lot
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 11782
Location: USA

PostPosted: Thu Sep 08, 2005 3:55 pm    Post subject: Reply with quote

I think you should add command that starts agent into /etc/rc.d/rc.local file

Regards
Alex
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ikevin



Joined: 08 Sep 2005
Posts: 2

PostPosted: Thu Sep 08, 2005 8:14 pm    Post subject: Reply with quote

Would you pls give me more detail step ? thx a lot
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 11782
Location: USA

PostPosted: Fri Sep 09, 2005 10:29 am    Post subject: Reply with quote

Add rmapath/rma rmapath/rma.ini line into /etc/rc.d/rc.local file. Where rmapath is path to directory where agent is installed

Regards
Alex
Back to top
View user's profile Send private message Send e-mail Visit poster's website
r3boot



Joined: 08 Jun 2005
Posts: 7

PostPosted: Thu Oct 13, 2005 6:38 am    Post subject: Reply with quote

FYI, here's the init script that we're using on RHEL3/4 boxen; place in /etc/init.d and activate with chkconfig --add <script-name>. It's written in POSIX sh, so it should be usable on any platform that does sh and SYSV init (although you might have to fiddle with the ps arguments depending on your platform):

Code:

#!/bin/sh
# chkconfig: 2345 20 80
# description: Hostmonitor RMA

RMA_PWD="/opt/hostmonitor"
RMA_BIN="${RMA_PWD}/rma"
RMA_INI="${RMA_PWD}/rma.ini"

case "${1}" in
        start)
                echo -n "Starting Hostmonitor RMA: "
                ${RMA_BIN} -d ${RMA_INI} &>/dev/null
                echo "done"
                ;;
        stop)
                echo -n "Stopping Hostmonitor RMA: "
                PID="$(ps ax | grep ${RMA_BIN} | grep -v grep | awk '{print $1}')"
                if [ x"${PID}" != x"" ]; then
                        kill ${PID} &>/dev/null
                        sleep 1
                        kill -9 ${PID} &>/dev/null
                fi
                echo "done"
                ;;
        restart)
                ${0} stop
                sleep 1
                ${0} start
                ;;
        *)
                echo "Usage: `basename ${0}` <start|stop|restart>"
                exit 1
                ;;
esac
exit 0
Back to top
View user's profile Send private message Visit poster's website
jivetolkein



Joined: 19 Jul 2007
Posts: 96

PostPosted: Fri Jul 10, 2009 8:03 am    Post subject: Reply with quote

Sorry to dig up an old thread but I thought it might be useful to add:

Use the above init script by copying it into /etc/init.d

Make it runnable:

chmod +x /etc/init.d/rma
chown 744 /etc/init.d/rma

.. then add it to chkconfig as appears to be the RHEL way..

chkconfig --add rma
chkconfig --level 35 rma on

.. and check your work with

chkconfig --list rma

.. which should show rma running in the approprite run levels.

You can then use

service rma (start|stop|restart)

.. to control it as per most other services.
Back to top
View user's profile Send private message
jivetolkein



Joined: 19 Jul 2007
Posts: 96

PostPosted: Fri Jul 10, 2009 8:08 am    Post subject: Reply with quote

Should add I save the init script as

rma

.. just to be clear
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> RMA for UNIX All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index