Results 1 to 6 of 6

Thread: ZimbraOsXAutoLauncher StartupItems Script & extras

  1. #1
    s3nz3x is offline Project Contributor
    Join Date
    Nov 2005
    Location
    proxima centaury
    Posts
    33
    Rep Power
    9

    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 Attached Files
    Last edited by s3nz3x; 11-28-2005 at 06:51 AM.

  2. #2
    s3nz3x is offline Project Contributor
    Join Date
    Nov 2005
    Location
    proxima centaury
    Posts
    33
    Rep Power
    9

    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.

  3. #3
    s3nz3x is offline Project Contributor
    Join Date
    Nov 2005
    Location
    proxima centaury
    Posts
    33
    Rep Power
    9

    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

  4. #4
    s3nz3x is offline Project Contributor
    Join Date
    Nov 2005
    Location
    proxima centaury
    Posts
    33
    Rep Power
    9

    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…)

  5. #5
    KevinH's Avatar
    KevinH is offline Expert Member
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    19

    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

  6. #6
    s3nz3x is offline Project Contributor
    Join Date
    Nov 2005
    Location
    proxima centaury
    Posts
    33
    Rep Power
    9

    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 210
    Last Post: 01-17-2012, 01:19 AM
  2. Changing Calendar Organizer script
    By snsparrish in forum Administrators
    Replies: 4
    Last Post: 05-02-2011, 04:41 AM
  3. Zimbra + Samba LDAP, cannot add winxp
    By fajarpri in forum Installation
    Replies: 4
    Last Post: 07-08-2007, 11:45 AM
  4. OSE rotating backup script
    By reckless2k2 in forum Installation
    Replies: 1
    Last Post: 07-04-2007, 04:55 AM
  5. Warning: Unresponsive script
    By yetdog in forum Administrators
    Replies: 5
    Last Post: 04-03-2006, 12:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •