]> git.saurik.com Git - apple/security.git/blob - SecurityServer/StartupItems/SecurityServer
Security-164.1.tar.gz
[apple/security.git] / SecurityServer / StartupItems / SecurityServer
1 #!/bin/sh
2
3 . /etc/rc.common
4
5 # we could make this optional, but the system depends on SecurityServer A LOT...
6
7 ConsoleMessage "Starting SecurityServer"
8
9 export DEBUGDEST=LOG_AUTHPRIV
10 #export DEBUGOPTIONS=thread,scope # only useful with
11 #export DEBUGSCOPE=-mutex # debug-enabled SecurityServers
12 /System/Library/CoreServices/SecurityServer -X
13
14 if [ ! -f /Library/Keychains/System.keychain -a -x /usr/sbin/systemkeychain ]; then
15 # no system keychain; make one
16 ConsoleMessage "Creating System Keychain"
17 if [ ! -d /Library/Keychains ]; then
18 mkdir -p /Library/Keychains
19 chown root.admin /Library/Keychains
20 chmod 755 /Library/Keychains # do NOT make this 775 -- Security!
21 fi
22 sleep 2 # give SecurityServer a chance to come up
23 /usr/sbin/systemkeychain -C
24 touch /Library/Keychains/.fixed
25
26 elif [ ! -f /Library/Keychains/.fixed -a -x /usr/sbin/systemkeychain ]; then
27 # temporary fix: replace broken (early) system keychains (missing db schema)
28 sleep 2
29 rm -f /Library/Keychains/System.keychain
30 /usr/sbin/systemkeychain -C
31 touch /Library/Keychains/.fixed
32 fi