Aneesh Kumar K.V
2002-05-16 07:53:02 UTC
Hi,
The attached patch correct some of the build issues that I faced on a
redhat machine. It takes the backup of all the files before it replaces
it with cluster files.
Why ?
configure_cluster didn't have execute permission and as a result on my
system( which doesn't have a shared storage ) it went and replaced the
fstab with the one came with cluster tools without leaving me a backup
. Similarly the network configuration files.
( while rebuilding the fstab file i made a mistake. This caused the
machine to crash during the next boot. and I had to create a custom
initial ram disk to get the machine back. It was actually pain. Having a
backup is always a good idea. ).
If the .old file is already there, no backup is taken .This prevent
rewriting already taken backup when i run make install again and again .
running uninstall in ssi dir ( deconfigure_cluster script is here
).This brings the system back to the old state.
If there is nothing wrong with the patch. I can do a checking.
-aneesh
Index: Makefile
===================================================================
RCS file: /cvsroot/ci-linux/cluster-tools/Makefile,v
retrieving revision 1.2
diff -r1.2 Makefile
62a63
===================================================================
RCS file: /cvsroot/ci-linux/cluster-tools/ssi/Makefile,v
retrieving revision 1.6
diff -r1.6 Makefile
33a34,44
===================================================================
RCS file: /cvsroot/ci-linux/cluster-tools/ssi/deconfigure_cluster,v
retrieving revision 1.1
diff -r1.1 deconfigure_cluster
7a8,13
The attached patch correct some of the build issues that I faced on a
redhat machine. It takes the backup of all the files before it replaces
it with cluster files.
Why ?
configure_cluster didn't have execute permission and as a result on my
system( which doesn't have a shared storage ) it went and replaced the
fstab with the one came with cluster tools without leaving me a backup
. Similarly the network configuration files.
( while rebuilding the fstab file i made a mistake. This caused the
machine to crash during the next boot. and I had to create a custom
initial ram disk to get the machine back. It was actually pain. Having a
backup is always a good idea. ).
If the .old file is already there, no backup is taken .This prevent
rewriting already taken backup when i run make install again and again .
running uninstall in ssi dir ( deconfigure_cluster script is here
).This brings the system back to the old state.
If there is nothing wrong with the patch. I can do a checking.
-aneesh
Index: Makefile
===================================================================
RCS file: /cvsroot/ci-linux/cluster-tools/Makefile,v
retrieving revision 1.2
diff -r1.2 Makefile
62a63
make -C ssi uninstall
Index: ssi/Makefile===================================================================
RCS file: /cvsroot/ci-linux/cluster-tools/ssi/Makefile,v
retrieving revision 1.6
diff -r1.6 Makefile
33a34,44
@if [ ! -f $(UML_ROOT)/etc/sysconfig/network-scripts/ifcfg-eth0.old ]; then \
f=$(UML_ROOT)/etc/sysconfig/network-scripts/ifcfg-eth0; \
echo "Saving existing $$f as $$f.old"; \
cp -f $$f $$f.old; \
fi
@if [ ! -f $(UML_ROOT)/etc/sysconfig/network-scripts/network-functions.old ]; then \
f=$(UML_ROOT)/etc/sysconfig/network-scripts/network-functions; \
echo "Saving existing $$f as $$f.old"; \
cp -f $$f $$f.old; \
fi
62a74,79f=$(UML_ROOT)/etc/sysconfig/network-scripts/ifcfg-eth0; \
echo "Saving existing $$f as $$f.old"; \
cp -f $$f $$f.old; \
fi
@if [ ! -f $(UML_ROOT)/etc/sysconfig/network-scripts/network-functions.old ]; then \
f=$(UML_ROOT)/etc/sysconfig/network-scripts/network-functions; \
echo "Saving existing $$f as $$f.old"; \
cp -f $$f $$f.old; \
fi
@if [ ! -f $(UML_ROOT)/etc/fstab.old ]; then \
f=$(UML_ROOT)/etc/fstab; \
echo "Saving existing $$f as $$f.old"; \
cp -f $$f $$f.old; \
fi
chmod u+x ./configure_cluster
77a95f=$(UML_ROOT)/etc/fstab; \
echo "Saving existing $$f as $$f.old"; \
cp -f $$f $$f.old; \
fi
chmod u+x ./configure_cluster
chmod u+x ./deconfigure_cluster
Index: ssi/deconfigure_cluster===================================================================
RCS file: /cvsroot/ci-linux/cluster-tools/ssi/deconfigure_cluster,v
retrieving revision 1.1
diff -r1.1 deconfigure_cluster
7a8,13
[ -f /etc/sysconfig/network-scripts/ifcfg-eth0.old ] &&
mv -f /etc/sysconfig/network-scripts/ifcfg-eth0.old /etc/sysconfig/network-scripts/ifcfg-eth0
[ -f /etc/sysconfig/network-scripts/network-functions.old ] &&
mv -f /etc/sysconfig/network-scripts/network-functions.old /etc/sysconfig/network-scripts/network-functions
[ -f /etc/fstab.old ] &&
mv -f /etc/fstab.old /etc/fstab
mv -f /etc/sysconfig/network-scripts/ifcfg-eth0.old /etc/sysconfig/network-scripts/ifcfg-eth0
[ -f /etc/sysconfig/network-scripts/network-functions.old ] &&
mv -f /etc/sysconfig/network-scripts/network-functions.old /etc/sysconfig/network-scripts/network-functions
[ -f /etc/fstab.old ] &&
mv -f /etc/fstab.old /etc/fstab