Home > Archive > SQL Anywhere for Linux > August 2005 > creating startup scripts for SUSE









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author creating startup scripts for SUSE
Mike D.

2005-08-04, 8:23 pm

Hi Group!

I've seen the example scripts provided at this link:
http://www.ianywhere.com/developer/...x_start_up.html

The trouble is, I need to get a daemon going for Suse.

Following the link above, I have the init scripts working, but I am not able
to make the service start when the system boots.

Anyhelp in getting ASA 9.02 to run at start-up on Suse Pro 9.2 would be
appreciated!

Thanks!

-Mike


Chris Gruber

2005-08-05, 11:23 am

Is there anything written to /var/log/asademo_service.log ? If so what is
the contents of the log.

Also, do you see any message that looks like the following upon start up?

Attempting to start Adaptive Server Anywhere

Thx
Chris Gruber
iAnywhere Solutions
"Mike D." < nospam_mdunn@spiritp
os.com_nospam> wrote in message
news:42f2770b$1@foru
ms-1-dub...
> Hi Group!
>
> I've seen the example scripts provided at this link:
> http://www.ianywhere.com/developer/...x_start_up.html
>
> The trouble is, I need to get a daemon going for Suse.
>
> Following the link above, I have the init scripts working, but I am not

able
> to make the service start when the system boots.
>
> Anyhelp in getting ASA 9.02 to run at start-up on Suse Pro 9.2 would be
> appreciated!
>
> Thanks!
>
> -Mike
>
>



Chris Gruber

2005-08-05, 8:23 pm

The service script may be getting you as you may not have the gprintf
function. Try the following SQLAnywhereService script.


Chris Gruber
iAnywhere Solutions

#!/bin/sh
#
# Startup script for Adaptive Server Anywhere Service
#
# chkconfig: 2345 20 80
# description: SQL Anywhere's Adaptive Server Anywhere (dbsrv9)
# is a SQL database server.
# processname: dbsrv9

# Source function library.
#. /etc/rc.d/init.d/functions


# The following are brief examples of how to have SQL Anywhere
# Start and stop from the system.


start() {


echo "Attempting to start Adaptive Server Anywhere"
echo $*
/opt/sybase/SYBSsa9/SQLAnywhereService.init

}
stop() {

echo "Attempting to stop Adaptive Server Anywhere"
/opt/sybase/SYBSsa9/SQLAnywhereService.fini

}
restart() {

echo "Attempting to restart Adaptive Server Anywhere"
/opt/sybase/SYBSsa9/SQLAnywhereService.fini
/opt/sybase/SYBSsa9/ SQLAnywhereService.init

}

case "$1" in


start)

start
;;

stop)

stop
;;

restart|reload)

restart
;;

*)

gprintf "Usage: %s & #123;start|stop|rest
art}\n" "$0"
exit 1

esac
exit 0
"Mike D." < nospam_mdunn@spiritp
os.com_nospam> wrote in message
news:42f2770b$1@foru
ms-1-dub...
> Hi Group!
>
> I've seen the example scripts provided at this link:
> http://www.ianywhere.com/developer/...x_start_up.html
>
> The trouble is, I need to get a daemon going for Suse.
>
> Following the link above, I have the init scripts working, but I am not

able
> to make the service start when the system boots.
>
> Anyhelp in getting ASA 9.02 to run at start-up on Suse Pro 9.2 would be
> appreciated!
>
> Thanks!
>
> -Mike
>
>



Mike D.

2005-08-09, 11:23 am

Hi Chris!

Ok, I ran your script in the /etc/init.d directory as root. I had similar
results as before:

After executing the script like this: ./SQLAnywhereService
I get the following:

:command not founde: line 9
:command not founde: line 12
:command not founde: line 13
:command not founde: line 16
:command not founde: line 17
../SQLAnywhereService: line 18: syntax error near unexpected token '{
../SQLAnywhereService: line 18: 'start() {

I can run my init script just fine to manually start the server... I'm not
sure what the problem is... Any idea?

Thanks!

-Mike



"Chris Gruber" <chris.gruber@ianywhere.com> wrote in message
news:42f39449$1@foru
ms-1-dub...
> The service script may be getting you as you may not have the gprintf
> function. Try the following SQLAnywhereService script.
>
>
> Chris Gruber
> iAnywhere Solutions
>
> #!/bin/sh
> #
> # Startup script for Adaptive Server Anywhere Service
> #
> # chkconfig: 2345 20 80
> # description: SQL Anywhere's Adaptive Server Anywhere (dbsrv9)
> # is a SQL database server.
> # processname: dbsrv9
>
> # Source function library.
> #. /etc/rc.d/init.d/functions
>
>
> # The following are brief examples of how to have SQL Anywhere
> # Start and stop from the system.
>
>
> start() {
>
>
> echo "Attempting to start Adaptive Server Anywhere"
> echo $*
> /opt/sybase/SYBSsa9/SQLAnywhereService.init
>
> }
> stop() {
>
> echo "Attempting to stop Adaptive Server Anywhere"
> /opt/sybase/SYBSsa9/SQLAnywhereService.fini
>
> }
> restart() {
>
> echo "Attempting to restart Adaptive Server Anywhere"
> /opt/sybase/SYBSsa9/SQLAnywhereService.fini
> /opt/sybase/SYBSsa9/ SQLAnywhereService.init
>
> }
>
> case "$1" in
>
>
> start)
>
> start
> ;;
>
> stop)
>
> stop
> ;;
>
> restart|reload)
>
> restart
> ;;
>
> *)
>
> gprintf "Usage: %s & #123;start|stop|rest
art}\n" "$0"
> exit 1
>
> esac
> exit 0
> "Mike D." < nospam_mdunn@spiritp
os.com_nospam> wrote in message
> news:42f2770b$1@foru
ms-1-dub...
> able
>
>



Greg Fenton

2005-08-10, 3:23 am

Mike D. wrote:
> After executing the script like this: ./SQLAnywhereService
> I get the following:
>
> :command not founde: line 9
> :command not founde: line 12
> :command not founde: line 13
> :command not founde: line 16
> :command not founde: line 17
> ./SQLAnywhereService: line 18: syntax error near unexpected token '{
> ./SQLAnywhereService: line 18: 'start() {
>


Make sure that the file is a "Unix" file and not a "DOS" file (that is,
lines should end with \n, not \r\n).

You can check whether this is the case with the command:

od -c ./SQLAnywhereService

Many systems have the command "dos2unix" that can convert the file's
line endings to the Right Way. If not a simple Perl script can do the
deed too.

Hope this helps,
greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
Mike D.

2005-08-29, 8:23 pm

Thanks Greg! That got me going!

-Mike

"Greg Fenton" <greg. fenton_NOSPAM_@ianyw
here.com> wrote in message
news:42f97039$1@foru
ms-2-dub...
> Mike D. wrote:
>
> Make sure that the file is a "Unix" file and not a "DOS" file (that is,
> lines should end with \n, not \r\n).
>
> You can check whether this is the case with the command:
>
> od -c ./SQLAnywhereService
>
> Many systems have the command "dos2unix" that can convert the file's line
> endings to the Right Way. If not a simple Perl script can do the deed
> too.
>
> Hope this helps,
> greg.fenton
> --
> Greg Fenton
> Consultant, Solution Services, iAnywhere Solutions
> --------
> Visit the iAnywhere Solutions Developer Community
> Whitepapers, TechDocs, Downloads
> http://www.ianywhere.com/developer/



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com