hiteksoftware.com Forum Index hiteksoftware.com
User discussion forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Run as Service on MacOSX 10.4 using Launchd

 
Post new topic   Reply to topic    hiteksoftware.com Forum Index -> Platform specific issues
View previous topic :: View next topic  
Author Message
Robert
Site Admin


Joined: 25 May 2006
Posts: 1140

PostPosted: Mon Oct 08, 2007 9:28 am    Post subject: Run as Service on MacOSX 10.4 using Launchd Reply with quote

You can setup the Automize/AbleFtp/JaSFtp Engine to run as a Service on MacOSX 10.4 and later, using Launchd which is installed with MacOSX 10.4 (and later)

Steps to Create the Service:
1) Create a HitekService.plist file using TextEdit. (Sample plist file is shown below)
2) Place the file in '/Library/LaunchDaemons' folder. You should have administrative previliges on the machine and may have to authenticate to place the .plist file here.

IMPORTANT: DO NOT place the .plist file in '~/Library/LaunchAgents' , which is in your home directory.

Starting and Stopping the Service manually:
1) To start the service manually, use the launchctl command from a terminal:
sudo launchctl load /Library/LaunchDaemons/HitekService.plist
2) To stop the service, use :
sudo launchctl unload HitekService
3) To see the list of running services, use:
sudo launchctl list
(In the list, you will see HitekService if it is running)


Steps to test the service:
1) Create a Simple echo task (tasks menu / Misc menu)
2) Schedule it to run every 1 minute and test that it is running every mintue.
3) Restart your system
4) Wait for 3-5 minutes
5) Log on
6) Start up Automize/AbleFTP/JaSFTP user interface. Check from Activity log that echo task has been running for the past 3-5 minutes after startup.
7) Log off for 2-5 minutes
Cool Log back on and verify that the echo task has been running during log off.

NOTES:
1) The service is started with the 'root' account.
2) In the activity log, you will get a warning that engine username and user interface username are not the same.
3) If you stop the engine from user interface, the launchd service will start it up again! You have to stop the service using the launchctl command (see above)


Sample HitekService.plist file follows in next post.


Last edited by Robert on Thu Oct 11, 2007 1:20 pm; edited 3 times in total
Back to top
View user's profile Send private message
Robert
Site Admin


Joined: 25 May 2006
Posts: 1140

PostPosted: Mon Oct 08, 2007 10:00 am    Post subject: Reply with quote

HitekService.plist file listing is below.

1) Make sure to create this file using TextEdit in MacOSX.

2) replace: /Users/john_doe/Desktop/Automize7 with the correct full path to your Automize7 or AbleFTP7 or JaSFTP7 folder.

3) Also, shut down engine, open user interface, start engine, look into activity log and confirm that the java path is: /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/bin/java
You may have to edit as needed.

4) If you copy and paste this listing into TextEdit, make sure to delete all the whitespace between lines and then hit enter again. i.e. get the correct EOL characters

HitekService.plist file:
-----DO NOT INCLUDE THIS DOTTED LINE------------------------------------
<?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>Label</key>
<string>HitekService</string>
<key>OnDemand</key>
<false/>
<key>Program</key>
<string>/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/bin/java</string>
<key>ProgramArguments</key>
<array>
<string>-Xrs</string>
<string>-Dcom.apple.backgroundOnly=true</string>
<string>-cp</string>
<string>.:help:jh.jar:mail.jar:activation.jar:net.jar:jakoro.jar:maverick-all.jar:bsh.jar:hitek7.jar</string>
<string>com.hitek.engine.Engine</string>
</array>
<key>WorkingDirectory</key>
<string>/Users/john_doe/Desktop/Automize7</string>
</dict>
</plist>
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    hiteksoftware.com Forum Index -> Platform specific issues All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group