DVArchive Init Script

I recently moved DVArchive from my PC to a Linux machine. Since certain things are missing from the web interface (like being able to control the scheduler and the ability to configure DVArchive), I wanted to run DVArchive in a VNC server session rather than in headless mode. I thought that a few other people might benefit from what I did, so I'll post the instructions here. Feel free to alter username/ports/whatever else as you see fit.

  1. Since we don't want to run DVArchive as root, create a DVArchive user as root:
    adduser dva -c "DVArchive User" passwd dva
  2. Create a directory for DVArchive to use and change the ownership to dva:
    mkdir ~dva/rtvfiles chown dva.dva ~dva/rtvfiles
  3. Launch DVArchive as dva and set it up the way you want. The server portion won't start at this point because it can't open port 80, so you'll see a red circle next to "Server" in the lower right-hand corner. Under the server tab in DVArchive properties, change the "Server port" to 1080. Exit from DVArchive.
  4. Set up a VNC server session as dva. I used 30 as my display number. You'll be prompted to enter a password that you will use for access to VNC. Then, kill the VNC session:
    vncserver :30 vncserver -kill :30
  5. Edit the newly created ~dva/.vnc/xstartup file for VNC, and add the following to the end of the file:
    sleep 10 xterm -title "DVArchive Console" -e /usr/java/current/bin/java -server \ -Xmx128m -jar /usr/local/dva3/DVArchive.jar &
    Change the location of your java executable and DVArchive.jar as necessary.
  6. VNC sets up twm as your window manager by default. This is nice because it's so small, but twm also wants you to click to position new windows. This is undesireable for starting up DVArchive automatically, so you'll need to edit twm's configuration. Copy your system.twmrc to ~dva/.twmrc:
    cp /etc/X11/twm/system.twmrc ~dva/.twmrc
    Then, edit ~dva/.twmrc and add the following line somewhere logical in the file:
    RandomPlacement
    This will cause twm to figure out where to place windows on its own. I copied the system.twmrc because if you just put RandomPlacement in your .twmrc, it toally ignores the system.twmrc and looks even uglier than normal.
  7. Start up your vncserver again, and connect to it using vncviewer:
    vncserver :30 vncviewer &
    Enter "localhost:30" (or whatever host is appropriate) in the vncviewer dialog and the password that you entered for vncserver before. Verify that DVArchive comes up correctly - it may take a while. Then, exit from DVArchive using the GUI and kill your vncserver session again:
    vncserver -kill :30
  8. As root, copy dvarchive into /etc/init.d.
  9. Create a file named /etc/sysconfig/dvarchive and enter the correct information for DVA_USER, DVA_NETDEV/ DVA_IP, DVA_PORT, WEB_PORT, and VNCSERVERNUM as needed. (Or you could just alter /etc/init.d/dvarchive directly.) The file should look something like this:
    # DVArchive configuration for init script DVA_USER=dva DVA_PORT=1080 WEB_PORT=8080 VNCSERVERNUM=:30 # This also works for aliases, like eth0:1 DVA_NETDEV=eth0 # If using DVA_NETDEV doesn't work for you, just set your IP here #DVA_IP=1.2.3.4
    If you've enabled HTTP authentication for the webserver, you'll need to create ~dva/.netrc and add the following:
    machine 1.2.3.4 login admin password MyPaSsWoRd
    Replace the italicized IP, username, and password with your own settings.
  10. Set the proper ownership and permissions on /etc/init.d/dvarchive and ~dva/.netrc (if necessary):
    chown root.root /etc/init.d/dvarchive chmod 755 /etc/init.d/dvarchive chown dva.dva ~dva/.netrc chmod 600 ~dva/.netrc
  11. Run chkconfig as root to add the dvarchive service:
    /sbin/chkconfig --add dvarchive
  12. Start up DVArchive:
    /etc/init.d/dvarchive start
    Hopefully, everything will work! You can use the webserver for most things or connect to the GUI using vncviewer to change DVArchive's configuration or to use the scheduler.

I'm sure I've made some typos or forgotten some steps, so if you discover any, let me know! This was done under Fedora Core 1, but should work under most Linux distributions. Make sure you have the vnc-server and vnc packages installed before you start, and you should be good to go.

(Note: These instructions are based off the instructions here with the addition of VNC. I didn't use the xmln suggestion because it doesn't come with Fedora by default and because it doesn't look like there's an easy way to extract the IP address out of DVArchive.xml easily if you don't specify it explicitly in the configuration.)


Validate XHTML 1.0! Validate CSS! This page was developed by Ryan Herbert using vi and the XHTML 1.0 Strict specifications.