Deploying Servoy 2.0 on Mac OS X

It would be really great if someone can post a complete ‘how-to’ with screenshots showing how to deploy Servoy server on Mac OS X – do we need to use of Sybase Central for anything?

Also: how to set up a Mac OS X startup item for Servoy. One which works… there was a tread a few weeks back, but this solution no longer works.

I need to deploy a solution soon…

To deploy Servoy Server on Mac: just run the default installer. The server can then be started using the servoy_server.sh script or by creating a startup item.

the thread on startupitems is still correct, it’s just quite difficult to do startupitems on Mac. We’re looking at integrating it in the installer but it ain’t easy.

I have tried creating a startup item, but the server refuses to start.

By the way, if I manually try to run in the shell

swingman% cd /Applications/Servoy/
[Mac:/Applications/Servoy] swingman% servoy_server.sh

There is a delay, but I can’t see any new processes starting in the processviewer, and localhost:8080 does not work.

The problem is that I need to set this up on a server at a client. We are currently running Developer in demo-mode and are therefore unable to enter their serial number :-(

Is there a ‘unix’ file somewhere where I can add a command to get the server to start when the Mac starts?

In comparison, installing on Windows as a service is soooo easy. It works really well.

Have a look at this thread:

http://forum.servoy.com/viewtopic.php?t=1487

Make sure to read the entire thread before starting.

OK, I have gone through this again and I think the actual startup item is working. But the servoy_server.sh fails because I need to start Sybase first. (It all works if I first start the databases manually with EngineConsole of SybaseCentral)

What is the easiest way of getting Sybase to start automatically, preferrably executing the sybase.config… ?

I now have working startup items for both Servoy and SQLAnywhere. And I get them to execute in the right order. My SQLAnywhere startup item starts one database, the repository.

The problem is that the Servoy one executes too early, before the SQLAnywhere startup item has finished starting the repository :-(

Any ideas?

swingman:
I now have working startup items for both Servoy and SQLAnywhere. And I get them to execute in the right order. My SQLAnywhere startup item starts one database, the repository.

The problem is that the Servoy one executes too early, before the SQLAnywhere startup item has finished starting the repository :frowning:

Any ideas?

How did you build the startupitems: I’d like to use this feature too?

Regarding your problem, If Servoy starts too early, you can consider controll the process with AScript, putting a delay before the launch of Servoy app…

Riccardino:
How did you build the startupitems: I’d like to use this feature too?

Ciao Ric,

Apple provide the following documentation:

http://developer.apple.com/documentatio … /TPXREF113

For the Servoy Startup Item there is a topic already, and a downloadable startupitem. You will need to modify it a little.

Sybase has a page explaining how to write a SQLAnywhere startup item: http://eshop.sybase.com/detail/1,6904,1032393,00.html

To create SQLAnywhere, I duplicated the Servoy startup item by dragging it to my desktop and renamed the files. After chnaging the code, I dropped it back into the startupitems directory.

I used SubEthaEdit :-) to edit the files since you can set it create files with Unix line endings. The code for SQLAnywhere (My Servoy 2.1 is inside a directory called Servoy_2.1, so you will need to change this in all the files below):

#!/bin/sh 


##
# SQLAnywhere
##


. /etc/rc.common



StartService ()
{

/Applications/Servoy_2.1/sybase_db/SQLAny.init
ConsoleMessage -s "Starting SQLAnywhere services"
}


StopService ()
{


/Applications/Servoy_2.1/sybase_db/SQLAny.fini
ConsoleMessage -s "Stopping SQLAnywhere services"
}
RestartService ()
{
/Applications/Servoy_2.1/sybase_db/SQLAny.fini
/Applications/Servoy_2.1/sybase_db/SQLAny.init
ConsoleMessage -s "Restarting SQLAnywhere services"
}


RunService $*

My StartupParameters.plist is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Description</key>
	<string>SQLAnywhere DB Server</string>
	<key>Messages</key>
	<dict>
		<key>start</key>
		<string>Starting SQLAnywhere</string>
		<key>stop</key>
		<string>Stopping SQLAnywhere</string>
	</dict>
	<key>OrderPreference</key>
	<string>Early</string>
	<key>Provides</key>
	<array>
		<string>SQLAnywhere</string>
	</array>
	<key>Requires</key>
	<array>
		<string>Disks</string>
		<string>Network</string>
		<string>Resolver</string>
	</array>
</dict>
</plist>

I also changed the StartupParameters.plist for Servoy so it now requires “SQLAnywhere”.

Then I created a file called SQLAny.init which I saved in the Applications/Servoy_2.1/sybase_db directory. The only database I need to start is the servoy repository, the other data I use for my project is on a remote server.

 . /Applications/SQLAnywhere9/System/bin/asa_config.sh > /dev/null
 # The following command must be entered all on one line.
 dbsrv9 -n ASA -gd all -ud -o /var/log/englog /Applications/Servoy_2.1/database/servoy_repository.db

My SQLAny.fini does not work, but it should not affect startup:

. /Applications/Servoy_2.1/sybase_db/sybase.config > /dev/null
/Applications/Servoy_2.1/sybase_db/dbstop -c "uid=dba;pwd=sql;eng=ASA" > /dev/null

You will need to chmod these two files to make them into executables.

Then restart your Mac, go to “About this Mac” in the Apple menu and click “More Info…” Select the system.log in logs and see if your items have worked.[/url]

Thanks a lot and congratulations :-)

Hai, I am ‘playing’ with this issue too.

Swingman, what do you mean with

I also changed the StartupParameters.plist for Servoy so it now requires “SQLAnywhere”.

in your last post? I don’t quite understand. Can you give the example script for it?

Thanks

And, what about this one:

. /Applications/SQLAnywhere9/System/bin/asa_config.sh > /dev/null 
# The following command must be entered all on one line. 
dbsrv9 -n ASA -gd all -ud -o /var/log/englog /Applications/Servoy_2.1/database/servoy_repository.db

I don’t have SQLAnywhere installed other than through Servoy (SQLAnywhere and Macromedia installs don’t mix somehow) so what should it look like in that case? Any ideas?

Hi Marcel,

here is my StartupParameters.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Description</key>
	<string>Servoy</string>
	<key>Messages</key>
	<dict>
		<key>start</key>
		<string>Starting Servoy</string>
		<key>stop</key>
		<string>Stopping Servoy</string>
	</dict>
	<key>OrderPreference</key>
	<string>Last</string>
	<key>Provides</key>
	<array>
		<string>Servoy</string>
	</array>
	<key>Requires</key>
	<array>
		<string>SQLAnywhere</string>
	</array>
</dict>
</plist>

You are right about SQLAny.init script assuming that SQLAnywhere is installed. Maybe you can work out what asa_config.sh is doing, so we can remove the reference to it or somehow eliminate the dependency:

#!/bin/sh	
#
echo iAnywhere Solutions, Inc. One Sybase Drive, Dublin, CA 94568, USA
echo Copyright 1988-2003 Sybase Inc. Portions Copyrighted 2003, iAnywhere Solutions,
echo Inc. All rights preserved. All unpublished rights reserved.
echo 

# comment the following lines to remove Sybase Central from your path.
PATH="/Applications/SQLAnywhere9/System/shared/sybcentral42:$PATH"
export PATH

# comment the following lines to remove ASA binaries from your PATH
PATH="/Applications/SQLAnywhere9/System/bin:$PATH"
export PATH
DYLD_LIBRARY_PATH="/Applications/SQLAnywhere9/System/lib:$DYLD_LIBRARY_PATH"
export DYLD_LIBRARY_PATH

export DYLD_BIND_AT_LAUNCH=1

# comment the following lines to unset the ASA location.
ASANY9="/Applications/SQLAnywhere9/System"
export ASANY9

# comment the following lines to unset the shared directory location.
ASANYSH9="/Applications/SQLAnywhere9/System/shared"
export ASANYSH9

As far as I remember I got stuck because Servoy Server starts to early, before Sybase has had the time to open the repository.

So I have a client running a small Servoy system in demo mode… we are not able to input the license key :frowning:

Good luck,
Hope you find a solution!

OK, I think it is time by now to close this thread. Today or tomorrow I will write an article in Servoy Magazine to show how you can make an ASA/Servoy StartupItem on Mac OS X.

Anyway, with the help of Jan Aleman I got it working :D

Looking forward to seing the article :slight_smile:
Thank you for looking into this problem!

You can find the article here http://www.servoymagazine.com