pertd - A daemon that displays information on the Pertelian USB LCD display

Overview:
This program watches 4 files for data.  Each file is displayed on a 
seperate line of the 4 line LCD display.  If the lines are more than 
the 20 chars allowed for each line, the data is scrolled horizontally.

The interface to the daemon is through files.  The names and locations
of these files are set via a configuration file /etc/pertd.conf

The program is set to go daemon right away.  So when you run pertd,
you will get a prompt back immediately as it goes off into the background
and not be terminated when you log off.

Note that on my system (Mandriva 2006), when the user logs off, ownership
of /dev/ttyUSB0 goes back to root.  So it's probably a good idea to run
this daemon as root.  See the service directory for turning pertd into
a service that runs when the system boots.

Configuration:
stop_file_name - 
   The name of the file to indicate to pertd to stop.  When the file exists,
   it's deleted and pertd terminates cleanly.
   Default: pertstop

backlighton_file_name - 
   The name of the file to indicate that pertd should turn the backlight on.
   When the file exists, it's deleted and the backlight is turned on.
   Default: backlighton

backlightoff_file_name - 
   The name of the file to indicate that pertd should turn the backlight off.
   When the file exists, it's deleted and the backlight is turned off.
   Default: backlightoff

refresh_file_name - 
   The name of the file to indicate that pertd should schedule at its earliest
   moment to re-examine for changes the four files it's watching.

data_file_1
data_file_2
data_file_3
data_file_4 -
   Data files.  The data in data_file_1 will be displayed on the first line,
   and so on.  If the file does not exist, the line will be blank.
   Default: pert1 pert2 pert3 pert4

refresh_time -
   The interval for re-reading the data files for new information.
   In seconds.
   Default: 60

delay_time -
   The interval between screen refreshes in ms.  (1000000ms = 1 second)
   This will basically control how fast the Pertelian scrolls the data
   across the screen.
   Default: 500000 (1/2 second)

device - 
   The device the Pertelian is on.
   Default: /dev/ttyUSB0

pidfile -
   The path and filename for where the daemon's PID will be written.

I release my code into the Public Domain.  Have fun, but use this code
and the resulting program at your own risk. --Ron Lauzon

2006/11/17 Updated by Pred S. Bundalo
