www.schorsch.com

Rayfront 1.0 User Manual

Contact | Sitemap | Search

Remote Simulations with Rayserver

(This feature is not available with demo versions.)

Note: If the description below leaves you confused, please ask your unix system and/or network administrator to help you. The manipulations explained herein may be difficult or dangerous when executed by someone not familiar with unix type operating systems.

SECURITY WARNING:
The networking functionality in Rayfront offers no explicit security features. A Rayserver running on one of your systems will allow anyone who is able connect to the right port number on that system to request simulations to be run there, given enough information about the projects available to it.
It is in the responsibility of the user to make sure that only authorized machines can make such requests on his local network. Most likely, a firewall system shielding that local network from the rest of the interenet will be required for this purpose, possibly together with more specific network access configurations on the system running the server. Please refer to the disclaimer of warranty in the Rayfront end user license for warranty details.

What is Rayserver?

Rayserver is a daemon program for unix systems that accepts and processes simulation requests from other hosts on your local network. When both the Rayfront program on your local system and the Rayserver on a remote machine are configured correctly, then you can select that remote system when starting a simulation. The two programs will then communicate with each other, and the simulation will run on the remote host.

All network communication and information exchange will happen completely transparent to the user, so that you won't have to worry about any technical details.

Note that while it is possible to run the Rayserver on Windows (although without most of the features described below), it won't normally make sense to do so. The problem here is, that Radiance for Windows is not able to lock the ambient files. When a simulation running on Windows accesses an ambient file concurrently with an other process, then this will result in a corrupted file. Radiance on unix is capable to syncronize access to the ambient file between different processes through the NFS file locking mechanism.

Starting the Rayserver

Running a rayserver requires that the host configuration files are set up correctly on all systems involved.

The Rayserver is a command line program with the following syntax:

  rayserver [-f | -d] [-u user] [-g group] [-m mask]

   -f        run in foreground mode
   -d        run in background daemon mode (default)
             (-f and -d are mutually exclusive)
   -u user   run and create all files as username/UID
   -g group  run and create all files as groupname/GID
   -m mask   set the umask to mask (default 002)
			

In the simplest case, you can just log in to your unix host, and type

  $> rayserver

from a shell prompt. The server will then issue a message like the following:

  Rayserver 32332 switching to daemon mode.

and your shell prompt will return. The message informs you that the server has spawned a background process with the process ID 32332, which is now waiting for jobs from the network. You can check the existence of the background process with the ps command, and terminate it with the kill command. Note that the actual background process will run the program rfcore, like most Rayfront related processes. You can identify it by the path of its second argument, which differs from a normal Rayfront process (assuming a posix compliant ps):

  $> ps x
    PID TTY STAT TIME COMMAND
  ...
  32332 ?   S    0:00 rfcore -O /.../server/start.pyo
  ...
  $> 

If the directory of the file "start.pyo" is "server", then the process is a Rayserver (if it was "editor", then it would be a Rayfront user interface process, if the file was "procwrap.pyo", then it would be the controlling process of an actual simulation).

Troubleshooting

If you don't find a process list entry like the one above, then the background process may have encountered a problem, and terminated itself. In this case, it will have tried to write a diagnostic message to the file rayfront/srvlogs/>hostname< in your installation, where >hostname< is the name of your system.

If there is no logfile entry (or no logfile), then the process probably had no permission to write to that file or to create it. You should give the user ID you want to run Rayserver with write permission to that directory and file.

For troubleshooting, you can start the Rayserver in foreground mode:

  $> rayserver -f
  render_server: adding channel <render_server  at 8116040>
  render_server: Async Rayfront Server started on port 9182

  Rayserver 32396 running.

Now you can see all it's diagnostic output, without having to look at the logfile every time. To stop the server again, type <CTRL>-C.

User Access Management

To do it's job, the Rayserver needs to access and write to files in the project directory of the user requesting a simulation. In order to allow potentially several human users and the server to work together, it is advised to make use of a suitable unix group ID configuration.

The concept here is that all users (and the server is just another "user" in this context) belong to the same group. They will then have to create all their files and directories with write permission for the owner and the group, eg. by using a umask value of 002.

If you want to invoke the Rayserver automatically during boot time, then it will normally be started by root. In this case, you can use th -u and -g options to switch to another user after startup. Assuming the server should run as the user "ray", and in the group "rfusers", then the invocation would look like this:

  $> rayserver -u ray -g rfusers
  Rayserver running as user "ray" (500).
  Rayserver running as group "rfusers" (100).
  Rayserver 32451 switching to daemon mode.
  $>

The server will then behave exactly as if it has been started by that user in that group. It is impossible for the process to switch back to the original user and group after this.

Working with Samba
If your data is physically stored on a unix machine, and you are accessing it from Windows clients through a Samba server, then you need to make sure that the following two lines are present in your "smb.conf" file (normally in the section that specifies the access parameters to the share where your Rayfront data is located):

  create mask 664
  directory mask 775
Or alternatively:
  create mask 774
  directory mask 775

The first two digits "66x" and "77x" are the important ones, so that the owners and their group get full access to any newly created files and directories. Using "77x" for "create mask" will make the unix system consider all created files as executables, which is not required but should not cause any problems. You can define the world access rights (the last digit) more or less restrictive than in those examples, according to your network access policies. Most default Samba installations don't give new files and directories full group access, which will cause the Rayfront/Rayserver collaboration model to fail.

Diagnostics

If the server encountes a problem, it will write a diagnostic message to the file rayfront/srvlogs/>hostname< in your installation, where >hostname< is the name of your system. If it is running in foreground mode, it will also print this message to the terminal.

Daemon mode and user/group switching not available on this platform.
Although the Rayserver is able to run on Windows systems, most of the advanced options are not available there.

Duplicate user name argument.
Duplicate group name argument.
Duplicate umask argument.
The user name, group name, and umask arguments may each appear only once on the command line.

-d and -f options are mutually exclusive.
-f and -d options are mutually exclusive.
The server is unable to run in foreground and background mode at the same time.

Unknown option "<option>".
You probably mistyped an option.

Missing user after "-u".
Missing group after "-g".
Missing umask after "-m".
One of the options that require an argument was given without one.

umask must be three digits between 0 and 7.
The umask consists of a single octal digit for each of the user, the group, and the world.

User name "<user>" not found.
User ID "<UID>" not found.
The given user name or UID doesn't exist on the system.

Unable to run as user "<user>" (<UID>).
The given user name or UID exists, but we don't have enough priviledges to assume it's identity.

group name "<group>" not found.
group ID "<GID>" not found.
The given group name or GID doesn't exist on the system.

Unable to run as group "<group>" (<GID>).
The given group name or GID exists, but we don't have enough priviledges to assume it's identity.

Socket Error: (98, 'Address already in use')
retrying in 30 secs...

Most likely, there is already a Rayserver running on the system. The new process will try to get hold of the socket three times before it gives up and exits.

*User Interrupt*
The user typed <CTRL>-C at the console, or the process received an interrupt signal (2). This causes the server to exit.

*System Exit*
*System Exit* (caught signal <num>)
The server is exiting, possibly due to a signal received. If there is no "(caught signal <num>)" specified, then it is possible that you have discovered a bug in Rayserver. If you can reproduce this problem, please send a report to the author, specifying as much detail about the specific circumstances as possible.

Rayserver 2345 internal error. Restarting.
You have discovered a bug in Rayserver. If you can reproduce this problem, please send a report to the author, specifying as much detail about the specific circumstances as possible.

Navigation:

Up:
User Manual Overview

Previous:
Operation within Autocad/Intellicad
next:
Importing Geometry Data
http://www.schorsch.com/en/software/rayfront/manual/srvrun.html
Copyright © 2004-2013 schorsch.com