"John R. Jackson" wrote:
> I also install another "package general" symlink in /opt (e.g. /opt/amanda
> -> amanda-2.4.2) that points to the current version I want to use.
> That makes it easy to have multiple versions, and it also means all
> references just have to be set up once (e.g. /opt/amanda/libexec/amandad)
> and never changed again.
>
> If the package is "public" (like gcc, for instance) that all users should
> have access to, I fill /usr/local/bin with symlinks to the package bin
> area in /opt (e.g. /usr/local/bin/gcc -> /opt/gcc/bin/gcc). Then a
> user only has to have /usr/local/bin in their PATH to use the tools.
> The symlinks only need maintenance when a new package is added or updated
> (and I have Perl scripts to do most of the work).
I use about the same philisophy. And there is a program that handles
the management of symlinks for you! It's so easy I have to mail you
all this!
At this moment, I'm using "stow" to manage the symlinks.
You can find it at:
http://www.gnu.org/gnulist/production/stow.html
On an experimental system, I'm trying out a similar package named
"graft", that seems to solve some issues I have with the stow filosophy
(graft can optionally create symlinks only for specified files in a
package if you specify it to do so, and you can have different depots
for packages at the same time -- nice for prebuild packages that insist
to be installed in some directory hierarchy). Probably I will switch
to this system in the near future on my other production machines too.
http://www.gormand.com.au/peters/tools/
Both of them are quiet simple perl script and very easy to manage.
You can set up different versions of a program, have one production
version, and still have the previous around to fall back within seconds
if you experience a problem with the new version etc.
For Stow I have the following setup:
/opt/local/stow
The directory with the packages installed.
An added requirement for me is that this directory is read-only
nfs exported from a few servers.
/opt/local
The top of the directory with symlinks to the stow files
/var/opt/<packagename>
The writable directory that a package needs
So I have directories like:
/opt/local/stow/stow-1.3.2
/opt/local/stow/bzip2-1.0.1
/opt/local/stow/amanda-2.4.1
/opt/local/stow/amanda-2.4.1-patched-for-samba-2.0.7
/opt/local/stow/amanda-2.4.2
/opt/local/stow/gzip-1.2.4
/opt/local/stow/gtar-1.12-patched
/opt/local/stow/gtar-1.13.17
/opt/local/stow/gtar-1.13.18
And each contain their stuff like
/opt/local/stow/amanda-2.4.2/sbin/amanda.
The symlinks managed by stow and look like:
amadmin -> ../stow/amanda-2.4.2/sbin/amanda
In all my scripts, crontab commands etc, I use /opt/local/sbin/amadmin.
The default PATH for people is also augmented by /opt/local/bin and
if needed /opt/local/sbin.
To compile Amanda, I use following scenario and settings:
$ ./configure \
--with prefix=/opt/local \
--localstatdir=/var/opt/amanda \
--with-configdir=/var/opt/amanda/etc \
--with-index-server=amandahost \
--with-user=amanda \
--with-group=backup \
--with-config=daily \
--with-tape-device=/dev/rmt/0n \
--with-fqdn \
--with-gnutar=/opt/local/bin/gtar \
--with-smbclient=/opt/local/bin/smbclient \
--with-gnutar-listdir=/var/opt/amanda/gnutar-lists \
--with-amandahosts \
--with-debugging
$ make
$ su
# make install prefix=/op/local/stow/amanda-2.4.2
# cd /opt/local/stow
# stow -D amanda-2.4.p1-patched-for-samba-2.0.7
(this removes symlinks to the previous version)
# stow amanda-2.4.2
As you can see from the above configure options, the separation between
readonly and writeable data is difficult to specify. But if you don't
have the requirement to install in a readonly exported directory, it's
much easier.
Then on each NEW machine that I unpack and install, I first get a
working version of all my optional software. That usually just just
boils down to nfs mount /opt/local/stow, or I could rdist the tree.
I then execute this script below to activate amanda client software on
the machine (and made available by the nfs mount in
/opt/local/stow/00Install/amanda).
The user "amanda" is already defined in NIS, with home directory
/var/opt/amanda.
#!/bin/sh
# get Amanda client running on a New host with /opt/local
touch /etc/amandates
chown amanda /etc/amandates
mkdir -p /var/opt/amanda
chown amanda:backup /var/opt/amanda
echo amandahost > /var/opt/amanda/.amandahosts
chown amanda:other /var/opt/amanda/.amandahosts
chmod 600 /var/opt/amanda/.amandahosts
if grep '^amanda' /etc/inetd.conf >/dev/null
then :
else
cat << EOF >> /etc/inetd.conf
amanda dgram udp wait amanda /opt/local/libexec/amandad amandad
EOF
fi
kill -1 `/bin/ps -e | /bin/awk '$NF=="inetd" {print $1}'`
In practice this means that adding a new machine to amanda takes
5 seconds + the time edit the disklist file.
Upgrading to a new version of amanda is easy. And if I suddenly
have a problem, and I would like to go back to the previous version
it takes 5 seconds to execute following three lines:
$ cd /opt/local/stow
$ sudo stow -D amanda-2.4.2
$ sudo stow amanda-2.4.1p1
and I'm back in the situation before the trouble began (amanda-2.4.2
works just fine here, it's theoretical :-)
--
Paul Bijnens, Lant Tel +32 16 40.51.40
Interleuvenlaan 15 H, B-3001 Leuven, BELGIUM Fax +32 16 40.49.61
http://www.lant.com/ email: [EMAIL PROTECTED]
***********************************************************************
* I think I've got the hang of it now: exit, ^D, ^C, ^\, ^Z, ^Q, F6, *
* quit, ZZ, :q, :q!, M-Z, ^X^C, logoff, logout, close, bye, /bye, *
* stop, end, F3, ~., ^]c, +++ ATH, disconnect, halt, abort, hangup, *
* PF4, F20, ^X^X, :D::D, F14-f-e, F8-e, kill -1 $$, shutdown, *
* kill -9 1, Alt-F4, Ctrl-Alt-Del, AltGr-NumLock, Stop-A, ... *
* ... "Are you sure?" ... YES ... Phew ... I'm out *
***********************************************************************