# Migrate away from using env variables in Qserv

XMLWordPrintable

#### Details

• Type: Story
• Status: Invalid
• Resolution: Done
• Fix Version/s: None
• Component/s:
• Labels:
None
• Story Points:
10
• Team:
Data Access and Database

#### Description

Qserv is currently relying on many env variables. We should migrated away from that to the extend possible.

#### Activity

Hide
Jacek Becla added a comment -

From trac ticket 2296:

There are a number of env. variables that need to be set in the start up of qsrv master, to control the use. These should be moves to config values, to keep them in one place, and not be needed as env. vairables. The env. variables in use now for startup are:

 QSW_RESULTDIR=/u20/douglas/prod/qserv-run/tmp QSW_XRDQUERYPATH="/q" QSW_DBSOCK="/u20/douglas/prod/var/lib/mysql/mysql.sock" QSW_MYSQLDUMP="/u20/douglas/prod/bin/mysqldump" QSW_SCRATCHPATH="/u20/douglas/prod/tmp" QSW_SCRATCHDB="qservScratch" QSW_RESULTPATH="/u20/douglas/prod/xrootd-run/result"

QSW_XRDQUERYPATH="/q" should be eliminated, it is baked into the code.

Ask AndyH about directives in the xrootd config file that set environment variables. The qserv fs plugin can then read the environment variables by getenv. In this way, we can set these values in the xrootd configuration and they can be read by the qserv worker plugin.

Show
Jacek Becla added a comment - From trac ticket 2296: There are a number of env. variables that need to be set in the start up of qsrv master, to control the use. These should be moves to config values, to keep them in one place, and not be needed as env. vairables. The env. variables in use now for startup are: QSW_RESULTDIR=/u20/douglas/prod/qserv-run/tmp QSW_XRDQUERYPATH="/q" QSW_DBSOCK="/u20/douglas/prod/var/lib/mysql/mysql.sock" QSW_MYSQLDUMP="/u20/douglas/prod/bin/mysqldump" QSW_SCRATCHPATH="/u20/douglas/prod/tmp" QSW_SCRATCHDB="qservScratch" QSW_RESULTPATH="/u20/douglas/prod/xrootd-run/result" QSW_XRDQUERYPATH="/q" should be eliminated, it is baked into the code. Ask AndyH about directives in the xrootd config file that set environment variables. The qserv fs plugin can then read the environment variables by getenv. In this way, we can set these values in the xrootd configuration and they can be read by the qserv worker plugin.
Hide
Fabrice Jammes added a comment -

Some Qserv variables are environment variables managed in init.d files, and should by instead managed in configuration files:

For mysql-proxy:
QSERV_RPC_PORT
QSERV_UNIX_USER, if do-able

For xrootd:
QSW_DBSOCK

Show
Fabrice Jammes added a comment - Some Qserv variables are environment variables managed in init.d files, and should by instead managed in configuration files: For mysql-proxy: QSERV_RPC_PORT QSERV_UNIX_USER, if do-able For xrootd: QSW_DBSOCK
Hide
Fritz Mueller added a comment -

These have meantime been either obsoleted or addressed.

Show
Fritz Mueller added a comment - These have meantime been either obsoleted or addressed.

#### People

Assignee:
Unassigned
Reporter:
Fritz Mueller
Watchers:
Fritz Mueller