[Eisfair] Logical Link nach samba-Update verschwunden
Thomas Bork
tom at eisfair.org
Di Jun 2 19:54:08 CEST 2015
Am 02.06.2015 um 01:36 schrieb Hilmar Böhm:
> Ich denke, dass grundsätzlich Logical Links dieser Art keine Probleme
> machen dürften und dass das Problem im Post-Script des
> Samba-Update-Packages liegen müsste. Alle anderen Updates laufen in
> dieser Umgebung mit den über Log.Links ausgelagerten Verzeichnissen ja
> auch einwandfrei.
Das ist install.sh des Samba-Paketes:
#! /bin/sh
#----------------------------------------------------------------------------
# /tmp/install.sh - install samba
#
# Copyright (c) 2002-2015 Thomas Bork, tom(at)eisfair(dot)net
#
# Creation : 2002-02-13 tb
# Last Update: 2015-05-14 tb
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#----------------------------------------------------------------------------
. /var/install/include/eislib
package_name='samba'
isupdate='no'
updatefile='/var/install/config.d/samba-update.sh'
smbconffile='/etc/smb.conf'
conffile='/etc/config.d/samba'
smbpasswdfile='/etc/smbpasswd'
pdbeditbin='/usr/bin/pdbedit'
tdbsamfile='/etc/passdb.tdb'
lockdir='/var/lock/samba'
samba_version=`cat /usr/share/doc/$package_name/version`
samba_intversion=`/usr/sbin/smbd -V | cut -d' ' -f2`
samba_full_version="$samba_version ($samba_intversion)"
mecho --info "Installing new $package_name $samba_full_version ..."
if [ ! -d "$lockdir" ]
then
mkdir -p "$lockdir"
if [ $? -ne 0 ]
then
mecho --error "*** ERROR: cannot create directory $lockdir ***"
fi
fi
# samba 4.1.0
if [ ! -d /var/run/samba ]
then
mkdir -p /var/run/samba
if [ $? -ne 0 ]
then
mecho --error "*** ERROR: cannot create directory
/var/run/samba ***"
fi
fi
#if [ -d /tmp/tdbbackup ]
#then
# mv /tmp/tdbbackup /usr/share/doc/samba
#fi
cd /etc/rc2.d
ln -sf ../init.d/samba S70samba
ln -sf ../init.d/samba K30samba
ln -sf ../init.d/smbfs S72smbfs
ln -sf ../init.d/smbfs K28smbfs
cd /sbin
ln -sf ../usr/bin/smbmount mount.smbfs
ln -sf ../usr/sbin/mount.cifs mount.cifs
# removed in 2.7.0
#ln -sf ../usr/sbin/umount.cifs umount.cifs
# not in samba 4.1.0
#cd /lib
#ln -sf /lib/libnss_winbind.so /lib/libnss_winbind.so.2
#ln -sf /lib/libnss_wins.so /lib/libnss_wins.so.2
#cd /usr/lib
#ln -sf /usr/lib/libwbclient.so.0 /usr/lib/libwbclient.so
/sbin/ldconfig >/dev/null 2>&1
if [ -f "$conffile" ]
then
/var/install/bin/backup-file samba
fi
if [ -f "$smbconffile" ]
then
isupdate='yes'
/var/install/bin/backup-file $smbconffile sic
fi
if [ -f /etc/user.map ]
then
/var/install/bin/backup-file /etc/user.map sic
fi
if [ -f "$tdbsamfile" ]
then
/var/install/bin/backup-file "$tdbsamfile" sic
fi
# only do this, if smbpasswd is not empty
if [ -s "$smbpasswdfile" ]
then
/var/install/bin/backup-file "$smbpasswdfile" sic
if ! [ -f "$tdbsamfile" ]
then
echo "Converting smbpasswd to tdbsam and removing irregular
samba users ..."
smbpasswdimportfile='/tmp/smbpasswd.import'
rm -f $smbpasswdimportfile
while read smbpasswdline
do
userline=`echo "$smbpasswdline" | grep -v ']:LCT-00000000:'
| grep -v '^eis:0:' | grep -v '^halt:0:' | grep -v '^reboot:0:'`
if [ -n "$userline" ]
then
#echo "$userline"
echo "$userline" > $smbpasswdimportfile
/usr/bin/pdbedit -i smbpasswd:$smbpasswdimportfile -e
tdbsam:/etc/passdb.tdb
rm -f $smbpasswdimportfile
fi
done < $smbpasswdfile
fi
fi
# remove old /etc/smbpasswd but keep /etc/smbpasswd.sic
rm -f "$smbpasswdfile"
if [ -f /usr/sbin/cupsd ]
then
if [ ! -L /usr/lib/cups/backend/smb ]
then
echo "Linking smbspool as smb backend ..."
ln -sf /usr/bin/smbspool /usr/lib/cups/backend/smb
fi
fi
/var/install/bin/add-menu \
setup.services.menu \
setup.services.samba.menu \
"Samba"
"$updatefile" sample
if [ "$isupdate" = "no" ]
then
"$updatefile" generate
mecho --warn "Don't forget to configure samba in samba services menu!"
mecho --warn "Don't forget to configure samba users in samba
services menu!"
else
"$updatefile" update
if grep -q "SAMBA_PDF_TARGET='mail'" "$conffile"
then
base64='no'
if [ -e /var/install/packages/perl_mime_base64 ]
then
base64='yes'
fi
if [ -e /usr/bin/corelist ]
then
base64='yes'
fi
if [ "$base64" = "no" ]
then
mecho --warn "If you are using SAMBA_PDF_TARGET='mail', you
need the perl"
mecho --warn "package perl_mime_base64 now! This is an
additional module"
mecho --warn "for perl package 1.0.0 or part of the perl
package 1.2.0."
fi
fi
fi
#if [ -f /var/install/bin/update-nsswitch ]
#then
# echo 'hosts: files wins dns' >/etc/nsswitch.conf.samba
# chmod 0644 /etc/nsswitch.conf.samba
# chown root:root /etc/nsswitch.conf.samba
# /var/install/bin/update-nsswitch samba
#fi
if [ -f /var/install/bin/update-nsswitch ]
then
if [ -s /etc/nsswitch.conf.samba ] # /etc/nsswitch.conf.samba
vorhanden und nicht leer
then
mecho --info "Resetting /etc/nsswitch.conf to defaults ..."
>/etc/nsswitch.conf.samba
chmod 0644 /etc/nsswitch.conf.samba
chown root:root /etc/nsswitch.conf.samba
/var/install/bin/update-nsswitch samba
rm -f /etc/nsswitch.conf.samba
fi
fi
if `echo $LC_CTYPE | grep -qE
'[[:lower:]]{2}_[[:upper:]]{2}[[:punct:]]utf8|UTF-8'`
then
for convfile in /etc/check.d/samba.exp
/var/install/bin/samba-pdc-groupmapping
do
if `file $convfile | grep -q 'ISO-8859'`
then
echo "Converting $convfile to UTF-8 ..."
iconv -f ISO-8859-15 -t utf-8 $convfile -o /tmp/`basename
$convfile`.utf8
cp -pf /tmp/`basename $convfile`.utf8 $convfile
chown root:root $convfile
rm -f /tmp/`basename $convfile`.utf8
fi
done
chmod 0644 /etc/check.d/samba.exp
chmod 0744 /var/install/bin/samba-pdc-groupmapping
fi
sh /var/install/config.d/samba.sh
sh /etc/init.d/samba start
sh /etc/init.d/smbfs start
if [ -f /etc/webmin/start ]
then
/etc/webmin/start
fi
exit 0
--
der tom
[eisfair-team]
Mehr Informationen über die Mailingliste Eisfair