[CalendarServer-changes] [6917] CalendarServer/trunk/contrib/migration/calendarmigrator.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Feb 10 11:51:57 PST 2011


Revision: 6917
          http://trac.macosforge.org/projects/calendarserver/changeset/6917
Author:   sagen at apple.com
Date:     2011-02-10 11:51:57 -0800 (Thu, 10 Feb 2011)
Log Message:
-----------
Use serveradmin to start the service after migration (rather than launchd) so postgres and the other dependencies are loaded.

Modified Paths:
--------------
    CalendarServer/trunk/contrib/migration/calendarmigrator.py

Modified: CalendarServer/trunk/contrib/migration/calendarmigrator.py
===================================================================
--- CalendarServer/trunk/contrib/migration/calendarmigrator.py	2011-02-09 20:57:56 UTC (rev 6916)
+++ CalendarServer/trunk/contrib/migration/calendarmigrator.py	2011-02-10 19:51:57 UTC (rev 6917)
@@ -26,6 +26,7 @@
 import os
 import pwd
 import shutil
+import subprocess
 import sys
 
 from plistlib import readPlist, writePlist
@@ -42,6 +43,7 @@
 CARDDAVD_PLIST = "carddavd.plist"
 NEW_SERVER_ROOT = "/Library/Server/Calendar and Contacts"
 RESOURCE_MIGRATION_TRIGGER = "trigger_resource_migration"
+SERVER_ADMIN = "/usr/sbin/serveradmin"
 
 
 verbatimKeys = """
@@ -255,14 +257,13 @@
 
 def setRunState(options, enableCalDAV, enableCardDAV):
     """
-    Modify the launchd settings in the new system.
+    Use serveradmin to launch the service if needed.
     """
 
-    # Lion has no separate addressbook service, so just worry about caldav:
     if enableCalDAV or enableCardDAV:
-        setServiceStateDisabled(options.targetRoot, CALDAV_LAUNCHD_KEY, False)
-    else:
-        setServiceStateDisabled(options.targetRoot, CALDAV_LAUNCHD_KEY, True)
+        log("Starting service via serveradmin")
+        ret = subprocess.call([SERVER_ADMIN, "start", "calendar"])
+        log("serveradmin exited with %d" % (ret,))
 
 
 def triggerResourceMigration(newServerRootValue):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110210/c5cdab7f/attachment.html>


More information about the calendarserver-changes mailing list