[Bese-devel] Re: Load a custom ucwctl.conf

Luca Capello luca at pca.it
Mon Apr 17 21:10:38 UTC 2006


Hi Nathan!

I'm answering to the list, I found your remarks interesting for
others, too.  I hope you don't mind ;-)

On Mon, 17 Apr 2006 17:31:20 +0200, Nathan Bird wrote:
>> [...] What happens, in order:
>>
>>  1. /etc/ucw/ucwctl.conf is included (if present)
>>  2. $HOME/.ucw/ucwctl.conf is included (if present)
>>  3. if the option -u is used, the file specified is included if
>>     readable, otherwise exit with an error (you specify a file that
>>     doesn't exist or you cannot read?)
>>  4. all the variables specified via command line options overwrite
>>     the values in one of the three ucwctl config files
>
> I like the look of that. Am I correctly interpreting that options
> set in later steps override the earlier ones, or is that just the
> command line ones in step 4?

Yes, you're correct in your interpretation.  If you've both
/etc/ucw/ucwctl.conf and $HOME/.ucw/ucwctl.conf, the latter overrides
the former, but only for values that are set in the latter.

>> Nathan, I think this was what you asked for, right?  Do you (or
>> other) want to test the patch before inclusion?
>
> I'll give it a whirl, where can I get it? None of the 16(!) patches
> I pulled this morning jumped out at me as doing this.

Included a preliminary patch, you need to apply it with

  $ cd /path/to/ucw_dev/bin
  $ gunzip -c /path/to/file | patch

As soon as it will be confirmed to work as expected, I'll commit to
ucw_dev.

> With all the other configurability, having a systemwide startup
> doesn't worry me anymore. Why a user wouldn't want to use the
> default /var is if he is running two instances of UCW at once (which
> I have done a few times, but not commonly), or two users are running
> it at once (frequently). Won't they collide on the pid/socket files?

The first problem with the default /var is that a normal user cannot
create files/folders in it, so I think we need to default to $HOME/var
for a normal user when $VARROOT is empty (already present in the
attached patch).  In case an user (root or not) want to start two
instances, he needs to specify the necessary variables.

The other problem is the one you pointed out: with the default values
(and with the commands ucwctl uses), if you start two processes
they'll try to share the same socket (impossible) and log files
(undesirable).  So, we need to modify how we create sockets, pid and
log files.

IMHO the better solution will be to check if the socket is present
before parsing the command parameter (so, after having parsed all the
variables).  If it's present, the script will exit with an error,
otherwise it'll continue.  Waiting for comments...  :-)

Another option we can add is the ability to use ucwctl without
detachtty, something like -d or --no-detachtty: it starts UCW via
cl-launch, but on the same terminal you are.  Could it be useful?

Thx, bye,
Gismo / Luca

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ucwctl_ucwctl-config_20060417.patch.gz
Type: application/octet-stream
Size: 1082 bytes
Desc: first implementation of the custom ucwctl.conf option
URL: <https://mailman.common-lisp.net/pipermail/bese-devel/attachments/20060417/0ce18969/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/bese-devel/attachments/20060417/0ce18969/attachment.sig>


More information about the bese-devel mailing list