-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ydb script to run YottaDB, and files ydb_env_set & ydb_env_unset to source to set & clear environment #126
Comments
nars1
added a commit
to ksbhaskar/YottaDB
that referenced
this issue
Feb 20, 2018
ksbhaskar
added a commit
that referenced
this issue
Feb 20, 2018
#160) * Use ydb and ydb_env_set scripts instead of gtm and gtmprofile scripts, and ydb_ prefix environment variables When installing YottaDB, gtm is created as a symbolic link to ydb, and gtmprofile is a symbolic link to ydb_env_set. The default names for global directory, database files, and journal files are changed, but if current files exist, they are Environment setting is done with an M program rather than with shell commands. * [#126] More changes * More changes after Bhaskar tried the original tarball * Enable journaling when creating the default database * Fix typo
ksbhaskar
added a commit
to ksbhaskar/YottaDB
that referenced
this issue
Feb 22, 2018
…der than $ydb_retention when deleting them.
ksbhaskar
added a commit
to ksbhaskar/YottaDB
that referenced
this issue
Feb 22, 2018
…nvironment is not defined ($ydb_dist/mumps does not exist).
ksbhaskar
added a commit
to ksbhaskar/YottaDB
that referenced
this issue
Feb 22, 2018
…to file sourced by shell
ksbhaskar
added a commit
that referenced
this issue
Feb 22, 2018
…, and r… (#165) * Changes to include $ydb_dist in LD_LIBRARY_PATH in ydb_env_set, and remove it in ydb_env_unset * Remove debug line inadvertently left in source * Fix errors in ydb_routines value in UTF-8 mode and with plugin installed; remove development debugging settings
nars1
added a commit
to nars1/YottaDBtest
that referenced
this issue
Feb 23, 2018
nars1
added a commit
to YottaDB/YDBTest
that referenced
this issue
Feb 23, 2018
ksbhaskar
changed the title
ydb script and ydbprofile file
ydb script to run YottaDB, and files ydb_env_set & ydb_env_unset to source to set & clear environment
Mar 28, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Final Release Note
For "out of the box" use of YottaDB,
ydb_env_set
is a file you can source with a POSIX or compatible shell to configure an environment with a default structure and required environment variables, creating a default environment if one does not exist.To set up the environment for a YottaDB quick start execute:
where r#.## is the YottaDB release identifier. Thereafter:
C users can simply run their C programs compiled against this YottaDB release. [Each YottaDB release requires C programs to be recompiled after including the
libyottadb.h
file included in that release.]M users can run
ydb <command line>
where<command line>
is as described in the M Programmers Guide. [ydb -help
outputs a list of options.]Advanced users and production deployments will likely prefer to create their own scripting instead of using that provided here.
Every YottaDB environment variable (with
ydb_
prefixes) has a GT.M counterpart (withgtm
or occasionallyGTM
prefixes). The general YottaDB philosophy is to use a YottaDB environment variable if one is defined, otherwise to use its GT.M counterpart, if it is defined, and otherwise to use a default value (including no value, if that is the default). At this time, support has not been implemented in YottaDB for allydb_
prefixed envronment varables, but each release will increase that set. So as to not require changes as future YottaDB releases add YottaDB counterparts to GT.M environment variables, sourcingydb_env_set
sets both sets of environment variables to appropriate values, which are usually, but not always, the same. Except where otherwise noted below, the general approach to assigning valuesydb_env_set
takes is:ydb_
prefixed YottaDB environment variable has a value, leave it unchanged, but set the corresponding GT.M environment variable to match.ydb_
prefixed environment variable is not defined, but itsgtm
prefixed counterpart is, then set theydb_
prefixed variable from thegtm
prefixed counterpart.Environment variables whose values may optionally be provided before sourcing
ydb_env_set
are:ydb_chset
(gtm_chset
) - defines whether the M language subsystem of YottaDB should operate in M mode or UTF-8 mode. If neither is set, sourcing theydb_env_set
script sets neither. Any value other than a case-independent"UTF-8"
generates an error, and any lower case letters are converted to upper case.ydb_icu_version
(gtm_icu_version
) - if$ydb_chset
is"UTF-8"
.$gtm_icu_version
defines the version of ICU (International Components for Unicode) to be used. The environment variable is ignored if$ydb_chset
is not"UTF-8"
. The default is the value returned by the commandicu-config --version
Environment variables that sourcing
ydb_env_set
sets, without regard to any previous value, are:ydb_dist
(gtm_dist
) - the directory where YottaDB is installedydb_rel
- the value of the second and fourth pieces of the intrinsic special variable$zyrelease
of the YottaDB release, separated by an underscore (_).gtmver
- the value of the second and fourth pieces of the intrinsic special variable$zversion
of the YottaDB release, separated by an underscore (_)..ydb_tmp_chset
,ydb_tmp_gtm_dist
,ydb_tmp_rel
,ydb_tmp_routines
,ydb_tmp_passwd
, andydb_tmp_ver
- temporary variables used by the script and set to the initial values (if any) ofydb_chset
(gtm_chset
),gtm_dist
,ydb_rel
,ydb_routines
(gtmroutines
), andydb_passwd
(gtm_passwd
), andgtmver
.Environment variables that sourcing
ydb_env_set
initializes with reasonable default values if they are unset, and potentially modifies if set, are:LD_LIBRARY_PATH
- If there is an existing directory in$LD_LIBRARY_PATH
of the form/usr/local/lib/yottadb/*
replaces it with$ydb_dist
; otherwise appends$ydb_dist
toLD_LIBRARY_PATH
.ydb_dir
(gtmdir
) - a directory with a standard structure, as described below:If both
ydb_dir
andgtmdir
are defined:$ydb_dir
and$gtmdir
exist, neither environment variable is modified.ydb_dir
to$HOME/.yottadb
, create a directory there with the standard structure and create a symbolic link at$gtmdir
to point to$ydb_dir
.If one is defined and the other is not, set the one that is not defined to the value of the one that is.
If neither is defined, set
ydb_dir
to$HOME/.yottadb
and create a directory there with the standard structure. Setgtmdir
to$HOME/.fis-gtm
and create a symbolic link to.yottadb
.ydb_gbldir
(gtmgbldir
) - the initial value for the intrinsic special variable$zgbldir
, defaulting to$ydb_dir/$ydb_rel/g/yottadb.gld
.ydb_routines
(gtmroutines
) - the initial value for the intrinsic special variable$zroutines
in three parts:$ydb_dir/$ydb_rel/o/utf8*($ydb_dir/$ydb_rel/r $ydb_dir/r)
if$ydb_chset
is"UTF-8"
and$ydb_dir/$ydb_rel/o*($ydb_dir/$ydb_rel/r $ydb_dir/r)
otherwise. Note that"*"
is literally in the string, and does not represent filename expansion.$gtm_dist/plugin/o/utf8/*.so
if$ydb_chset
is"UTF-8"
, or$gtm_dist/plugin/o/*.so
otherwise. In this case"*"
represents expanded file names, rather than a literal character in the string.$gtm_dist/libgtmutil.so
.ydb_log
(gtm_log
) - a directory where thegtmsecshr
program logs its information in the filegtm_secshr_log
, defaulting to/tmp/yottadb/$ydb_rel
.ydb_principal_editing
(gtm_principal_editing
) - deviceparameters at process startup for $principal, defaulting to"EDITING"
.ydb_retention
- the number of days after which theydb
script deletes prior generation journal files and log files in$ydb_tmp
generated by commands within theydb
script, defaulting to 42.ydb_tmp
- a temporary directory in which commands within theydb
script log their use, defaulting to/tmp/yottadb/$ydb_rel
.Sourcing
ydb_env_set
has no effect on any environment variables except those noted above.The standard structure for the directory under
$ydb_dir
has the following subdirectories. Note that routines and object files are relevant only for YottaDB's M language subsystem.$ydb_dir/r
for routine source files that are not specific to a YottaDB release.$ydb_dir/$ydb_rel
($ydb_dir/$gtmver
) for files specific to a YottaDB release. Typically,$ydb_dir/$gtmver
is a symbolic link to$ydb_dir/$ydb_rel
, but if the former subdirectory exists already, sourcingydb_env_set
creates a symbolic link from the latter to the former. Note that$ydb_dir
may well have multiple$ydb_rel
subdirectories, each corresponding to a different YottaDB release.$ydb_dir/$ydb_rel
has the following subdirectores.$ydb_dir/$ydb_rel/g
- for a global directory (default nameyottadb.gld
), database files (default nameyottadb.dat
) and current and prior generation journal files (default namesyottadb.mjl
andyottadb.mjl_<timestamp>
.$ydb_dir/$ydb_rel/o
- for object files compiled in M mode, and$ydb_dir/$ydb_rel/o/utf8
for object files compiled in UTF-8 mode.$ydb_dir/$ydb_rel/r
- for M routine source files that are specific to the YottaDB release$ydb_rel
.Sourcing
ydb_env_set
sets the following aliases:dse
- aliased to$gtm_dist/dse
gde
- aliased to$gtm_dist/mumps -run GDE
lke
- aliased to$gtm_dist/lke
mumps
- aliased to$gtm_dist/mumps
mupip
- aliased to$gtm_dist/mupip
Sourcing
ydb_env_unset
unsets the above environment variables, unsets the aliases, and removes any occurrence of$ydb_dist
in$LD_LIBRARY_PATH
.The
ydb
script does the following:ydb_env_set
.mupip journal -recover -backward "*"
mupip set -journal="on,before" -region "*"
.$ydb_dir/$ydb_rel/g
modified more than$ydb_retention
days previously.$ydb_dist/mumps $*
mupip rundown -region "*"
$ydb_tmp
generated by$USER
and modified more than than$ydb_retention
days previously.Description
ydb_env_set is a file that can be sourced from a shell (ideally /bin/sh; requiring bash is acceptable) that creates an environment if one does not exist, and sets the environment variables needed to run YottaDB. ydb is a script that runs YottaDB M programs and the interactive mode, relying on ydb_env_set to ensure that an environment exists and that environment variables have appropriate values.
ydb_env_set and ydb are replacements for the gtmprofile and gtm files.
Draft Release Note
For "out of the box" use of YottaDB,
ydb_env_set
is a file you can source with a POSIX or compatible shell to configure an environment with a default structure and required environment variables, creating a default environment if one does not exist.To set up the environment for a YottaDB quick start execute:
where r#.## is the YottaDB release identifier. Thereafter:
C users can simply run their C programs compiled against this YottaDB release. [Each YottaDB release requires C programs to be recompiled after including the
libyottadb.h
file included in that release.]M users can run
ydb <command line>
where<command line>
is as described in the M Programmers Guide. [ydb -help
outputs a list of options.]Advanced users and production deployments will likely prefer to create their own scripting instead of using that provided here.
With the exception of
gtm_dist
, every YottaDB environment variable (withydb_
prefixes) has, or will have, a GT.M counterpart (withgtm
or occasionallyGTM
prefixes). So as to not require changes as future YottaDB releases add YottaDB counterparts to GT.M environment variables, sourcingydb_env_set
sets both sets of environment variables to appropriate values, which are usually, but not always, the same. Except where otherwise noted below, the general approach to assigning values is:ydb_
prefixed YottaDB environment variable has a value, leave it unchanged, but set the corresponding GT.M environment variable to match.ydb_
prefixed environment variable is not defined, but itsgtm
prefixed counterpart is, then set theydb_
prefixed variable from thegtm
prefixed counterpart.Environment variables whose values may optionally be provided before sourcing
ydb_env_set
are:ydb_chset
(gtm_chset
) - defines whether the M language subsystem of YottaDB should operate in M mode or UTF-8 mode. If neither is set, sourcing theydb_env_set
script sets neither. Any value other than a case-independent"UTF-8"
generates an error, and any lower case letters are converted to upper case.ydb_icu_version
(gtm_icu_version
) - if$ydb_chset
is"UTF-8"
.$gtm_icu_version
defines the version of ICU (International Components for Unicode) to be used. The environment variable is ignored if$ydb_chset
is not"UTF-8"
. The default is the value returned by the commandicu-config --version
Environment variables that sourcing
ydb_env_set
sets, without regard to any previous value, are:gtm_dist
- the directory where YottaDB is installedydb_rel
- the value of the second and fourth pieces of the intrinsic special variable$zyrelease
of the YottaDB release separated by an underscore (_).gtmver
- the value of the second and fourth pieces of the intrinsic special variable$zversion
of the YottaDB release separated by an underscore (_)..ydb_tmp_chset
,ydb_tmp_gtm_dist
,ydb_tmp_rel
,ydb_tmp_routines
,ydb_tmp_passwd
, andydb_tmp_ver
- temporary variables used by the script and set to the initial values (if any) ofydb_chset
(gtm_chset
),gtm_dist
,ydb_rel
,ydb_routines
(gtmroutines
), andydb_passwd
(gtm_passwd
), andgtmver
.Environment variables that sourcing
ydb_env_set
initializes with reasonable default values if they are unset, and potentially modifies if set, are:LD_LIBRARY_PATH
- If there is an existing directory in$LD_LIBRARY_PATH
of the form/usr/local/lib/yottadb/*
replaces it with$gtm_dist
; otherwise appends$gtm_dist
toLD_LIBRARY_PATH
.ydb_dir
(gtmdir
) - a directory with a standard structure is defined as described below:If both
ydb_dir
andgtmdir
are defined:$ydb_dir
and$gtmdir
exist, neither environment variable is modified.ydb_dir
to$HOME/.yottadb
, create a directory there with the standard structure and create a symbolic link at$gtmdir
to point to$ydb_dir
.If one is defined and the other is not, set the one that is not defined to the value of the one that is.
If neither is defined, set
ydb_dir
to$HOME/.yottadb
and create a directory there with the standard structure. Setgtmdir
to$HOME/.fis-gtm
and create a symbolic link to.yottadb
.ydb_gbldir
(gtmgbldir
) - the initial value for the intrinsic special variable$zgbldir
, defaulting to$ydb_dir/$ydb_rel/g/yottadb.gld
.ydb_routines
(gtmroutines
) - the initial value for the intrinsic special variable$zroutines
.If there is an existing value, sourcing
ydb_env_set
converts any occurrence of$ydb_tmp_routines
or$gtmver
to$ydb_rel
.If there is no existing value, sourcing
ydb_env_set
creates a default value in three parts:$ydb_dir/$ydb_rel/o/utf8*($ydb_dir/$ydb_rel/r $ydb_dir/r)
if$ydb_chset
is"UTF-8"
and$ydb_dir/$ydb_rel/o*($ydb_dir/$ydb_rel/r $ydb_dir/r)
otherwise. Note that"*"
is literally in the string, and does not represent filename expansion.$gtm_dist/plugin/o/utf8/*.so
if$ydb_chset
is"UTF-8"
, or$gtm_dist/plugin/o/*.so
otherwise. In this case"*"
represents expanded file names, rather than a literal character in the string.$gtm_dist/libgtmutil.so
.ydb_log
(gtm_log
) - a directory where thegtmsecshr
program logs its information in the filegtm_secshr_log
, defaulting to/tmp/yottadb/$ydb_rel
.ydb_principal_editing
(gtm_principal_editing
) - deviceparameters at process startup for $principal, defaulting to"EDITING"
.ydb_retention
- the number of days after which theydb
script deletes prior generation journal files and log files in$ydb_tmp
generated by commands within theydb
script, defaulting to 42.ydb_tmp
- a temporary directory in which commands within theydb
script log their use, defaulting to/tmp/yottadb/$ydb_rel
.Sourcing
ydb_env_set
has no effect on any environment variables except those noted above.The standard structure for the directory under
$ydb_dir
has the following subdirectories. Note that routines and object files are relevant only for YottaDB's M language subsystem.$ydb_dir/r
for routine source files that are not specific to a YottaDB release.$ydb_dir/$ydb_rel
($ydb_dir/$gtmver
) for files specific to a YottaDB release. Typically,$ydb_dir/$gtmver
is a symbolic link to$ydb_dir/$ydb_rel
, but if the former subdirectory exists already, sourcingydb_env_set
creates a symbolic link from the latter to the former. Note that$ydb_dir
may well have multiple$ydb_rel
subdirectories, each corresponding to a different YottaDB release.$ydb_dir/$ydb_rel
has the following subdirectores.$ydb_dir/$ydb_rel/g
- for a global directory (default nameyottadb.gld
), database files (default nameyottadb.dat
) and current and prior generation journal files (default namesyottadb.mjl
andyottadb.mjl_<timestamp>
.$ydb_dir/$ydb_rel/o
- for object files compiled in M mode, and$ydb_dir/$ydb_rel/o/utf8
for object files compiled in UTF-8 mode.$ydb_dir/$ydb_rel/r
- for M routine source files that are specific to the YottaDB release$ydb_rel
.Sourcing
ydb_env_set
sets the following aliases:dse
- aliased to$gtm_dist/dse
gde
- aliased to$gtm_dist/mumps -run GDE
lke
- aliased to$gtm_dist/lke
mumps
- aliased to$gtm_dist/mumps
mupip
- aliased to$gtm_dist/mupip
Sourcing
ydb_env_unset
unsets the above environment variables, unsets the aliases, and removes any occurrence of$gtm_dist
in$LD_LIBRARY_PATH
.The
ydb
script does the following:Sources
ydb_env_set
.Runs
mupip dumpfhead
on the database file for the DEFAULT region. If the database is not already open:If the database is replicated:
mupip journal -rollback -online -backward "*"
(the-online
flag is required to allow for another process"dummy"
secondary instance.mupip set -journal="on,before" -region "*"
.If the database is not replicated:
mupip journal -recover -online -backward "*"
(the-online
flag is required to allow for another processWhether the database is replicated or not, after the above:
mupip set -journal="on,before" -region "*"
.$ydb_dir/$ydb_rel/g
modified more than$ydb_retention
days previously.Runs
$gtm_dist/mumps $*
Executes
mupip rundown -region "*"
Deletes any files in
$ydb_tmp
generated by$USER
and modified more than than$ydb_retention
days previously.The text was updated successfully, but these errors were encountered: