Mac OS Lion服务器上的“密码服务器:已停止”。 在启动过程中出现错误-1

由于我已经从存档中恢复了开放目录,因为我的服务器崩溃,数据库已损坏。 密码服务器不再启动。 日志看起来像这样:

Feb 14 2012 21:41:20 156746us Mac OS X Password Service version 376.1 (pid = 2438) was started at: Tue Feb 14 21:41:20 2012. Feb 14 2012 21:41:20 156801us RunAppThread Created Feb 14 2012 21:41:20 156852us RunAppThread Started Feb 14 2012 21:41:20 156879us Initializing Server Globals ... Feb 14 2012 21:41:20 163094us Initializing Networking ... Feb 14 2012 21:41:20 163196us Initializing TCP ... Feb 14 2012 21:41:20 191790us SASL is using realm "SERVER.HOME.POST-NET.CH" Feb 14 2012 21:41:20 191847us Starting Central Thread ... Feb 14 2012 21:41:20 191860us Starting other server processes ... Feb 14 2012 21:41:20 191873us StartCentralThreads: 1 threads to stop Feb 14 2012 21:41:20 191905us Initializing TCP ... Feb 14 2012 21:41:20 191954us Starting TCP/IP Listener on ethernet interface, port 106 Feb 14 2012 21:41:20 192012us Starting TCP/IP Listener on ethernet interface, port 3659 Feb 14 2012 21:41:20 192048us Starting TCP/IP Listener on interface lo0, port 106 Feb 14 2012 21:41:20 192082us Starting TCP/IP Listener on interface lo0, port 3659 Feb 14 2012 21:41:20 192117us StartCentralThreads: Created 4 TCP/IP Connection Listeners Feb 14 2012 21:41:20 192132us Starting UNIX domain socket listener /var/run/passwordserver Feb 14 2012 21:41:20 193034us CRunAppThread::StartUp: caught error -1. Feb 14 2012 21:41:20 193056us ** ERROR: The Server received an error during startup. See error log for details. Feb 14 2012 21:41:20 193075us RunAppThread::StartUp() returned: 4294967295 Feb 14 2012 21:41:20 193107us Stopping server processes ... Feb 14 2012 21:41:20 193119us Stopping Network Processes ... Feb 14 2012 21:41:20 193131us Deinitializing networking ... Feb 14 2012 21:41:20 193149us Server Processes Stopped ... Feb 14 2012 21:41:20 193165us RunAppThread Stopped Feb 14 2012 21:41:20 193202us Aborting Password Service. See error log. 

错误日志重复以下内容:

 Feb 14 2012 21:41:50 409022us Server received error -1 during startup. Feb 14 2012 21:41:50 409141us Aborting Password Service. 

任何人有一个想法这里有什么问题,我该如何解决这个问题?

我有这个问题。 这不是密码服务 – 这是一个损坏的LDAP数据库。

http://www.iredmail.org/forum/topic3694-iredmail-support-power-cut-ldap-dont-sta rt.html https://discussions.apple.com/thread/4149695?start=0&tstart=0

这是我做的。

  1. 检查这是否是问题

     $ sudo /usr/libexec/slapd -Tt >> bdb_db_open: database "cn=authdata": db_open(/var/db/openldap/authdata/id2entry.bdb) failed: Invalid argument (22). 
  2. 在OD Master上停止LDAP

     $ sudo launchctl unload /System/Library/LaunchDaemons/org.openldap.slapd.plist 
  3. 修复权限

     $ diskutil repairPermissions / 
  4. 备份openldap数据库

     $ sudo cp /var/db/openldap/authdata/id2entry.bdb /var/db/openldap/authdata/id2entry.bdb.backup 
  5. 修理

     $ sudo db_recover -cv -h /var/db/openldap/openldap-data/ >> Recovery complete at Thu Jun 6 11:01:35 2013 >> Maximum transaction ID 8000060e Recovery checkpoint [2][6589846] 
  6. 再次运行修复检查

     $ sudo db_recover -cv -h /var/db/openldap/openldap-data/ >> Finding last valid log LSN: file: 2 offset 6589938 >> Recovery starting from [1][28] >> Recovery complete at Thu Jun 6 11:02:32 2013 >> Maximum transaction ID 8000060e Recovery checkpoint [2][6589938]` 
  7. 仔细检查一下是否修好了

     $ sudo /usr/libexec/slapd -Tt >> bdb_monitor_db_open: monitoring disabled; configure monitor database to enable 

    configuration文件testing成功

  8. 重新启动服务

     $ sudo launchctl load /System/Library/LaunchDaemons/org.openldap.slapd.plist 

过去我遇到类似的问题,通常通过从Time Machine备份中replace/ var / db / openldap的全部内容来解决这个问题。

确保首先停止ldap:

sudo launchctl unload /System/Library/LaunchDaemons/org.openldap.slapd.plist

然后对于CYA,将/ var / db / openldap中的所有内容复制到您select的位置。 然后删除/ var / db / openldap中的三个文件夹。

从/ var / db / openldap目录打开Time Machine,并从已知的工作date/时间恢复3个文件夹。

开始ldap:

sudo launchctl load /System/Library/LaunchDaemons/org.openldap.slapd.plist

为了好的措施重新启动,一切通常恢复正常。