Comment out old upgrade scripts.
They are not needed anymore in F-11 as the new defaults have been there for the last 4 releases.
This commit is contained in:
parent
00392641d8
commit
9022334c9c
235
samba.spec
235
samba.spec
@ -482,121 +482,126 @@ fi
|
|||||||
%post common
|
%post common
|
||||||
/sbin/ldconfig
|
/sbin/ldconfig
|
||||||
|
|
||||||
# This script must be run always on installs or upgrades
|
###############################################################################
|
||||||
# it checks if a previous installation have created files
|
## We have new default since F-8, time to stop checking for old files are there
|
||||||
# under /var/cache/samba and move them in that case as the
|
## should be none in any support upgrade case
|
||||||
# new package wants them to be under /var/lib/samba for
|
## (keeping it commented just for reference for a while
|
||||||
# FHS compliance
|
##
|
||||||
#
|
## # This script must be run always on installs or upgrades
|
||||||
# - we must stop the dameon if running and restart it
|
## # it checks if a previous installation have created files
|
||||||
# after the script if it was
|
## # under /var/cache/samba and move them in that case as the
|
||||||
# - we do not overwrite newer files
|
## # new package wants them to be under /var/lib/samba for
|
||||||
# - even if /etc/init.d/smb is in samba and not
|
## # FHS compliance
|
||||||
# samba-common we need to stop smbd/nmbd, if they
|
## #
|
||||||
# are running, here as well, or we will mess up
|
## # - we must stop the dameon if running and restart it
|
||||||
# shared (between winbindd and smbd/nmbd) tdbs
|
## # after the script if it was
|
||||||
|
## # - we do not overwrite newer files
|
||||||
OLDPATH="/var/cache/samba"
|
## # - even if /etc/init.d/smb is in samba and not
|
||||||
NEWPATH="/var/lib/samba"
|
## # samba-common we need to stop smbd/nmbd, if they
|
||||||
|
## # are running, here as well, or we will mess up
|
||||||
eval ls $OLDPATH/*.tdb >/dev/null 2>&1
|
## # shared (between winbindd and smbd/nmbd) tdbs
|
||||||
if [ $? = 0 ]; then
|
##
|
||||||
eval testparm -s 2>/dev/null |grep "lock dir" >/dev/null
|
## OLDPATH="/var/cache/samba"
|
||||||
if [ $? = 0 ]; then
|
## NEWPATH="/var/lib/samba"
|
||||||
echo "Warning: lock dir explicitly set. Not moving tdb files to new default location"
|
##
|
||||||
else
|
## eval ls $OLDPATH/*.tdb >/dev/null 2>&1
|
||||||
|
## if [ $? = 0 ]; then
|
||||||
#Stop daemons before we move the files around
|
## eval testparm -s 2>/dev/null |grep "lock dir" >/dev/null
|
||||||
|
## if [ $? = 0 ]; then
|
||||||
#this is what condrestart checks as well
|
## echo "Warning: lock dir explicitly set. Not moving tdb files to new default location"
|
||||||
if [ -f /var/lock/subsys/winbindd ]; then
|
## else
|
||||||
/sbin/service winbind stop >/dev/null 2>&1 || :
|
##
|
||||||
# Use a dirty trick to fool condrestart later
|
## #Stop daemons before we move the files around
|
||||||
touch /var/lock/subsys/winbindd
|
##
|
||||||
fi
|
## #this is what condrestart checks as well
|
||||||
|
## if [ -f /var/lock/subsys/winbindd ]; then
|
||||||
if [ -f /var/lock/subsys/smb ]; then
|
## /sbin/service winbind stop >/dev/null 2>&1 || :
|
||||||
/sbin/service smb stop >/dev/null 2>&1 || :
|
## # Use a dirty trick to fool condrestart later
|
||||||
# We need to stop smbd here as we are moving also smbd owned files
|
## touch /var/lock/subsys/winbindd
|
||||||
# but we can't restart it until the new server is installed.
|
## fi
|
||||||
# Use a dirty trick to fool condrestart later
|
##
|
||||||
touch /var/lock/subsys/smb
|
## if [ -f /var/lock/subsys/smb ]; then
|
||||||
fi
|
## /sbin/service smb stop >/dev/null 2>&1 || :
|
||||||
|
## # We need to stop smbd here as we are moving also smbd owned files
|
||||||
if [ -f /var/lock/subsys/nmb ]; then
|
## # but we can't restart it until the new server is installed.
|
||||||
/sbin/service nmb stop >/dev/null 2>&1 || :
|
## # Use a dirty trick to fool condrestart later
|
||||||
# We need to stop smbd here as we are moving also smbd owned files
|
## touch /var/lock/subsys/smb
|
||||||
# but we can't restart it until the new server is installed.
|
## fi
|
||||||
# Use a dirty trick to fool condrestart later
|
##
|
||||||
touch /var/lock/subsys/nmb
|
## if [ -f /var/lock/subsys/nmb ]; then
|
||||||
fi
|
## /sbin/service nmb stop >/dev/null 2>&1 || :
|
||||||
|
## # We need to stop smbd here as we are moving also smbd owned files
|
||||||
eval ls $NEWPATH/*.tdb >/dev/null 2>&1
|
## # but we can't restart it until the new server is installed.
|
||||||
if [ $? = 0 ]; then
|
## # Use a dirty trick to fool condrestart later
|
||||||
#something strange here, lets backup this stuff and avoid just wiping it
|
## touch /var/lock/subsys/nmb
|
||||||
|
## fi
|
||||||
mkdir $NEWPATH.pkgbkp
|
##
|
||||||
mv -f $NEWPATH/*.tdb $NEWPATH.pkgbkp/ >/dev/null 2>&1
|
## eval ls $NEWPATH/*.tdb >/dev/null 2>&1
|
||||||
mv -f $NEWPATH/*.dat $NEWPATH.pkgbkp/ >/dev/null 2>&1
|
## if [ $? = 0 ]; then
|
||||||
mv -f $NEWPATH/perfmon $NEWPATH.pkgbkp/ >/dev/null 2>&1
|
## #something strange here, lets backup this stuff and avoid just wiping it
|
||||||
mv -f $NEWPATH/printing $NEWPATH.pkgbkp/ >/dev/null 2>&1
|
##
|
||||||
fi
|
## mkdir $NEWPATH.pkgbkp
|
||||||
|
## mv -f $NEWPATH/*.tdb $NEWPATH.pkgbkp/ >/dev/null 2>&1
|
||||||
mv -f $OLDPATH/*.tdb $NEWPATH/ >/dev/null 2>&1
|
## mv -f $NEWPATH/*.dat $NEWPATH.pkgbkp/ >/dev/null 2>&1
|
||||||
mv -f $OLDPATH/*.dat $NEWPATH/ >/dev/null 2>&1
|
## mv -f $NEWPATH/perfmon $NEWPATH.pkgbkp/ >/dev/null 2>&1
|
||||||
mv -f $OLDPATH/perfmon $NEWPATH/ >/dev/null 2>&1
|
## mv -f $NEWPATH/printing $NEWPATH.pkgbkp/ >/dev/null 2>&1
|
||||||
mv -f $OLDPATH/printing $NEWPATH/ >/dev/null 2>&1
|
## fi
|
||||||
|
##
|
||||||
fi
|
## mv -f $OLDPATH/*.tdb $NEWPATH/ >/dev/null 2>&1
|
||||||
fi
|
## mv -f $OLDPATH/*.dat $NEWPATH/ >/dev/null 2>&1
|
||||||
|
## mv -f $OLDPATH/perfmon $NEWPATH/ >/dev/null 2>&1
|
||||||
# We also moved private files from /etc/samba to
|
## mv -f $OLDPATH/printing $NEWPATH/ >/dev/null 2>&1
|
||||||
# /var/lib/samba/private so we need to migrate these as well
|
##
|
||||||
|
## fi
|
||||||
#secrets.tdb
|
## fi
|
||||||
if [ -f %{_sysconfdir}/samba/secrets.tdb ]; then
|
##
|
||||||
eval testparm -s 2>/dev/null |grep "private dir" >/dev/null
|
## # We also moved private files from /etc/samba to
|
||||||
if [ $? = 0 ]; then
|
## # /var/lib/samba/private so we need to migrate these as well
|
||||||
echo "Warning: private dir explicitly set. Not moving secrets.tdb to new default location"
|
##
|
||||||
else
|
## #secrets.tdb
|
||||||
if [ -f /var/lib/samba/private/secrets.tdb ]; then
|
## if [ -f %{_sysconfdir}/samba/secrets.tdb ]; then
|
||||||
mv -f /var/lib/samba/private/secrets.tdb /var/lib/samba/private/secrets.tdb.old
|
## eval testparm -s 2>/dev/null |grep "private dir" >/dev/null
|
||||||
fi
|
## if [ $? = 0 ]; then
|
||||||
mv -f %{_sysconfdir}/samba/secrets.tdb /var/lib/samba/private/secrets.tdb
|
## echo "Warning: private dir explicitly set. Not moving secrets.tdb to new default location"
|
||||||
fi
|
## else
|
||||||
fi
|
## if [ -f /var/lib/samba/private/secrets.tdb ]; then
|
||||||
|
## mv -f /var/lib/samba/private/secrets.tdb /var/lib/samba/private/secrets.tdb.old
|
||||||
#smbpasswd
|
## fi
|
||||||
if [ -f %{_sysconfdir}/samba/smbpasswd ]; then
|
## mv -f %{_sysconfdir}/samba/secrets.tdb /var/lib/samba/private/secrets.tdb
|
||||||
eval testparm -s 2>/dev/null |grep "smb passwd file" >/dev/null
|
## fi
|
||||||
if [ $? = 0 ]; then
|
## fi
|
||||||
echo "Warning: smbpasswd file location explicitly set. Not moving smbpasswd to new default location"
|
##
|
||||||
else
|
## #smbpasswd
|
||||||
if [ -f /var/lib/samba/private/smbpasswd ]; then
|
## if [ -f %{_sysconfdir}/samba/smbpasswd ]; then
|
||||||
mv -f /var/lib/samba/private/smbpasswd /var/lib/samba/private/smbpasswd.old
|
## eval testparm -s 2>/dev/null |grep "smb passwd file" >/dev/null
|
||||||
fi
|
## if [ $? = 0 ]; then
|
||||||
mv -f %{_sysconfdir}/samba/smbpasswd /var/lib/samba/private/smbpasswd
|
## echo "Warning: smbpasswd file location explicitly set. Not moving smbpasswd to new default location"
|
||||||
fi
|
## else
|
||||||
fi
|
## if [ -f /var/lib/samba/private/smbpasswd ]; then
|
||||||
|
## mv -f /var/lib/samba/private/smbpasswd /var/lib/samba/private/smbpasswd.old
|
||||||
#passdb.tdb
|
## fi
|
||||||
if [ -f %{_sysconfdir}/samba/passdb.tdb ]; then
|
## mv -f %{_sysconfdir}/samba/smbpasswd /var/lib/samba/private/smbpasswd
|
||||||
eval testparm -s 2>/dev/null |grep "private dir" >/dev/null || testparm -s 2>/dev/null |grep -P "^\s*passdb\s*backend\s*=.*tdbsam:/etc/samba/passdb.tdb.*"
|
## fi
|
||||||
if [ $? = 0 ]; then
|
## fi
|
||||||
echo "Warning: passdb.tdb location explicitly set. Not moving passdb.tdb to new default location"
|
##
|
||||||
else
|
## #passdb.tdb
|
||||||
if [ -f /var/lib/samba/private/passdb.tdb ]; then
|
## if [ -f %{_sysconfdir}/samba/passdb.tdb ]; then
|
||||||
mv -f /var/lib/samba/private/passdb.tdb /var/lib/samba/private/passdb.tdb.old
|
## eval testparm -s 2>/dev/null |grep "private dir" >/dev/null || testparm -s 2>/dev/null |grep -P "^\s*passdb\s*backend\s*=.*tdbsam:/etc/samba/passdb.tdb.*"
|
||||||
fi
|
## if [ $? = 0 ]; then
|
||||||
mv -f %{_sysconfdir}/samba/passdb.tdb /var/lib/samba/private/passdb.tdb
|
## echo "Warning: passdb.tdb location explicitly set. Not moving passdb.tdb to new default location"
|
||||||
fi
|
## else
|
||||||
fi
|
## if [ -f /var/lib/samba/private/passdb.tdb ]; then
|
||||||
|
## mv -f /var/lib/samba/private/passdb.tdb /var/lib/samba/private/passdb.tdb.old
|
||||||
#remove schannel_store if existing, it is not info we need to keep across restarts
|
## fi
|
||||||
if [ -f %{_sysconfdir}/samba/schannel_store.tdb ]; then
|
## mv -f %{_sysconfdir}/samba/passdb.tdb /var/lib/samba/private/passdb.tdb
|
||||||
rm -f %{_sysconfdir}/samba/schannel_store.tdb
|
## fi
|
||||||
fi
|
## fi
|
||||||
|
##
|
||||||
|
## #remove schannel_store if existing, it is not info we need to keep across restarts
|
||||||
|
## if [ -f %{_sysconfdir}/samba/schannel_store.tdb ]; then
|
||||||
|
## rm -f %{_sysconfdir}/samba/schannel_store.tdb
|
||||||
|
## fi
|
||||||
|
##
|
||||||
%preun winbind
|
%preun winbind
|
||||||
if [ $1 = 0 ] ; then
|
if [ $1 = 0 ] ; then
|
||||||
/sbin/service winbind stop >/dev/null 2>&1 || :
|
/sbin/service winbind stop >/dev/null 2>&1 || :
|
||||||
|
Loading…
Reference in New Issue
Block a user