# Inspired by: http://www.maciverse.com/the-case-of-the-slow-mac-and-how-to-fix-it.html # cf. man syslog, man syslogd and http://developer.apple.com/documentation/Darwin/Reference/ManPages/man8/syslogd.8.html /usr/bin/open -a Console # system.log /usr/bin/tail -n 50 /private/var/log/system.log help declare declare -x sudo=/usr/bin/sudo plistbuddy=/usr/libexec/PlistBuddy defaults=/usr/bin/defaults /usr/bin/env | /usr/bin/grep -E 'sudo=|plistbuddy=|defaults=' # create a symbolic link (on Mac OS X 10.4) help test /usr/bin/locate PlistBuddy if [[ ! -e /usr/libexec/PlistBuddy ]]; then $sudo /bin/ln -s "/Library/Receipts/AdditionalEssentials.pkg/Contents/Resources/PlistBuddy" /usr/libexec/PlistBuddy; fi # make a backup $sudo /bin/cp -p /System/Library/LaunchDaemons/com.apple.syslogd.plist /System/Library/LaunchDaemons/com.apple.syslogd.plist.orig # cf. http://developer.apple.com/documentation/Darwin/Reference/ManPages/man8/PlistBuddy.8.html $plistbuddy -h $plistbuddy -c Print /System/Library/LaunchDaemons/com.apple.syslogd.plist $plistbuddy -c "Print :ProgramArguments" /System/Library/LaunchDaemons/com.apple.syslogd.plist # compare $defaults read /System/Library/LaunchDaemons/com.apple.syslogd $defaults read /System/Library/LaunchDaemons/com.apple.syslogd ProgramArguments $sudo /usr/bin/nano /System/Library/LaunchDaemons/com.apple.syslogd.plist $sudo $plistbuddy -c "Delete :ProgramArguments" /System/Library/LaunchDaemons/com.apple.syslogd.plist $sudo $plistbuddy -c "Add :ProgramArguments array" /System/Library/LaunchDaemons/com.apple.syslogd.plist $sudo $plistbuddy -c "Add :ProgramArguments:0 string '/usr/sbin/syslogd'" /System/Library/LaunchDaemons/com.apple.syslogd.plist $sudo $plistbuddy -c "Add :ProgramArguments:1 string '-c'" /System/Library/LaunchDaemons/com.apple.syslogd.plist $sudo $plistbuddy -c "Add :ProgramArguments:2 integer 3" /System/Library/LaunchDaemons/com.apple.syslogd.plist # Mac OS X 10.5 #$sudo $plistbuddy -c "Add :ProgramArguments:3 string '-a'" /System/Library/LaunchDaemons/com.apple.syslogd.plist #$sudo $plistbuddy -c "Add :ProgramArguments:4 string '-db_max'" /System/Library/LaunchDaemons/com.apple.syslogd.plist #$sudo $plistbuddy -c "Add :ProgramArguments:5 integer 5000000" /System/Library/LaunchDaemons/com.apple.syslogd.plist $plistbuddy -c "Print :ProgramArguments" /System/Library/LaunchDaemons/com.apple.syslogd.plist $defaults read /System/Library/LaunchDaemons/com.apple.syslogd ProgramArguments $sudo /usr/bin/nano /System/Library/LaunchDaemons/com.apple.syslogd.plist # reset com.apple.syslogd.plist #if [[ -n $(/usr/bin/sw_vers -productVersion | /usr/bin/grep '^10.5') ]]; then exit; fi # exit if on Mac OS X 10.5.x $sudo /bin/rm -f /System/Library/LaunchDaemons/com.apple.syslogd.plist $sudo /bin/cp -p /System/Library/LaunchDaemons/com.apple.syslogd.plist.orig /System/Library/LaunchDaemons/com.apple.syslogd.plist $sudo /usr/bin/nano /System/Library/LaunchDaemons/com.apple.syslogd.plist # restart syslogd #$sudo /bin/launchctl unload -w /System/Library/LaunchDaemons/com.apple.syslogd.plist 2>/dev/null #/bin/sleep 3 #$sudo /bin/launchctl load -w /System/Library/LaunchDaemons/com.apple.syslogd.plist 2>/dev/null #$sudo /usr/bin/killall -HUP syslogd # alternative
Never been to CodeSnippets before?
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
Using PlistBuddy to customize syslogd (See related posts)
You need to create an account or log in to post comments to this site.
Related Posts
» Automated virus scanning wit... in shell osx mac launchd bash unix scan antivirus clamav launchagent virus automated
» ws - web search from the com... in shell osx mac search bash unix commandline web
» snippet in shell osx mac html bash unix commandline web download convert textutil
» Switching firewall settings ... in shell osx mac bash unix ipfw firewall ruleset switch
» Delete WebKit search fields in shell osx mac bash unix safari webkit
» pdftotext in shell osx mac bash unix pdf text convert
Snippets (source code soon to be available) developed by Peter Cooper and powered by Ruby On Rails