Documentation and thoughts on ARGSDIR (first draft)
Lars Hanisch <dvb <at> flensrocker.de>
2015-02-08 14:05:10 GMT
I wrote down the thoughts I had in mind when developing the conf.d patch which got integrated in vdr 2.1.7.
Also I like to give some advice to distributors how I think, this feature should be used. If we can agree on a
consistent naming and file-layout all users can profit.
At the end there's an RFC for an interface to a not-yet-written tool "vdrctl" for managing the args-conf-files.
Any comments and improvements are welcome.
The target of the "conf.d patch" is to simplify the start of vdr esp. with the newer init systems Upstart and systemd.
These systems expect a single "exec" line to start a daemon. Additionally they provide mechanism for
on failure and controlled stopping on shutdown with defined dependencies.
In the past vdr needed a long list of options, every plugin had to be mentioned, and if a plugin also needs
commandline gets longer and confusing. There's also the runvdr template for controlling the start and
restart of vdr,
which has to be adjusted to your personally needs, which makes it difficult for distributions to update
That is why the different distributions developed their own starting mechanisms and reading options for
vdr and plugins
from different files. Now with all options separated from the starting script, it will be easier to share
configuration on different platforms and improve helping each other in adding the right options to your
By default, the conf-files are located at /etc/vdr/conf.d, of course this can be changed via the
Make.config, but not on
the commandline itself, because a vdr with an option won't read the options from the conf-files to maintain backwards
compatibility, so you can't choose a directory on demand. But what you can do, is to symlink different files
conf.d-directory or even symlink the whole directory, to adjust your configuration. Additionally the
directory can be
retrieved by using "pkg-config --variable=argsdir vdr".
To check the current configuration the vdr would use if you start it right now, you can call "vdr --showargs".
Here's an example from my installation:
$ vdr --showargs
--plugin=epgsearch -f /usr/bin/svdrpsend
--plugin=live --port=8008 --ip=0.0.0.0 --log=INFO --epgimages=/var/cache/vdr/epgimages
--plugin=vnsiserver -t 10
--plugin=restfulapi --port=8002 --ip=0.0.0.0 --epgimages=/var/cache/vdr/epgimages
The corresponding conf file looks like:
#### end of /etc/vdr/conf.d/vdr.conf
"showargs" takes as an optional parameter a directory. It will read all *.conf files from the given
directory and prints
the corresponding configuration. This is helpful if you have various configurations and want to compare them.
In the example above I use a single conf file. For a self maintained installation this may be usable, but from the
perspective of a distributor the configuration should be splitted into one file per plugin and a file for
With a package manager in mind, it has been approved, when you install a default configuration file with a plugin
package, this file should be placed at /etc/vdr/conf.avail. To activate the plugin, a symlink can be
placed at the
conf.d directory. And with removing the symlink a plugin can easily be deactivated without removing the
Keep in mind that even if a plugin doesn't need any arguments, a file with "[pluginname]" is needed, so the
loaded. Just like adding "-Ppluginname" to vdr's commandline.
Mostly the order of the plugins is not important, but for those small usecases, where you want to force a
the following should be used:
- The file with the options for vdr-core should actually be called "00-vdr.conf" so it will be read first.
- An additional file "01-vdr-dbg.conf" can be used for special debugging options like "--userdump" etc.
- Files for plugins which like to be loaded first, should be named "10-pluginname.conf".
- Files for plugins which like to be loaded last, should be named "90-pluginname.conf".
- Files for all other plugins with independend order should be named "50-pluginname.conf".
What I like to see in the future is a tool "vdrctl" which will add/remove those symlinks or list the available or
actived plugins etc. I would like to only specify an API for this tool, so every distribution can develop its
Of course there can be a reference implementation like a simple shell-, Perl- or Python-script.
In the following ARGSDIR is the configured conf.d path in your Make.config (or read by pkg-config).
AVAILDIR is ARGSDIR/../conf.avail if not another directory is given.
Filenames are the names of the files without their directory.
vdrctl [global options] command [command options]
read files from <directory> instead of ARGSDIR
read files from <directory> instead of ARGSDIR/../conf.avail
print a sorted list of all configuration files from AVAILDIR
print a sorted list of all configuration files from ARGSDIR
print a sorted list of all configuration files from AVAILDIR which are not symlinked to ARGSDIR
create a symlink in ARGSDIR pointing to the file in AVAILDIR
remove the symlink in ARGSDIR
start an editor so the user can add/remove options to the file in AVAILDIR
vdr mailing list
vdr <at> linuxtv.org