Adapt chroot setup to work on x86_64 and SME9

tags/smeserver-altqmail-0.1.1-1 0.1.1_el5
Daniel Berteaud 10 years ago
parent 195882e5fd
commit 332782bc13
  1. 2
      root/var/service/altqmail/finish
  2. 36
      root/var/service/altqmail/run

@ -2,4 +2,4 @@
umount /var/service/altqmail/root/var/qmail/bin umount /var/service/altqmail/root/var/qmail/bin
rm -rf root/etc rm -rf root/etc
rm -rf root/lib rm -rf root/lib{,64}

@ -2,7 +2,7 @@
exec 2>&1 exec 2>&1
mount --bind /var/qmail/bin/ root/var/qmail/bin /bin/mount --bind /var/qmail/bin/ root/var/qmail/bin
if [ ! -d root/etc ]; then if [ ! -d root/etc ]; then
mkdir root/etc mkdir root/etc
@ -12,16 +12,29 @@ if [ ! -d root/etc ]; then
cp -a /etc/group root/etc cp -a /etc/group root/etc
fi fi
if [ ! -d root/lib ]; then LIBDIR="lib"
mkdir root/lib LIBC="2.5"
cp -a /lib/libc-2.5.so root/lib if [ -d /lib64 ]; then
ln -s libc-2.5.so root/lib/libc.so.6 LIBDIR="lib64"
cp -a /lib/ld-2.5.so root/lib/ fi
ln -s ld-2.5.so root/lib/ld-linux.so.2 if [ -e /$LIBDIR/libc-2.12.so ]; then
cp -a /lib/libnss_files-2.5.so root/lib LIBC="2.12"
ln -s libnss_files-2.5.so root/lib/libnss_files.so.2 fi
cp -a /lib/libresolv-2.5.so root/lib
ln -s libresolv-2.5.so root/lib/libresolv.so.2 if [ ! -d root/$LIBDIR ]; then
mkdir root/$LIBDIR
cp -a /$LIBDIR/libc-$LIBC.so root/$LIBDIR
ln -s libc-$LIBC.so root/$LIBDIR/libc.so.6
cp -a /$LIBDIR/ld-$LIBC.so root/$LIBDIR
if [ -d /lib64 ]; then
ln -s ld-$LIBC.so root/$LIBDIR/ld-linux-x86-64.so.2
else
ln -s ld-$LIBC.so root/$LIBDIR/ld-linux.so.2
fi
cp -a /$LIBDIR/libnss_files-$LIBC.so root/$LIBDIR
ln -s libnss_files-$LIBC.so root/$LIBDIR/libnss_files.so.2
cp -a /$LIBDIR/libresolv-$LIBC.so root/$LIBDIR
ln -s libresolv-$LIBC.so root/$LIBDIR/libresolv.so.2
fi fi
chown qmails:qmail root/var/qmail/queue/lock/trigger chown qmails:qmail root/var/qmail/queue/lock/trigger
@ -31,3 +44,4 @@ exec \
/usr/bin/env - PATH="/var/qmail/bin:/bin:/usr/bin:/usr/local/bin" \ /usr/bin/env - PATH="/var/qmail/bin:/bin:/usr/bin:/usr/local/bin" \
/usr/sbin/chroot root /var/qmail/bin/qmail-start \ /usr/sbin/chroot root /var/qmail/bin/qmail-start \
./Maildir/ ./Maildir/

Loading…
Cancel
Save