HOW TO: Get Servoy Server to Start on Mac OS X

Find out how to get things done with Servoy. Post how YOU get things done with Servoy

HOW TO: Get Servoy Server to Start on Mac OS X

Postby swingman » Mon Mar 07, 2005 2:48 pm

Hi all,
I have had problems to get Servoy server to start on its own on Mac OS X using Startup Items. Servoy seems to start before Sybase is ready.

Someone suggested writing an AppleScript to get around this. You can execute the AppleScripts at startup by saving them as Applications, Adding them to the "Startup Items" in "Accounts" System Preference Panel.

The scripts assumes you have worked out how to start the database holding your Servoy Repository and any other databases you need to use. Marc Liyanage's site www.entropy.ch has startup items for mySQL and PostgreSQL.

Applescript to Start Servoy when repository is in Sybase:

Code: Select all
on idle
   copy (do shell script "ps axU root") to t
   -- get list of processes owned by root
   -- look for Sybase ASA
   if t contains "dbsrv9" then
      -- delay 30 secs to make sure Sybase has started
      delay 30
      -- Start Servoy, ignoring any results
      -- Replace YOURPASSWORDHERE with your root password.
              -- Maybe this a security risk?
      do shell script "/Applications/Servoy/servoy_server.sh > /dev/null 2>&1 &" password "YOURPASSWORDHERE" with administrator privileges
              -- quit the script
      quit me
   end if
end idle


When repository is in PostgreSQL:

Code: Select all
on idle
   copy (do shell script "ps axU postgres") to t
       -- PostgreSQL starts a number of different processes
   if t contains "postmaster" and t contains "postgres" then
          delay 30
-- Replace YOURPASSWORDHERE with your root password.
      do shell script "/Applications/Servoy/servoy_server.sh > /dev/null 2>&1 &" password "YOURPASSWORDHERE" with administrator privileges
              -- quit the script
      quit me
   end if
end idle


These seem to work fine.
Any suggestions for improvements appreciated.
User avatar
swingman
 
Posts: 1472
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Return to How To

Who is online

Users browsing this forum: No registered users and 7 guests