[FreeNX-kNX] Introduction

Fabian Franz FabianFranz at gmx.de
Thu Jul 26 14:41:21 UTC 2007


> Hi,

Hi,

> I've been doing some work on the Freenx code for use here in Google.

Wow, that are great news!

> One of the bigger things I've been doing is combining all logging to use
> syslog for easier debugging etc, along with some less invasive stuff.
> I'll be sending in some of the smaller patches in the next day or so.

Nice, I am awaiting them eagerly.

> Anyway, the reason I'm writing this is that with the announced
> re-write of Freenx to support the 3.0 NoMachine nx libraries, I'd like
> to offer some help with the design/coding. 

Okay.

> As this is part of my
> day-job, I should be able to dedicate most of my time to it. I guess
> the first thing we (mostly Fabian -) need to decide is the general
> design of the next release, and then work out how we can divide the
> labour etc.

Yes, the design is on paper, but some things are not yet worked out, yet.

However one component is very clear already and based on the work you have done on syslog would be perfectly suited for you, I think:

Take a look at nxserver-login from http://svn.berlios.de/svnroot/repos/freenx/freenx-redesign/server/compatibility/nxserver-login.

There is a FIXME and some helper functions.

This helper functions should be imported from nxloadconfig. The parameters used for nxloadconfig are only --config="name", which means:

$PATH_ETC/name.conf and $PATH_ETC/general.conf will be sourced.

nxloadconfig basically should be like (and could be based on current nxloadconfig):

- Parse commandline parameters (--config for now)
- Setup some hard path defaults like:

PATH_BIN, PATH_LIB, ...

(- Setup i18n with scope general or nxloadconfig)

- Setup COMMAND_ defaults
- Source $PATH_ETC/general.conf
- Source $PATH_ETC/<name>.conf # from --config=name
- Check that all paths in general.conf are basically valid and give a warning (in log) and revert to default if thats not the case

- Supply the following variables and subfunctions:

# Used internal subfunctions:
#
# @sub echo_x echo and possibly log and/or translate
# @sub read_x read with specified timeout
# @sub "read_x_prompt <prompt> " like read_x but show <prompt> first
# @sub "log n" log to (sys)log with loglevel n
#
# Used internal variables:
#
# @var LOG_INFO Used for loglevel "Information"
# @var LOG_WARN Used for loglevel "Warning"
# @var COMMAND_NETCAT Complete path to netcat binary

Examples can be found in nxserver-login like above.

(- Setup i18n with scope <name>)

Please tell me what you think, the current nxloadconfig can be used as basis, but --check and so on are no longer needed.

Perhaps logging could be put to another component like nxlog though (that would take into account some variable like NXLOG_NAME=<name>) as I have heard that some components for the redesign might not be in bash, so that they can be easily used from other languages as well.

And while you are at it, you could add the possibility to just open a pipe to nxlog as well:

if [ "$#" = "0" ]
then
while read line
do
log $line # no "" here to have it split up in different levels
done
else
log "$@"
fi

On the other hand nxlog could use nxloadconfig as well and just not set a new name so that the current environment was still used ...

Please tell me what you think.

cu

Fabian



More information about the FreeNX-kNX mailing list