Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Installation

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-26-2005, 04:45 PM
Project Contributor
 
Posts: 33
Arrow ZimbraOsXAutoLauncher StartupItems Script & extras

this is a followup of this thread:
MacOs X "10.4.3/java1.5/zimbra" install step-by-step

My first script :) …
[Working on mac OsX 10.4.3]

Well it took me some time… And finally made a script to AutoLaunch zimbra @ startup.

I you want to use it: do it at your own risks.
I've not checked security issues yet…and they maybe some regarding your policy as admin

I don't really know how zimbra gets launched on Other Os, but on OsX, @ least, I, have to log in the user zimbra and fire up a terminal window zmcontrol start, to get it launched.
After digging around mostly on Macosxhints.com & Apple.com I have wrote StartupItems.
Now I just power up the Mac and I can go. No need to log in, nor go in the terminal anymore… ;-) I love this.

ZimbraOsXAutoLauncher StartupItems.

you'll download a.dmg file (140kb) with everything inside :
a folder ZIMBRALAUNCH and inside the script and the StartupParameters.plist file. and a Readme file to install it.

I've put it in
/system/Library/StartupItems/ZIMBRALAUNCH/
/system/Library/StartupItems/ZIMBRALAUNCH/ZIMBRALAUNCH
/system/Library/StartupItems/ZIMBRALAUNCH/StartupParameters.plist

you may put them in :(as root)
/Library/StartupItems/ZIMBRALAUNCH/
/Library/StartupItems/ZIMBRALAUNCH/ZIMBRALAUNCH
/Library/StartupItems/ZIMBRALAUNCH/StartupParameters.plist

then in terminal:
cd /system/Library/StartupItems/ZIMBRALAUNCH/
then
chmod 755 ../*
then
chmod +x /ZIMBRALAUNCH

that's it.
# to check if it's working, get a new terminal window and type :
#
sudo SystemStarter start ZIMBRALAUNCH
#
# You should see some stuff on the screen. no need to interact.
#
# Once its Started type :
#
sudo SystemStarter restart ZIMBRALAUNCH
#
# You should see some stuff on the screen. no need to interact.
# I've noticed that when I invoque 'zmcontrol stop', I've always some error displaying… but that's ok.
# it will continue the script and restart tha whole stuff.
# it should and with :
Host macintosh.zimbratester.org
antispam Running
antivirus Running
ldap Running
logger Running
mailbox Running
mta Running
snmp Running
spell Running
#

Now you can reboot your mac.

Extras :
I've also made 3 executables that I've put in:
/usr/bin/
I named them:
zmautolaunch -> to launch zimbra (aka zmcontrol start)
zmautostop -> to stop zimbra (aka zmcontrol stop)
zmautostatus -> to check status (aka zmcontrol status)

I hear some of you saying what's the point if it's the same as zmcontrol ?

Well the point is 1: the same as the StartupItems,
I don't want to have to log in as zimbra to launch and check, etc…
And
2) as I've put this files in /usr/bin so it is accessible for everyone who knows the scripts are there (you can put it where you like) and you run it as Your user account no need to log in as zimbra… :-).
Now, I'm gonna to reinstall 2 or 3 time zimbra, so I can get sure I know the stuff. What I'm gonna do now that I've this scripts is that I'm gonna make the user zimbra with a UID lower than 501 so that it's gonna be invisible at login. A mac could run zimbra on it and user don't even know that it's on.…

for example :
I can check with Apple remote Desktop for instance the status of the zimbra server (zmautostatus). and in case restart it(zmautostop - zmautostart).
I'm gonna do a 4th one for restartfunction.

AS I can upload here a file, I've made a .zip
instead of a .dmg (from the finder).

for those that prefer copy-paste-customise …
Next post is the code that works like a charm for me.

AGAIN I ain't no programer it took some hours to get it working.
If anyone as improvments… go for it.
I also Have some ideas but as everything works here for me, I'll wait a little to test further.
This is very fresh I've been testing this the half day now and as it works I post here and upload the files.
AGAIN BAckup, bla bla, you're warned.
By the way I've scanned with ClamXAV the .zip… but you can still scan it again on your computer.

s3nz3x

opening my files to cut & paste in the next post right now
Attached Files
File Type: zip ZimbraOsXAutoLauncher-0.1.zip (33.0 KB, 353 views)

Last edited by s3nz3x; 11-28-2005 at 06:51 AM..
Reply With Quote
  #2 (permalink)  
Old 11-26-2005, 04:55 PM
Project Contributor
 
Posts: 33
Default script codes :

For the StartupItems

1st file:
The StartupParameters.plist:

--begining of file StartupParameters.plist ( from next line)




Description
ZimbraOsXAutoLauncher
Messages

start
Starting Zimbra
stop
Stopping Zimbra

OrderPreference
Last
Provides

ZIMBRALAUNCH

Requires



Uses

System Log
Resolver
Disks
NETWORK
DNS



-- end of file-- StartupParameters.plist ( to previous line)

2sd file:
the executable:
--begin of file--ZIMBRALAUNCH ( from next line)
#!/bin/sh

##### ZimbraOsXAutoLauncher v0.1
#
# by s3nz3x->I'm in NO WAY a programmer. USE THIS AT YOU OWN RISKS.
#
# ZimbraOsXAutoLauncher: a script to auto launch Zimbra Collaboration Suite at boot.
#
# I'm in NO WAY a programmer. USE THIS AT YOU OWN RISKS.
#
# s3nz3x
#
# The startupitems folder
# d /Library/StartupItems/ZIMBRALaunch/
# f /Library/StartupItems/ZIMBRALaunch/ZIBRALaunch ## this file ;-)
# f /Library/StartupItems/ZIMBRALaunch/StartupParameters.plist
#
##### ZimbraOsXAutoLauncher v0.1

. /etc/rc.common

StartService()
{
if [ "${ZIMBRALAUNCH:=-NO-}" = "-YES-" ]; then
ConsoleMessage "Starting ZIMBRALAUNCH" && echo "Starting ZIMBRALAUNCH" && echo "Starting ldap"
cd /opt/zimbra/bin/ ; sudo su - zimbra -c "ldap start ; zmcontrol start && zmcontrol status"
fi
}

StopService()
{
ConsoleMessage "Stopping ZIMBRALAUNCH" && echo "Stopping ZIMBRALAUNCH"
cd /opt/zimbra/bin/ ; sudo su - zimbra -c "zmcontrol stop"
}

RestartService()
{
ConsoleMessage "Restarting ZIMBRALAUNCH" && echo "Stopping ZIMBRALAUNCH NOW"
cd /opt/zimbra/bin/ ; sudo su - zimbra -c "zmcontrol stop"
ConsoleMessage "Restarting ZIMBRALAUNCH" && echo "Restarting ZIMBRALAUNCH" && echo "ReStarting ldap"
cd /opt/zimbra/bin/ ; sudo su - zimbra -c "ldap start ; zmcontrol start && zmcontrol status"
}

RunService "$1"

--end of file ZIMBRALAUNCH-- (to previous line)

a very small explaination.

I've noticed that (on my box) it's better too first launch ldap and then the other antivirus, mta, spell, etc…

you could remove the part:
ldap start ;
on everylines… you can test.
Reply With Quote
  #3 (permalink)  
Old 11-26-2005, 05:10 PM
Project Contributor
 
Posts: 33
Default

the StartupParameters.plist code doesn't display well.
so you should download the zip file and cut and paste from your mac.

Codes for the functions
zmautolaunch; zmautostop; zmautostatus; zmautorestart (to come);

zmautolaunch:
#!/bin/sh
#
##### ZimbraOsXAutoLauncher v0.1
#
# by s3nz3x->I'm in NO WAY a programmer. USE THIS AT YOU OWN RISKS.
#
# ZimbraOsXAutoLauncher: a script to auto launch Zimbra Collaboration Suite at boot.
#
# AGAIN : I'm in NO WAY a programmer. USE THIS AT YOU OWN RISKS.
#
# s3nz3x
#
# ZimbraOsXAutoLauncher v0.1

cd /opt/zimbra/bin/ ; sudo su - zimbra -c "ldap start && zmcontrol start && zmcontrol status"
--endoffile--zmautolaunch (prevouis line)

zmautostop
--begin of file--
#!/bin/sh
#
##### ZimbraOsXAutoLauncher v0.1
#
# by s3nz3x->I'm in NO WAY a programmer. USE THIS AT YOU OWN RISKS.
#
# ZimbraOsXAutoLauncher: a script to auto launch Zimbra Collaboration Suite at boot.
#
# AGAIN : I'm in NO WAY a programmer. USE THIS AT YOU OWN RISKS.
#
# s3nz3x
#
# ZimbraOsXAutoLauncher v0.1

cd /opt/zimbra/bin/ ; sudo su - zimbra -c "zmcontrol stop"
--end of file--zmautostop

zmautostatus:
--begin of file--
#!/bin/sh
#
##### ZimbraOsXAutoLauncher v0.1
#
# by s3nz3x->I'm in NO WAY a programmer. USE THIS AT YOU OWN RISKS.
#
# ZimbraOsXAutoLauncher: a script to auto launch Zimbra Collaboration Suite at boot.
#
# AGAIN : I'm in NO WAY a programmer. USE THIS AT YOU OWN RISKS.
#
# s3nz3x
#
# ZimbraOsXAutoLauncher v0.1

cd /opt/zimbra/bin/ ; sudo su - zimbra -c "zmcontrol status"
--end of file--zmautostatus

Hope it helps.
todos:
Check if the System could relaunch all this in case of hang up or crash ?
Will (maybe) work on it.

s3nz3x.

I've tested - start stop restart etc…
and meanwhile have successfully tested the connexions with:

Apple Mail.app: (Os X 10.4.1 & 10.4.3)
POP3
POP3s
imap
imaps
smtp
(smtps) -> some errors…
Exchange account
Microsoft Entourage

Safari can only read but not write…
Firefox only does the trick with the web browser login.

For the DarkSide:
I've successfully tested with : Microsoft Outlook Express on a W2k-sp4 box.

enjoy
Reply With Quote
  #4 (permalink)  
Old 11-26-2005, 05:16 PM
Project Contributor
 
Posts: 33
Talking

I'm paranoid:
Just Clone your disc or whatever backup before using this !!
-I'm gonna right now launch CarbonCopyCloner to save this working configuration.
So, Just do so… you're warned.

( even if It works very well for me…)
Reply With Quote
  #5 (permalink)  
Old 11-27-2005, 08:45 PM
Zimbra Employee
 
Posts: 4,792
Default

Thanks for looking at this. Before we could use this with Zimbra you'd need to sign a contrib agreement then fax and mail it in.

http://www.zimbra.com/license/contri...agreement.html
Reply With Quote
  #6 (permalink)  
Old 11-28-2005, 06:53 AM
Project Contributor
 
Posts: 33
Red face done

Quote:
Originally Posted by KevinH
Thanks for looking at this. Before we could use this with Zimbra you'd need to sign a contrib agreement then fax and mail it in.

http://www.zimbra.com/license/contri...agreement.html
I'm Impressed & honored…
I've signed the doc and just send by fax.
Regards
s3nz3x
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.