Linux

To run the xTuple Connect Batch Manager as if it were a service on Linux, you will need to use the VNC server from RealVNC. An open source version of the VNC server is freely available. With the vnc-server rpm or vnc4server package installed on your Linux server, you will have all the necessary tools installed to implement this solution. The first thing you need to do is install the xTuple Connect Batch Manager and make sure it is set up and working correctly for the chosen user. We recommend that you set up an additional, separate user for the xTuple Connect Batch Manager to run as. Once the xTuple Connect Batch Manager is installed, you will next need to set up the VNC server for the same user you want to run the xTuple Connect Batch Manager as. The easiest method for doing this is to log in as the user and run the following command:

vncserver :1

In this case we specified :1 which specifies the terminal to use. As you will see, this detail will become important later. Typically :1 will be sufficient; however, if you have other VNC server sessions set up, you may need to use a different number. For the rest of this document we will assume only one VNC server session is installed. When the vncserver :1 command runs, it will create a directory in the user's home called .vnc and ask for a password. Once the VNC server is running, you can log in with a VNC viewer and check to see what it looks like before continuing. Once done, you should shut down the server with the following command:

vncserver -kill :1

Next, you should edit the xstartup file in the .vnc directory. This file is run by the VNC server program when VNC is started. It allows you to run other applications at startup. In most cases, the last line of the xstartup file reads as follows:

twm &

Add the call to the xTuple Connect Batch Manager immediately after this. The command is very similar to the one you would use to run the xTuple Connect Batch Manager from the command line normally. In the command, you should include the options to specify the database, username, and password so that the xTuple Connect Batch Manager will start up without prompting for a login. You might also want to add the '-geometry' option to specify the size and location of the active window. To guard against unforeseen circumstances and the inevitable user who always exits from applications, you might want to wrap the xTuple Connect Batch Manager startup command in a loop. The following example incorporates all of these elements:

while true ; do # loop forever
    BatchManager -geometry 300x320+10+10 -databaseURL=psql://localhost/mydb:5432 -username=admin -password=@xtconnect1 -noAuth
    sleep 600   # wait 10 minutes before restarting the BatchManager if it exits
    done        # to guard against eating machine time if the BatchManager fails repeatedly

Finally, save and exit the xstartup file.

Now update the /etc/sysconfig/vncserver configuration file. If your system does not have one, then you will have to find or create one. Note that some versions of Linux store these service startup files in other directories, such as /etc/rc.d or /etc/initd.d. In this file there is a line which looks like the following:

VNCSERVERS="1:myusername"

This line may or may not be commented out with a # symbol. If it is, uncomment it by removing that symbol and any additional spaces at the front of the line. This line tells the VNC server service which servers to start up for which user at boot up. The example above references the same server number we used earlier, along with the username separated by a colon. On your system, change the server number and user name to the correct values. Then save and exit the configuration file. Now make sure that the VNC server service is started when the system is booted. The easiest way to do this on your Linux server is by using the chkconfig command. Logged in as the administrator of the server, issue the following command:

chkconfig –add vncserver

At this point, the only thing left to do is start the service and make sure it is working correctly. To start the service, you issue another administrator command:

service vncserver start

You should see a message indicating that the service was started successfully. Now log into the VNC session and check to make sure the xTuple Connect Batch Manager is running correctly. If it is, you have successfully completed the set up. If it is not running, you will need to determine what caused it to fail and correct the problem.