Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Mar 1998 12:41:10 -0800
From:      Studded <Studded@dal.net>
To:        brian@worldcontrol.com
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: can schg be applied to a softlink?
Message-ID:  <350999E6.E8F600F@dal.net>
References:  <19980313031035.A11054@top.worldcontrol.com>

next in thread | previous in thread | raw e-mail | index | archive | help
brian@worldcontrol.com wrote:
> 
> I softlink'ed /var/qmail/bin/sendmail to /usr/sbin/sendmail.

	Good plan.
 
> I issued the command
> 
> chflags schg /usr/sbin/sendmail

	You want to read the man page for chflags, it explains why this won't
work.
 
> I make world.
> 
> /usr/sbin/sendmail has been replaced with the real sendmail. 8-(.
> 
> How do I stop this from happening?

	With respect to the person who answered you previously, there is an
easier way to avoid your problem. Instead of changing the makefile in
/usr/src/usr.sbin/sendmail you want to change the one in
/usr/src/usr.sbin. Change to that directory, then cp Makefile makefile.
You don't need to .cvsupignore this file since cvsup ignores files it
doesn't know about by default. Then, use your favorite editor to modify
makefile. You want to remove the reference to the sendmail directory.
There is only one in this makefile, but if you use this method for other
things there might be more than one. 

	Now when you do a make world, the whole sendmail directory will be
ignored so nothing in it will be built. I have a little script that
checks the $Id of the makefiles I've modified so that if any of them get
updated after a make world I can merge the changes in by hand. Here's
how your entry would look, plus some stuff at the end you might find
helpful if you make the world often.

=== Cut here ===
#!/bin/sh

# mwprep

# Help get ready for a make world by checking files I've 
# customized, back up /etc and add the date to newvers.sh

# Last update 13 March 1998 Studded@dal.net

PATH=/bin:/usr/bin; export PATH

checkfiles () {
IDFILE1=`grep "[$]Id:" $1`
IDFILE2=`grep "[$]Id:" $2`

if [ "$IDFILE1" = "$IDFILE2" ]; then
        return 0
else
        return 1
fi
}

difffiles () {
        echo ''
        diff -u $1 $2 | more
        echo ''
        read -p '*** Ok to proceed? (y for yes) [no]  ' GO_OR_NOT
        if [ "x$GO_OR_NOT" = "xy" -o "x$GO_OR_NOT" = "xY" ]; then
          return 0
        else
          exit 1
        fi
}

echo ''
echo '*** Checking /usr/src/usr.sbin/Makefile'

checkfiles /usr/src/usr.sbin/makefile /usr/src/usr.sbin/Makefile

if [ $? != 0 ]; then
        difffiles /usr/src/usr.sbin/makefile /usr/src/usr.sbin/Makefile
fi

# Add today's date so I know when this was built
sed s/SNAPDATE=\"\"/SNAPDATE=\"`date +%m%d`\"/
/usr/src/sys/conf/newvers.sh \
        > /usr/src/sys/conf/newvers.sh.sed
cp /usr/src/sys/conf/newvers.sh.sed /usr/src/sys/conf/newvers.sh &&
        rm /usr/src/sys/conf/newvers.sh.sed

echo ''
grep 'SNAPDATE=' /usr/src/sys/conf/newvers.sh

# For this to work you need a directory called 'bak' in your
# home directory. Change as appropriate.

echo ''
ETCBAKFILE=$HOME/bak/etc.`date +%m%d`

if [ ! -f $ETCBAKFILE ]; then
        tar -c /etc -f $ETCBAKFILE 2> /dev/null
        if [ $? -eq 0 ]; then
          echo "Backed up /etc to $ETCBAKFILE"
        else
          echo "Failed to back up /etc"
        fi
else
        tar -c /etc -f $ETCBAKFILE-`date +%H.%M` 2> /dev/null
        if [ $? -eq 0 ]; then
          echo "Backed up /etc to $ETCBAKFILE-`date +%H.%M`"
        else
          echo "Failed to back up /etc"
        fi
fi

echo ''
exit 0
=== Cut here ===

	There may be easier ways to do this, but this works for me. :)

Good luck,

Doug
-- 
***         Chief Operations Officer, DALnet IRC network       ***
*** Proud operator, designer and maintainer of the world's largest
*** Internet Relay Chat server.  5,328 clients and still growing.
*** Try spider.dal.net on ports 6662-4    (Powered by FreeBSD)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?350999E6.E8F600F>