Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > 37e222326095a93978d54b1564dd9954 > files > 25

apcupsd-3.10.5-1mdk.ppc.rpm

Solaris users:                                December 16th, 1999

Please read this file before attempting to compile or install the 
beta software. It contains important information that will make 
your efforts easier.

If you find bugs, or run into problems that seem to be related to 
the version of Solaris that you run, please feel free to contact 
me by email, or through the development mailing list. I'll attempt
to help with problems getting the beta running, although I can't 
promise a quick response. 

As always, remember THIS IS A BETA, and as such, MAY CONTAIN BUGS 
THAT CAN DAMAGE YOUR SYSTEM AND DATA FILES! You must accept all 
responsibility for running this software. I'd strongly suggest 
that you do not run this software on a production system until the
final release. An unexpected power-off of a running system can be 
a disaster. As always, make backups of any critical information 
before you install this software. 

Remember, I told you. I'll listen sympathetically if you lose data,
but there will be nothing I can do to help you. 

Sincerely, 
Carl Erhorn <cerhorn@hyperion.com> <apcupsd-devel@ro.com>

---------------------------------------------------------------------

Please read the file 'INSTALL' in the source directory before 
continuing on with these Solaris-specific instructions. Then come
back and read this file before attempting to build the package.

For building the system, I'd suggest that you run the configure and
make processes as your normal UNIX user ID. The 'make install' must 
be run as root. But if your normal ID has an environment setup for 
using the c compiler, it's simpler to do that than setup root to 
have the correct environment. 

If you have the Solaris workshop compilers instead of the GCC or 
EGCS compilers, edit the configure script, find the PATH=... 
statement, and comment it out. Also comment out the following line 
where the new path is exported. 

Whichever compiler you do have, please insure that you can execute 
the compiler from the command line before running configure. If you 
do not have an environment setup to run the compiler first, configure 
will fail. 

Your normal UNIX user ID must own the source tree directories, and 
you must have the normal development tools in your path. This 
includes make, the compiler, the M4 preprocessor, the linker, and ar
or ranlib. If the user you are logged in as can compile and link a c 
program from a source file, then you have all the required tools 
available.

For the Solaris beta, you are required to install the executables in 
the /sbin directory. This will probably remain true, as during 
shutdown, Solaris will unmount almost everything except the root 
directories. Since the ability to power the UPS off requires access 
to the executable programs, they need to be in a directory that will 
never be unmounted. And since they should also be in a directory that
normal users cannot get into, /sbin is the perfect choice. If you 
have a problem with this, and have a suggestion on another way to 
solve the problem, please let me know. 

The way to setup the /sbin directory as the executables directory is
to pass configure the '--sbindir=/sbin' argument (without the quotes,
of course). No other arguments should be required, and your setup 
and platform should be detected automatically by configure. 

Once you have run configure, you will need to do a 'make'. Once the 
make has completed with no errors, you must su to root to complete 
the install. After the su, you may not have a path to the make 
program anymore. In that case, you should do the 'make install' 
step as:

/usr/ccs/bin/make install

Once the install completes, you must edit the /sbin/rc0 script as 
detailed below, then exit from the su'ed shell.

In order to support unattended operation and shutdown during a power
failure, it's important that the UPS remove power after the shutdown
completes. This allows the unattended UPS to reboot the system when 
power returns by repowering the system. Of course, you need autoboot
enabled for your system to do this, but all Solaris systems have this
by default. If you have disabled this on your system, please re-enable
it. 

To get the UPS to remove power from the system at the correct time
during shutdown, i.e., after the disks have done their final sync,
we need to modify a system script. This script is /sbin/rc0. 

I do not have access to every version of Solaris, but I think this
file will be almost identical on every version. You will need to 
let me know if this is not true. 

At the very end of the /sbin/rc0 script, you should find lines just
like the following, between the dashed lines:

----
# unmount file systems. /usr, /var and /var/adm are not unmounted by umountall
# because they are mounted by rcS (for single user mode) rather than
# mountall.
# If this is changed, mountall, umountall and rcS should also change.
/sbin/umountall
/sbin/umount /var/adm >/dev/null 2>&1
/sbin/umount /var >/dev/null 2>&1
/sbin/umount /usr >/dev/null 2>&1

echo 'The system is down.'
----

We need to insert the following lines just before the last 'echo':
----
#see if this is a powerfail situation
if [ -f /etc/apcupsd/powerfail ]; then
	echo 
	echo "APCUPSD will power off the UPS"
	echo
	/etc/apcupsd/apccontrol killpower
	echo
	echo "Please ensure that the UPS has powered off before rebooting"
	echo "Otherwise, the UPS may cut the power during the reboot!!!"
	echo
	exit 0
fi
----

I have included these lines in a file called rc0.solaris in the 
distributions/sun subdirectory of the source tree. You can cut and
paste them into the /sbin/rc0 file at the correct place, or yank 
and put them using vi or any other editor. Note that you must be 
root to edit this file. 

You must be absolutely sure you have them in the right place. If your
/sbin/rc0 file does not look like the lines shown above, do not 
modify the file. Instead, email a copy of the file to me, and I will
attempt to figure out what you should do. If you mess up this file, 
the system will not shut down cleanly, and you could lose data. 
Don't take the chance. 

This feature has only been tested with APC SmartUPS models. If you
do not have a SmartUPS, you will be one of the first testers to try
this feature. Please send me email to let me know if it works with
your UPS model, what model you have, and if possible, the event logs
located in /etc/apcupsd. I'd be very interested in your results, and
would be glad to work with you to get this feature working correctly
with all the APC models. A detailed description of the screen output
during the shutdown would be very helpful if you see problems. 

You will then need to make the normal changes to the 
/etc/apcupsd/apcupsd.conf file. This file contains the configuration
settings for the package. It is important that you set the values
to match your UPS model and cable type, and the serial port that 
you have attached the UPS to. I have used both /dev/ttya and /dev/ttyb
with no problems. You should be sure that logins are disabled on the 
port you are going to use, otherwise you will not be able to communicate
with the UPS. If you are not sure that logins are disabled for the
port, run the 'admintool' program as root, and disable the port. The
'admintool' program is a GUI administration program, and required that
you are running CDE, OpenWindows, or another XWindows program such as 
KDE.

At this point, you should have a complete installation. The daemon
will load automatically at the next boot. Watch for any error messages
during boot, and check the event logs in /etc/apcupsd. If everything
looks OK, you can try testing the package by removing power from the
UPS. 

As a beta tester, your input is very helpful in solving problems with
the package, and providing suggestions and future directions for the 
development of the package. We are striving to provide a useful package
that works across all platforms, and welcome your feedback.

Best regards, and thanks for your interest and help,
The Apcupsd Development Team.