Working with defaults-group-suffix in MariaDB/MySQL if it's empty - configuration

According to the documentation it's possible to add the parameter --defaults-group-suffix to a mysql command, for it to "In addition to the default option groups, also read option groups with the given suffix".
So in case I use:
--defaults-group-suffix=.sample
A mariadb-Server started with this option will read both, the following blocks:
[mariadbd]
…
[mariadbd.sample]
…
So I can put options which should apply to the specific instance to the second block.
My question is: Is there a way to add an option group, which is only evaluated, when the parameter --defaults-group-suffix is not provided, in other words empty?
The default block [mariadbd] obviously can't be used, since it is read by all instances with a defined suffix.
Additional question, since I can't find it in the documentation: If one option is specified multiple times in one (or more) configuration files: Is it the first, or the last match, that applies?

According to the stackoverflow guidelines, next time please only ask one question per posting.
1st question: No, it is not possible - the suffix option is an additional option, there are no conditions which check suffix and other options.
2nd question: If multiple configuration files with same options but different values are used, the option/value from last read configuration file will be used. Check the read order of configuration files by executing
mysqld --help --verbose | grep -C1 "Default options"
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf

Related

Declare variable-length array as a config value with Snakemake CLI

I have a Snakemake workflow where one of the top-level config entries is an array of variable size (in this particular example, a sibling may or may not be included in the analysis). Currently I'm using the following config file.
{
"case": "/scratch/standage/12175/BAMs/12175.proband.bam",
"controls": [
"/scratch/standage/12175/BAMs/12175.mother.bam",
"/scratch/standage/12175/BAMs/12175.father.bam"
]
}
I know snakemake allows one to specify config options on the command line with the --config flag. Since the case value is a single string, this is trivial to do on the command line. But what about the controls value(s)? Is it possible to pass an array/list of values as one of the config options on the command line?
Is it possible to pass an array/list of values as one of the config options on the command line
I doubt that is directly possible, but you could pass a quoted string of space (or comma or whatever) separated values that you split to list inside the Snakefile:
snakemake -C controls='control1 control2 ...'
Then inside the Snakefile:
controls= config['controls'].split(' ')
An alternative solution would be to pass variables on the command line like so...
snakemake --config case=proband.bam control1=mother.bam control2=father.bam
...and then to parse the configuration settings dynamically in the Snakefile. For example, any config key matching the regular expression control\d+ corresponds to a control sample.
So it's possible, but a bit of a stretch, and the config file is probably the better/cleaner option.

CVS -- Need command line to change status of file file from Binary to allow keyword substitution

I am coming into an existing project after several years of use. I have been attempting to add the nice keywords $Header$ and $Id$ so that I can identify the file versions in use.
I have come across several text files where these keywords did not expand at all. Investigation has determined that CVS thinks these files are BINARY and will not expand the keywords.
Is there anyway from a Linux Command Line invocation to permanently change the status of these files in the repository to cause keyword expansion? I'd be appreciative if you could tell me. Several attempts that I have tried have not succeeded.
cvs admin -kkv filename
will restore the file to the default text mode so keywords are expanded.
If you type
cvs log -h filename
(to show just the header and not the entire history), a binary file will show
keyword substitution: b
which indicates that keyword substitution is never done, while a text file will show
keyword substitution: kv
The CVSROOT/cvswrappers file can be used to specify the default new files you add, based on their names.

How to update OpenGrok indices

The OpenGrok wrapper script has an update option, but when I run it without any options (as echoed in the usage), I get
Loading the default instance configuration ...
FATAL ERROR: OpenGrok Source Path /var/opengrok/src doesn't exist - Aborting!
I have also tried specifying the SRC_ROOT, but continue to get the same error.
This might not be the right answer, but I have been able to update by re-running the index job itself. It doesn't take as long as the initial indexing.
from https://github.com/OpenGrok/OpenGrok
E.g. if opengrok data directory is /tank/opengrok and source root is
in /tank/source then to get more verbosity run the indexer as:
$ OPENGROK_VERBOSE=true OPENGROK_INSTANCE_BASE=/tank/opengrok \
./OpenGrok index /tank/source
SRC_ROOT is a variable in the OpenGrok wrapper (normally in /usr/opengrok/bin/OpenGrok), this variable is to say OpenGrok where you have your src code to be indexed. So you need to edit it:
SRC_ROOT="your/src/path"
Also, after that maybe you'll se an error for the Data location... and you have to set also the variable DATA_ROOT (index location)
DATA_ROOT="you/data"

Exclude knots in SunGridEngine

Using SGE I can exclude a node called "node6" with the option:
#$ -l h=!node6
Question: Does anyone know how to extend this to more than one node? I really can't find a good HowTo and I'm tired of guessing. Thanks!
You can use a wildcard expression to exclude some nodes. For example if you have nodes called node1, node2 ... nodeX; to exclude node2 to node5 you can use :
#$ -l h='!node[2-5]'
or to exclude several nodes :
#$ -l h='!(nodeP|nodeQ|...|nodeR)' //P,Q,R in [1,X]
Now just find the pattern which matches all the nodes you want to exclude.
Else, you can use a resource quota. To perform that, create a resource quota :
qconf -arqs disabledHostsResourceQuota
Edit this resource quota to allow a hostgroup (let's call it disabledHosts) to prevent jobs from running :
{
name disabledHostsResourceQuota
description resource quota to disable some hosts
enabled TRUE
limit hosts {#disabledHosts} to slots=0
}
Then create your hostgroup :
qconf -ahgrp disabledHosts
and in the "hostlist" field, add all the hosts you want to disable.
You can then submit your job without any option, that should do the trick.

mysql - set ~/.my.cnf location?

Is it possible to specify which .my.cnf file mysql client should use? I have 2 mysql instances running on different ports and want to only need to specify a filename with credentials.
As documented under Command-Line Options that Affect Option-File Handling:
When specifying file names, you should avoid the use of the “~” shell metacharacter because it might not be interpreted as you expect.
--defaults-extra-file=file_name
Read this option file after the global option file but (on Unix) before the user option file. If the file does not exist or is otherwise inaccessible, the program exits with an error. file_name is interpreted relative to the current directory if given as a relative path name rather than a full path name.
--defaults-file=file_name
Use only the given option file. If the file does not exist or is otherwise inaccessible, the program exits with an error. file_name is interpreted relative to the current directory if given as a relative path name rather than a full path name.
--defaults-group-suffix=str
If this option is given, the program reads not only its usual option groups, but also groups with the usual names and a suffix of str. For example, the mysql client normally reads the [client] and [mysql] groups. If the --defaults-group-suffix=_other option is given, mysql also reads the [client_other] and [mysql_other] groups.
Note that "to work properly, each of these options must be given before other options".