"-otaperscan=XXX" override prevents reading of CONFIG/amanda.conf
Nathan Stratton Treadway <[email protected]> Fri, 10 Nov 2017 02:01:32 -0500
| Newsgroups | gmane.comp.archivers.amanda.devel |
|---|---|
| Message-ID | <[email protected]> |
(Testing with amanda v3.5.)
It seems that using "-otaperscan=XXX" on an amanda-utility command line causes
the conffile subsystem to skip reading CONFIG/amanda.conf for some
reason.
I am using a config file based on the examples/amanda.conf file, and it
defines three taper scans like this:
=====
define taperscan taper_traditional {
comment "traditional"
plugin "traditional"
}
define taperscan taper_oldest {
comment "oldest"
plugin "oldest"
}
define taperscan taper_lexical {
comment "lexical"
plugin "lexical"
}
taperscan "taper_lexical"
=====
This seems to work fine, and in particular using amgetconf I can both
get the global "taperscan" value and access the defined taperscans:
=====
# amgetconf TestBackup taperscan
taper_lexical
# amgetconf TestBackup taperscan:taper_lexical:comment
lexical
# amgetconf TestBackup taperscan:taper_oldest:comment
oldest
=====
However, if I try to use -otaperscan= to chose a new taperscan (or even
just choose taper_lexical again), I get an error that the named taperscan
can't be found.
=====
# amgetconf TestBackup taperscan:taper_oldest:comment -otaperscan=taper_lexical
argument '"taper_lexical"': Unknown taperscan named: taper_lexical
argument '"taper_lexical"': Unknown taperscan named: taper_lexical
amgetconf: errors processing config file at /usr/sbin/amgetconf line 363.
# amgetconf TestBackup taperscan:taper_oldest:comment -otaperscan=taper_oldest
argument '"taper_oldest"': Unknown taperscan named: taper_oldest
argument '"taper_oldest"': Unknown taperscan named: taper_oldest
amgetconf: errors processing config file at /usr/sbin/amgetconf line 363.
=====
However, if I use -o to re-define some other variable, I don't get this
error:
=====
# amgetconf TestBackup taperscan:taper_oldest:comment -onetusage=3
oldest
=====
(I first noticed the problem running the "amtape" command, and duplicated
it with "amcheck" as well, so it's not limited to a particular command.)
Interestingly, if I run the command under strace, I see that in the
failure case it never opens TestBackup/amanda.conf -- which certainly
explains why "taper_lexical" is not defined...:
=====
# strace amgetconf TestBackup taperscan:taper_oldest:comment -otaperscan=taper_lexical 2>&1 | grep "amanda.conf"
open("/etc/amanda/amanda.conf", O_RDONLY) = -1 ENOENT (No such file or directory)
# strace amgetconf TestBackup taperscan:taper_oldest:comment -onetusage=3 2>&1 | grep "amanda.conf"
open("/etc/amanda/amanda.conf", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/amanda/TestBackup/amanda.conf", O_RDONLY) = 3
read(3, "# amanda.conf - sample Amanda co"..., 4096) = 4096
=====
Nathan
----------------------------------------------------------------------------
Nathan Stratton Treadway - [email protected] - Mid-Atlantic region
Ray Ontko & Co. - Software consulting services - http://www.ontko.com/
GPG Key: http://www.ontko.com/~nathanst/gpg_key.txt ID: 1023D/ECFB6239
Key fingerprint = 6AD8 485E 20B9 5C71 231C 0C32 15F3 ADCD ECFB 6239