Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: Problems with exit-states (VDR-1.2.2)



Steffen Barszus wrote:
> 
> Am Mittwoch, 27. August 2003 08:40 schrieb Klaus Schmidinger:
> > Rene Bartsch wrote:
> > > Am Die, 2003-08-26 um 18.24 schrieb Klaus Schmidinger:
> > > > > I also have strange problems with the command-line. VDR
> > > > > complains about things like "unrecognized option:
> > > > > --mount=mount.sh" although it loads the mp3-plugin or other
> > > > > plugins. vdr --help shows the plugin and it's options fine.
> > > > >
> > > > > My init-script is ready for a week now and it certainly could
> > > > > replace runvdr quite well (it has extensive error-recovery and
> > > > > logging - I'll post it on the list when it works), but I'm
> > > > > struggling with the command-line.
> > > > >
> > > > > I've tested a lot of strings with quotations, (back-)slashes,
> > > > > etc. but either vdr complains about wrong plugin-options or
> > > > > returns wrong exit-codes. It also could be some kind of
> > > > > parsing-error.
> > > > >
> > > > > Could you give me an example of a command-line with several
> > > > > plugins and several options for each plugin which definitely
> > > > > works for you?
> > > >
> > > > I'm afraid my command line isn't complex enough.
> > > > Cahnces are you have done something wrong with quotes (or lack
> > > > thereof).
> > > >
> > > > If you post your command line here, I'm sure somebody can
> > > > pinpoint the problem.
> > >
> > > Ok, here's one of the hundreds of lines I've tested. The
> > > init-script generates such lines directly from config-files (one
> > > for each plugin)
> > >
> > > -------------------- snip
> > > --------------------------------------------
> > >
> > > vdr --config=/etc/vdr --record=vdrreccmd --shutdown=vdrshutdown
> > > --terminal=/dev/tty1 --watchdog=60 -P\"dxr3 \" -P\"control
> > > --terminal=/dev/tty9 --port=2002 \" -P\"games \" -P\"mp3
> > > --mount=mount.sh --cddb=/var/lib/cddb \"  -P\"mplayer
> > > --mount=mount.sh --mplayer=mplayer.sh \" -P\"remote --tty
> > > /dev/tty10 \" -P\"vcd --vcd=/dev/cdrom \"
> > >
> > > -------------------- snap
> > > --------------------------------------------
> >
> > Is this one long line, are is it wrapped?
> > In the form you posted it it can't work, since onle the part
> 
> Of course it is one big line and further:
> 
> su -c "vdr --config=/etc/vdr --record=vdrreccmd --shutdown=vdrshutdown \
>                 --terminal=/dev/tty1 --watchdog=60 -P\"dxr3 \" -P\"control              \
>                 --terminal=/dev/tty9 --port=2002 \" -P\"games \" -P\"mp3              \
>                 --mount=mount.sh --cddb=/var/lib/cddb \"  -P\"mplayer           \
>                 --mount=mount.sh --mplayer=mplayer.sh \" -P\"remote --tty               \
>                  /dev/tty10 \" -P\"vcd --vcd=/dev/cdrom \" " vdr

Ok, I've put this in a more readable form:

su -c "vdr --config=/etc/vdr --record=vdrreccmd --shutdown=vdrshutdown \
           --terminal=/dev/tty1 --watchdog=60 \
       -P\"dxr3 \" \
       -P\"control --terminal=/dev/tty9 --port=2002 \" \
       -P\"games \" \
       -P\"mp3 --mount=mount.sh --cddb=/var/lib/cddb \" \
       -P\"mplayer --mount=mount.sh --mplayer=mplayer.sh \" \
       -P\"remote --tty /dev/tty10 \" \
       -P\"vcd --vcd=/dev/cdrom \" \
      " vdr

which is the form I would use if I had a system with lots of plugins.
Well, actually I guess I would write

su -c 'vdr --config=/etc/vdr --record=vdrreccmd --shutdown=vdrshutdown \
           --terminal=/dev/tty1 --watchdog=60 \
       -P"dxr3 " \
       -P"control --terminal=/dev/tty9 --port=2002 " \
       -P"games " \
       -P"mp3 --mount=mount.sh --cddb=/var/lib/cddb " \
       -P"mplayer --mount=mount.sh --mplayer=mplayer.sh " \
       -P"remote --tty /dev/tty10 " \
       -P"vcd --vcd=/dev/cdrom " \
      ' vdr

which saves a lot of backslashes.

However, I can't see anything wrong with quotes or backslashes, so I
take that remark ("Just because one user has trouble using quotes...")
back and apologize.

I'll see if I can do some debugging tonight to check whether there is
a bug in parsing this line.

Are you sure that both the "mp3" and the "mplayer" plugin recognize
the option "--mount"?

> > Please send the line **EXACTLY** the way it is given to the shell.
> > That's either with '\' at the end of wrapped lines, or as one single
> > long line (make sure your mailer doesn't wrap it!).
> 
> See above.
> 
> > > By the way I'd like to suggest to drop options on command-line and
> > > ask the plugin-developers to put their option for starting up into
> > > a config-file as command-line parsing gets to complicated (please
> > > consider the string above is for seven plugins only!)
> >
> > ****************************************************
> > PLEASE, DON'T DO THIS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> > ****************************************************
> >
> > Having (separate) configuration files for each plugin would make
> > things unnecessarily complicated. Each plugin would have to implement
> > ways of reading, parsing and writing these files. Using command line
> > parameters is a simple and efficient way to configure these things.
> > Just because one user has trouble using quotes the right way
> > shouldn't trigger an IMHO unnessesary orgy of config files.
> 
> Well  .... vdr reads is own config too, why shouldn't a plugin read its
> config the same way ?

Plugins already store their config parameters (those presented to the
user through the respective "Setup" menu, as well as other status variables
they would like to "survive" a restart of VDR) in that very same file.

What I'm talking about here are those parameters that the plugins need
to know when the program ist _started_. For instance, the "control"
plugin needs to know which terminal to use. If I want to vary that parameter
I find it easier to give it in the command line than to edit a config file.

> I don't see where an orgy of config files should
> come from ?

Well, every plugin using it's own config file?!

> And the "one user has trouble using quotes the right way"
> is a bit harsh, it is even not clarified that the problems do come from
> the quoting.

See above.

> Of course vdr is your baby, but i don't see the cause you
> react that way.

Well, sometimes one has to make one's intentions very clear,
very fast, because once plugin authors start messing with config
files there's probably no way of stopping them. I, personally,
think that using command line parameters should be the way to go.
Nothing keeps people from writing their individual VDR start sequence
into a file, like the example I wrote above!

> > So, again
> >
> > ****************************************************
> > PLEASE, DON'T DO THIS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> > ****************************************************
> >
> > I'd hate to have to edit config files if all I want is to set a
> > simple parameter for a plugin.
> 
> does it exclude each other ?

I don't think anybody would go to the trouble of implementing _both_
features.

> > I know I can't enjoin on plugin developers how to handle their
> > parameters, but I strongly advise to stay with using command line
> > parameters for things that need to be set individually at startup,
> > and store other things in the setup facilities already provided.
> > Surely, the plugin interface allows plugins to have their own config
> > files in the 'ConfigDirectory()', but those are for other things, not
> > startup parameters.
> >
> > Klaus
> 
> I really don't see why you have these strong concerns ....

Well, I'd like to have plugins use command line options, as the plugin
interface was designed. I'd hate to see that being broken, that's all.

If people feel they need to do this differently, there's probably
nothing I can do about that, except expressing my "strong concerns"...

Klaus


-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index