Apcupsd: Difference between revisions

From CBLFS
Jump to navigationJump to search
Oppiz (talk | contribs)
New page: {| style="text-align: left; background-color: AliceBlue;" |- !Download Source: | http://superb-west.dl.sourceforge.net/sourceforge/apcupsd/apcupsd-3.14.0.tar.gz |} ---- == Introduction t...
 
Cosmo (talk | contribs)
Added homepage
 
(13 intermediate revisions by 2 users not shown)
Line 2: Line 2:
|-
|-
!Download Source:
!Download Source:
| http://superb-west.dl.sourceforge.net/sourceforge/apcupsd/apcupsd-3.14.0.tar.gz
| http://downloads.sourceforge.net/apcupsd/apcupsd-{{Apcupsd-Version}}.tar.gz
|}
|}


----
----


== Introduction to Apcupsd ==
{{Package-Introduction|Apcupsd is a deamon that talks with APC ups and monitors it's status. There are alot of devices that it will work with one should read up on it.|http://www.apcupsd.org/}}


Apcupsd is a deamon that talks with APC ups and monitors it's status. There are alot of devices that it will work with one should read up on it.
== Dependencies ==
 
=== Optional ===
* [[TCP Wrappers]]
* [[GD]]
* [[libusb]]
* [[Gtk2]] and [[GConf]] (Required to build gapcmon)
 
== Configuration Information ==
 
MANUAL: http://www.apcupsd.org/manual/index.html


== Dependencies ==
--enable-usb: Turns on generation of the USB driver code.
 
--with-upstype=<YOUR_UPS>: This option allows you to specify the type of UPS that will be connected to your computer
 
--with-upscable=<YOUR_CABLE>: This option allows you to specify what cable you are using to connect to the UPS
 
--enable-cgi: Enables the building of the CGI programs that permit Web browser access to apcupsd data
 
--with-cgi-bin=<CGI_DIR>: Points to your CGI dir
 
--enable-gapcmon: A Gtk2/GLib2 GUI application used to monitor UPS devices controlled by the APCUPSD package.


=== Required ===
--enable-powerflute: Is a ncurses based program to monitor the UPS.


== Non-Multilib ==
== Non-Multilib ==
Line 19: Line 39:
Compile the package:
Compile the package:
   
   
./configure --prefix=/opt/apc --with-log-dir=/var/log \
./configure --prefix=/usr --with-log-dir=/var/log \
--enable-usb --with-upstype=usb --with-upscable=usb &&
    --enable-usb --with-upstype=usb --with-upscable=usb \
    --enable-cgi --with-cgi-bin=/srv/www/cgi-bin \
    --enable-gapcmon --enable-powerflute &&
  make
  make


Install the package
Install the package:


  make install  
  make install


== Multilib ==
== Multilib ==
Line 33: Line 55:


Compile the package:
Compile the package:
  CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" PKG_CONFIG_PATH="$PKG_CONFIG_PATH32" USE_ARCH=32 \
 
  CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" \
PKG_CONFIG_PATH="$PKG_CONFIG_PATH32" USE_ARCH=32 \
  ./configure --prefix=/usr --with-log-dir=/var/log \
  ./configure --prefix=/usr --with-log-dir=/var/log \
--enable-usb --with-upstype=usb --with-upscable=usb &&
    --enable-usb --with-upstype=usb --with-upscable=usb \
    --enable-cgi --with-cgi-bin=/srv/www/cgi-bin \
    --enable-gapcmon --enable-powerflute &&
  make
  make


Install the package
Install the package:


  make install
  make install
Line 44: Line 70:
=== N32 ===
=== N32 ===


TO DO!
CC="gcc ${BUILDN32}" CXX="g++ ${BUILDN32}" \
PKG_CONFIG_PATH="$PKG_CONFIG_PATHN32" USE_ARCH=n32 \
./configure --prefix=/usr --with-log-dir=/var/log \
    --enable-usb --with-upstype=usb --with-upscable=usb \
    --enable-cgi --with-cgi-bin=/srv/www/cgi-bin \
    --enable-gapcmon --enable-powerflute &&
make
 
Install the package:
 
make install


=== 64Bit ===
=== 64Bit ===


Compile the package
Compile the package:


  CC="gcc ${BUILD32}" CXX="g++ ${BUILD64}" PKG_CONFIG_PATH="$PKG_CONFIG_PATH64" USE_ARCH=64 \
  CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" \
PKG_CONFIG_PATH="$PKG_CONFIG_PATH64" USE_ARCH=64 \
  ./configure --prefix=/usr --with-log-dir=/var/log \
  ./configure --prefix=/usr --with-log-dir=/var/log \
--enable-usb --with-upstype=usb --with-upscable=usb &&
    --enable-usb --with-upstype=usb --with-upscable=usb \
    --enable-cgi --with-cgi-bin=/srv/www/cgi-bin \
    --enable-gapcmon --enable-powerflute &&
  make
  make


Install the package
Install the package:


  make install
  make install
Line 63: Line 102:
=== BootScript ===
=== BootScript ===


Init script IS NOT yet included in the [[blfs-bootscripts]] package.
Create the bootscript:


cat > /etc/rc.d/init.d/apcupsd << "EOF"
  #!/bin/sh
  #!/bin/sh
  # Begin $rc_base/init.d/apcupsd
  # Begin $rc_base/init.d/apcupsd
 
  # Based on sysklogd script from LFS-3.1 and earlier.
  # Based on sysklogd script from LFS-3.1 and earlier.
  # Rewritten by zippo zippo@oppiz.net
  # Rewritten by zippo zippo@oppiz.net
 
  #$LastChangedBy: oppiz  
  #$LastChangedBy: oppiz  
  #$Date: 2007-02-15 00:13:00Hrs
  #$Date: 2007-02-15 00:13:00Hrs
 
  . /etc/sysconfig/rc
  . /etc/sysconfig/rc
  . $rc_functions
  . $rc_functions
 
  case "$1" in
  case "$1" in
     start)
     start)
Line 83: Line 123:
         sleep 1
         sleep 1
         ;;
         ;;
 
     stop)
     stop)
         boot_mesg "Stopping Apcupsd Server..."
         boot_mesg "Stopping Apcupsd Server..."
         killproc /sbin/apcupsd
         killproc /sbin/apcupsd
         ;;
         ;;
 
     reload)
     reload)
         boot_mesg "Reloading Apcupsd Server..."
         boot_mesg "Reloading Apcupsd Server..."
         reloadproc /sbin/apcupsd
         reloadproc /sbin/apcupsd
         ;;
         ;;
 
     restart)
     restart)
         $0 stop
         $0 stop
Line 99: Line 139:
         $0 start
         $0 start
         ;;
         ;;
 
     status)
     status)
         statusproc /sbin/apcupsd
         statusproc /sbin/apcupsd
         ;;
         ;;
 
     *)
     *)
         echo "Usage: $0 {start|stop|reload|restart|status}"
         echo "Usage: $0 {start|stop|reload|restart|status}"
Line 109: Line 149:
         ;;
         ;;
  esac
  esac
# End $rc_base/init.d/apcupsd
EOF
chmod -v 754 /etc/rc.d/init.d/apcupsd


  # End $rc_base/init.d/apcupsd
Link it into the runlevels:
 
  for link in /etc/rc.d/rc{{0,1,6}.d/K50,{2,3,4,5}.d/S15}apcupsd; do
  ln -sfv ../init.d/apcupsd $link;
done
 
[[Category:Power Management]]

Latest revision as of 11:00, 25 March 2009

Download Source: http://downloads.sourceforge.net/apcupsd/apcupsd-3.14.5.tar.gz

Introduction to Apcupsd

Apcupsd is a deamon that talks with APC ups and monitors it's status. There are alot of devices that it will work with one should read up on it.

Project Homepage: http://www.apcupsd.org/

Dependencies

Optional

Configuration Information

MANUAL: http://www.apcupsd.org/manual/index.html

--enable-usb: Turns on generation of the USB driver code.

--with-upstype=<YOUR_UPS>: This option allows you to specify the type of UPS that will be connected to your computer

--with-upscable=<YOUR_CABLE>: This option allows you to specify what cable you are using to connect to the UPS

--enable-cgi: Enables the building of the CGI programs that permit Web browser access to apcupsd data

--with-cgi-bin=<CGI_DIR>: Points to your CGI dir

--enable-gapcmon: A Gtk2/GLib2 GUI application used to monitor UPS devices controlled by the APCUPSD package.

--enable-powerflute: Is a ncurses based program to monitor the UPS.

Non-Multilib

Compile the package:

./configure --prefix=/usr --with-log-dir=/var/log \
    --enable-usb --with-upstype=usb --with-upscable=usb \
    --enable-cgi --with-cgi-bin=/srv/www/cgi-bin \
    --enable-gapcmon --enable-powerflute &&
make

Install the package:

make install

Multilib

This package does not provide any libraries so only one installation is needed.

32Bit

Compile the package:

CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" \
PKG_CONFIG_PATH="$PKG_CONFIG_PATH32" USE_ARCH=32 \
./configure --prefix=/usr --with-log-dir=/var/log \
    --enable-usb --with-upstype=usb --with-upscable=usb \
    --enable-cgi --with-cgi-bin=/srv/www/cgi-bin \
    --enable-gapcmon --enable-powerflute &&
make

Install the package:

make install

N32

CC="gcc ${BUILDN32}" CXX="g++ ${BUILDN32}" \
PKG_CONFIG_PATH="$PKG_CONFIG_PATHN32" USE_ARCH=n32 \
./configure --prefix=/usr --with-log-dir=/var/log \
    --enable-usb --with-upstype=usb --with-upscable=usb \
    --enable-cgi --with-cgi-bin=/srv/www/cgi-bin \
    --enable-gapcmon --enable-powerflute &&
make

Install the package:

make install

64Bit

Compile the package:

CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" \
PKG_CONFIG_PATH="$PKG_CONFIG_PATH64" USE_ARCH=64 \
./configure --prefix=/usr --with-log-dir=/var/log \
    --enable-usb --with-upstype=usb --with-upscable=usb \
    --enable-cgi --with-cgi-bin=/srv/www/cgi-bin \
    --enable-gapcmon --enable-powerflute &&
make

Install the package:

make install

Configuring

BootScript

Create the bootscript:

cat > /etc/rc.d/init.d/apcupsd << "EOF"
#!/bin/sh
# Begin $rc_base/init.d/apcupsd

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by zippo zippo@oppiz.net

#$LastChangedBy: oppiz 
#$Date: 2007-02-15 00:13:00Hrs

. /etc/sysconfig/rc
. $rc_functions

case "$1" in
    start)
       boot_mesg "Starting Apcupsd Server..."
       loadproc /sbin/apcupsd
       sleep 1
       ;;

   stop)
       boot_mesg "Stopping Apcupsd Server..."
       killproc /sbin/apcupsd
       ;;

   reload)
       boot_mesg "Reloading Apcupsd Server..."
       reloadproc /sbin/apcupsd
       ;;

   restart)
       $0 stop
       sleep 1
       $0 start
       ;;

   status)
       statusproc /sbin/apcupsd
       ;;

   *)
       echo "Usage: $0 {start|stop|reload|restart|status}"
       exit 1
       ;;
esac

# End $rc_base/init.d/apcupsd
EOF
chmod -v 754 /etc/rc.d/init.d/apcupsd

Link it into the runlevels:

for link in /etc/rc.d/rc{{0,1,6}.d/K50,{2,3,4,5}.d/S15}apcupsd; do
  ln -sfv ../init.d/apcupsd $link;
done