X-Git-Url: http://git.openafs.org/?p=openafs.git;a=blobdiff_plain;f=src%2Fpackaging%2FMacOS%2FOpenAFS.post_install;h=b9ef27b40c359a58c5b075e795020240df0566c5;hp=c840b1897708d23eb85e33fd52f679258761054d;hb=48ce41a447c354b8a20b769e4aa5b502ba5bcc09;hpb=6e8a145a55ab7e4474338e8bbdf8187e2d5991ac diff --git a/src/packaging/MacOS/OpenAFS.post_install b/src/packaging/MacOS/OpenAFS.post_install index c840b18..b9ef27b 100644 --- a/src/packaging/MacOS/OpenAFS.post_install +++ b/src/packaging/MacOS/OpenAFS.post_install @@ -32,12 +32,42 @@ if [ `grep /Network/afs cacheinfo` ]; then mv cacheinfo.new cacheinfo fi +# if the installer plugin generated ThisCell and/or CellAlias +# files, copy them in here +tmpthiscell=/private/tmp/org.OpenAFS.Install.ThisCell.$USER +tmpcellalias=/private/tmp/org.OpenAFS.Install.CellAlias.$USER +if [ -f $tmpthiscell ]; then + cp $tmpthiscell ThisCell + rm -f $tmpthiscell +fi +if [ -f $tmpcellalias ]; then + cp $tmpcellalias CellAlias + rm -f $tmpcellalias +fi + if [ ! -f ThisCell -a -f ThisCell.sample ]; then cp ThisCell.sample ThisCell fi -if [ ! -f config/afsd.options -a -f config/afsd.options.sample ]; then - cp config/afsd.options.sample config/afsd.options +# force reversion of 10.4 memcache mistake +rm -f config/afsd.options.broken +echo '-memcache -afsdb -stat 2000 -dcache 800 -daemons 3 -volumes 70 -dynroot -fakestat-all' > config/afsd.options.broken +if cmp -s config/afsd.options.broken config/afsd.options ; then + rm -f config/afsd.options +fi +rm -f config/afsd.options.broken + +# if the user hasn't changed these settings, then they should just use the new +# afsd.conf file +rm -f config/afsd.options.old +echo '-afsdb -stat 2000 -dcache 800 -daemons 3 -volumes 70 -dynroot -fakestat-all' >config/afsd.options.old +if cmp -s config/afsd.options.old config/afsd.options ; then + rm -f config/afsd.options +fi +rm -f config/afsd.options.old + +if [ ! -f config/afs.conf -a -f config/afs.conf.sample ]; then + cp config/afs.conf.sample config/afs.conf fi # testing case -- upgrading from pre 1.2.7, but .last file exists. @@ -86,12 +116,23 @@ if [ $majorvers -ge 7 ]; then # make config/settings.plist if it doesn't exist if [ ! -e config/settings.plist -a -e config/settings.plist.orig ]; then cp config/settings.plist.orig config/settings.plist + else + /usr/libexec/PlistBuddy -c "Add :Darwin:All:FSEvents bool" config/settings.plist && /usr/libexec/PlistBuddy -c "Set :Darwin:All:FSEvents true" config/settings.plist fi elif [ -e config/afssettings ]; then # turn off execution of afssettings chmod a-x config/afssettings fi -#here we should run tools which configure the client, and then if it's enabled: -/Library/StartupItems/OpenAFS/OpenAFS start +# properly, we should acquire a certificate from a real CA and ship +# signed binaries. for now, make Application Firewall (Security prefs pane) +# happy like this. See TN2206 +if [ $majorvers -lt 14 ]; then + if [ -f /usr/bin/codesign ]; then + codesign -s - /usr/sbin/afsd + fi +fi +#here we should run tools which configure the client, and then if it's enabled: +#start the new launchd daemon +launchctl load -w /Library/LaunchDaemons/org.openafs.filesystems.afs.plist