#!/bin/sh
. /etc/rc.common
ConsoleMessage "Starting SecurityServer"
export DEBUGDEST=LOG_AUTHPRIV
/System/Library/CoreServices/SecurityServer -X
if [ ! -f /Library/Keychains/System.keychain -a -x /usr/sbin/systemkeychain ]; then
ConsoleMessage "Creating System Keychain"
if [ ! -d /Library/Keychains ]; then
mkdir -p /Library/Keychains
chown root.admin /Library/Keychains
chmod 755 /Library/Keychains fi
sleep 2 /usr/sbin/systemkeychain -C
touch /Library/Keychains/.fixed
elif [ ! -f /Library/Keychains/.fixed -a -x /usr/sbin/systemkeychain ]; then
sleep 2
rm -f /Library/Keychains/System.keychain
/usr/sbin/systemkeychain -C
touch /Library/Keychains/.fixed
fi