################################################################################
#                                                                              #
#        PowerPanel for Linux software deployment instruction                  #
#                                                                              #
################################################################################

Outline

1 Un-compress installation package
2 Copy files
3 Compress man page file
4 Change file owner
5 Change file mode
6 Setup daemon for auto startup
7 Setup environment path 
8 Startup daemon

1. Un-compress 'powerpanel-x.x.tar.gz' installation package.


2. Copy files

2.1 Executable programs

Copy 'bin/pwrstat' to '/usr/sbin' directory.
Copy 'bin/pwrstatd' to '/usr/sbin' directory.

2.2 Event notify script

Copy 'script/pwrstatd-powerfail.sh' to '/etc' directory.
Copy 'script/pwrstatd-lowbatt.sh' to '/etc' directory.
Copy 'script/pwrstatd-email.sh' to '/etc' directory.
Copy 'script/shutdown.sh' to '/etc' directory.
Copy 'script/hibernate.sh' to '/etc' directory.

2.3 Daemon startup shell script

According Linux distributor to copy specific script to '/etc/init.d' directory
and change name to 'pwrstatd'.
Copy 'script/suse_pwrstatd' for SUSE Linux.
Copy 'script/redhat_pwrstatd' for Red Hat Linux.
Copy 'script/debian_pwrstatd' for Debian or Ubuntu Linux
Copy 'script/default_pwrstatd' for Others.

2.4 Daemon configuration file
Copy 'conf/pwrstatd.conf' to '/etc' directory.

2.5 Man page file

Copy 'doc/pwrstat.8' to '/usr/share/man/man8' directory.
Copy 'doc/pwrstatd.8' to '/usr/share/man/man8' directory.

3. Compress Man page file [optional]

Compress both of 'pwrstat.8' and 'pwrstatd.8' in '/usr/share/man/man8'
directory.

for example command:
  /bin/gzip -9 /usr/share/man/man8/pwrstat.8
  /bin/gzip -9 /usr/share/man/man8/pwrstatd.8

4. Change file owner

The following files have to change its owner to 'root': 
/usr/sbin/pwrstat
/usr/sbin/pwrstatd
/etc/pwrstatd-powerfail.sh
/etc/pwrstatd-lowbatt.sh
/etc/pwrstatd-email.sh
/etc/shutdown.sh
/etc/hibernate.sh
/etc/init.d/pwrstatd
/etc/pwrstatd.conf
/usr/share/man/man8/pwrstat.8.gz
/usr/share/man/man8/pwrstatd.8.gz

5. Change file mode

The following files have to change its mode to 700:
/usr/sbin/pwrstat  
/usr/sbin/pwrstatd  
/etc/pwrstatd-powerfail.sh  
/etc/pwrstatd-lowbatt.sh 
/etc/pwrstatd-email.sh
/etc/shutdown.sh
/etc/hibernate.sh
/etc/init.d/pwrstatd  
/etc/pwrstatd.conf
  
The following files have to change its mode to 644:
/usr/share/man/man8/pwrstat.8.gz
/usr/share/man/man8/pwrstatd.8.gz

6. Setup daemon for auto startup and termination

create link file of /etc/init.d/pwrstatd to run-level 2,3,4,5.

for example, command for run-level 2:
ln -s /etc/init.d/pwrstatd /etc/rc.d/rc2.d/K99pwrstatd
ln -s /etc/init.d/pwrstatd /etc/rc.d/rc2.d/S99pwrstatd

7. Setup environment path [optional]
Export '/usr/sbin' path if necessary

8. Startup daemon
Startup daemon by command '/etc/init.d/pwrstatd start' at right now.
