#! /bin/sh /usr/share/dpatch/dpatch-run
## 01_op_server.pl.dpatch by Alejandro Rios P. <alejandro.rios@avatar.com.co>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.

@DPATCH@
diff -urNad trunk~/op_server.pl trunk/op_server.pl
--- trunk~/op_server.pl	2006-05-30 20:26:03.000000000 +0000
+++ trunk/op_server.pl	2006-05-30 23:26:08.000000000 +0000
@@ -308,6 +308,9 @@
     $directorio = $confdir;
 }
 
+open( CONFIG, "<$directorio/op_server.cfg" )
+  or die("Could not open op_server.cfg. Aborting...");
+  
 if ( $logdir ne "" ) {
     open( STDOUT, ">>$logdir/output.log" )
       or die "Can't open output log $logdir/error.log";
@@ -319,7 +322,8 @@
     defined( my $pid = fork ) or die "Can't Fork: $!";
     exit if $pid;
     setsid or die "Can't start a new session: $!";
-    open MYPIDFILE, ">$pidfile";
+    open MYPIDFILE, ">$pidfile"
+       or die "Failed to open PID file $pidfile for writing." ;
     print MYPIDFILE $$;
     close MYPIDFILE;
 
@@ -9151,6 +9155,31 @@
 
 =head1 DESCRIPTION
 
-B<This program> will read the given input file(s) and do someting useful with the contents thereof.
+B<This program> is a proxy server for the Flash Operator Panel. It reads configuration files and updates the data to display on the panel.
 
-=cut  
+=head1 FILES
+
+=over 8
+
+=item B</etc/op-panel>
+
+The configuration files of the operator panel daemon reside in that directory
+(may differ on other distributions). Those include:
+
+=item B<op_server.cfg>
+
+The server's configuration file. See remarks in file for documentation.
+
+=item B<op_buttons.cfg>
+
+Defines the layout of the operator panel, and also which phones to track.
+
+=item B</var/log/op-panel/output.log>
+
+The standard output of the daemon, including debugging prints and dumps.
+
+=item B</var/log/op-panel/error.log>
+
+The standard error of the daemon. Should normally be empty.
+
+=cut
