u/fjammes/dm-1338

Reviewing DM-1338
Sorry it seems that this comment has disapeared from github due to a 
forced push on my side.

I agree with your proposal which is simpler.

Nevertheless, I would like to test all variables in new file: 
admin/templates/configuration/etc/sysconfig/qserv,
not only install directories. May I had a check_var() function in 
qserv-function which tests all these variables
in all init.d scripts?

I would also like to keep a mean to easily see wich variables is used in 
which init.d script. Is it usefull?

Thanks,

Fabrice

On 10/30/2014 04:14 PM, Andy wrote:
>
> In admin/templates/configuration/etc/sysconfig/path.cfg.sh:
>
> > +# Handling paths, using eups or meta-config file
> > +# Author: Fabrice Jammes <fabrice.jammes@in2p3.fr> (09.17.2013)
> > +#-------------------------------------------------------------------------------
> > +
> > +# Set up a default search path.
> > +# Using value from QSERV_RUN_DIR/qserv-meta.conf
> > +
> > +check_dir_availability() {
> > +    # Test syntax.
> > +    if [ "$#" = 0 ] ; then
> > +	    echo $"Usage: check_dir_availability {varname1} ... {varnameN}"
> > +	    return 1
> > +    fi
> > +    for varname in "$@"
> > +    do
> > +        var=${!varname}
>
> Simplest for me is probably not to use that function at all, instead of
>
> |check_dir_availability SOME_VAR
> |
>
> you could do
>
> |if [ ! -d "$SOME_VAR" ] ; then
>      echo "SOME_VAR is not defined or directory is missing"
>      exit 1
> fi
> |
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/LSST/qserv/pull/7/files#r19643144>.
>