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]