Powered by Invision Power Board


  Reply to this topicStart new topicStart Poll

> Sybase Startup Scripts for HP-UX 11.0
marvin51796
  Posted: Mar 6 2003, 06:39 PM
Quote Post


Newbie
*

Group: Members
Posts: 8
Member No.: 16
Joined: 18-February 03



I have a RP5470 that is running HP-UX ver 11.0 64-bit, I have loaded Sybase Enterprise Edition ver 12.0 64-Bit onto it and it is running fine, I am trying to setup the startup scripts so that when the server is rebooted, Sybase will be shutdown correctly and be restarted correctly. I have created the startup scripts in /sbin/init.d linked them to /sbin/rc3.d and when you do a sybase start, or sybasebackup start/shutdown it works fine. What i cant do is get them to work when the system is rebooted. If any one has any ideas i would appreciate it.
here is the sybase backup script that i have written
:unsure:
#!/usr/bin/sh
#
# Startup script for Sybase SQL server
#
# Path to Sybase and install.
#
SYBASE=/appl/sybase;export SYBASE
ISQL=/appl/sybase/OCS-12_0/bin/isql; export ISQL
INSTALL=/appl/sybase/ASE-12_0/install; export INSTALL
SYBASE_OCS=OCS-12_0; export SYBASE_OCS
SYBASE_ASE=ASE-12_0;export SYBASE_ASE
LM_LICENSE_FILE=/appl/sybase/SYSAM-1_0/licenses/license.dat:$LM_LICENSE_FILE; export LM_LICENSE_FILE
SYBASE_SYSAM=SYSAM-1_0;export SYBASE_SYSAM

case "$1" in

"start_msg") echo "Starting SYBASE Backup Server" ;;

'start')
#
# Sybase server startup.
/appl/sybase/ASE-12_0/install/startserver -f /appl/sybase/ASE-12_0/install/RUN_hp9000_back > /dev/console 2>&1 &

;;

"stop_msg") echo "Shutting down the SYBASE Backup Server" ;;

'stop')
#
# Sybase Backup server shutdown.
#
isql -S Servername -U sa -P Junk -i /appl/sybase/ASE-12_0/install/SHUTDOWN_sybasebackup > /dev/console 2>&1 &
;;

*)
#
# Invalid param.
#
echo "Usage: /sbin/init.d/sybase { start | stop }"
;;
esac


exit 0;
PMEmail PosterAOLYahoo
Top
sleazyrob
Posted: Mar 9 2003, 08:29 PM
Quote Post


User Level: 4
****

Group: Members
Posts: 66
Member No.: 8
Joined: 17-February 03



Isn't it just a case of adding another sybolic link "K12whatever" in rc0.d and rc6.d ?
...Thats assuming halt/reboot runlevels are the same in HPUX as they are in Solaris/Linux.

"man init" lists them on Linux and Solaris so I guess they should be documented there.
PMEmail Poster
Top
marvin51796
Posted: Mar 10 2003, 02:13 PM
Quote Post


Newbie
*

Group: Members
Posts: 8
Member No.: 16
Joined: 18-February 03



Did that already, I have several other scripts that i have written, like emailing me when the server reboots, modifications, etc etc..no problems at all..these work fine.
The problem with the sybase ones is that nothing happens...There is one line in the rc.log that says starting script and thats it..nothing else, no errors, no completition, nothing at all.
I guess i am just asking for any ideas, comments, or if anyone has seen anything like this with an other scripts that they have written.

here is what is written in /etc/rc.log when the server reboots..

Starting SYBASE Server
Output from "/sbin/rc3.d/S999sybase start":
----------------------------
PMEmail PosterAOLYahoo
Top
sleazyrob
Posted: Mar 10 2003, 10:01 PM
Quote Post


User Level: 4
****

Group: Members
Posts: 66
Member No.: 8
Joined: 17-February 03



So running:
CODE

/appl/sybase/ASE-12_0/install/startserver -f /appl/sybase/ASE-12_0/install/RUN_hp9000_back
and
isql -S Servername -U sa -P Junk -i /appl/sybase/ASE-12_0/install/SHUTDOWN_sybasebackup > /dev/console 2>&1 &

exactly _as root_ stops and starts sybase sucessfully outside of these scripts?

Sybase runs as user "sybase" on all our Solaris production servers, is this not the case on HPUX? Just a guess but some stuff refuses to run as root for security reasons.

Here is the rc script from one of the machines showing the su to that user. Hope this helps?

CODE

#!/bin/sh
set -x

TZ=GMT
export TZ

SYBASE=/usr/sybase
export SYBASE

killproc() {
       pid=`/usr/bin/ps -e | /usr/bin/grep $1 |
            /usr/bin/sed -e 's/^  *//' -e 's/ .*//'`
       [ "$pid" != "" ] && kill $pid
}


case "$1" in
'start')

       su sybase -c "/usr/bin/nice -n 1 /bin/ksh $SYBASE/START_*SERVERNAME*" &        sleep 10
    ;;

'stop')

       (echo "shutdown"; echo "go"; sleep 5) | $SYBASE/bin/isql -Usa -P*PASSSWORD* -S*SERVERNAME*
       killproc backupse
    ;;
*)
       echo $0 " { start | stop }"
    ;;
esac




Rob
PMEmail Poster
Top
marvin51796
Posted: Mar 11 2003, 02:57 PM
Quote Post


Newbie
*

Group: Members
Posts: 8
Member No.: 16
Joined: 18-February 03



I will try this and get back to you, thanks
PMEmail PosterAOLYahoo
Top
marvin51796
Posted: May 15 2003, 06:06 PM
Quote Post


Newbie
*

Group: Members
Posts: 8
Member No.: 16
Joined: 18-February 03



I was able to get them to run, by removeing ths su command and just leaving it as a basic command to be executed. luckily for me i was able to test this when the halon system dumped the other day and shut everything down, but when the Hp9000 came backup so did sybase.
Thanks for everyones help, advice or just thought.
Thanks again
:D
PMEmail PosterAOLYahoo
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
« Next Oldest | Databases | Next Newest »

Topic Options Reply to this topicStart new topicStart Poll

 



[ Script Execution time: 0.0707 ]   [ 12 queries used ]   [ GZIP Enabled ]




Partners: Cambridge Plus :: <Link Available> :: PIC Circuit Design UK :: Classic Motorcycle Piston Rings
Unix Man Pages / Linux Man Pages :: HiFi Forum :: SIP VoIP Phone & Provider Reviews :: UNIX/Linux Forum Archives

More info on advertising on Unix/Linux Forum