File: INSTALL

package info (click to toggle)
nut 0.45.5-rel-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,984 kB
  • ctags: 2,146
  • sloc: ansic: 22,216; sh: 1,138; makefile: 405
file content (157 lines) | stat: -rw-r--r-- 5,398 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
Network UPS Tools: INSTALL - Russell Kroll <rkroll@exploits.org>

These are the basic steps for compiling and installing this software.  
There are many different programs in here.  More information on what they
do and how they work can be found in the README file, and also in the docs
subdirectory.

Keep in mind that the paths shown for the programs are the default.  Your
install may change them by passing commands to configure.  Also, if you
didn't install this program from source yourself, the paths probably have
a number of differences.  

Build and install
=================

1. Configure the source tree for your system.

	./configure

   *** Additional info: docs/configure.txt

2. Build the programs, and optionally build the CGI programs.

	make
	make cgi	- OPTIONAL: requires the gd library and a web server

3. Gain privileges for installing software if necessary.

	su

4. Install the files to a system level directory.

	make install
	make install-cgi	- if you built them earlier
	make install-misc	- only required if you plan to build asapm-ups

   If you are packaging this software, then you will probably want to
   use the INSTALLROOT variable to redirect the build into another place,
   i.e.:

	make INSTALLROOT=/tmp/package install

   Note that the default install process creates a directory for the
   state files and sets the ownership on them, so it needs root powers.
   You can still do 'make install' as a normal user, but your
   STATEPATH (normally /var/state/ups) will probably need some help
   before things will run.

5. Create section(s) for your hardware in /usr/local/etc/ups.conf

   Be sure to create an entry for your UPS in ups.conf.  If your driver
   does not need any special switches, then it should resemble this:

	[myupsname]
		driver = mydriver
		port = /dev/ttyS1

   *** Additional info: man pages: ups.conf(5), nutupsdrv(8)

6. Start the driver(s) for your hardware.

	/usr/local/ups/bin/upsdrvctl start

   *** Watch the startup messages carefully for something like this:
   *** 
   *** Network UPS Tools - driver version x.yy (x.yy.zz)
   *** drivername: invalid option -- a
   *** usage: drivername [...]
   ***
   *** If the driver prints that error, go to step 7.

   If the driver has some other error, make sure you're starting the 
   right one for your hardware.  Also check the man page for the
   driver to see if there are any extra values that you can set.
   If you need any of them, add them to your ups.conf and try step 6
   again.

   If the driver started successfully, go to step 8.

   *** Additional info: man pages: nutupsdrv(8), upsdrvctl(8)

7. Try to start the driver manually.

   If you're here, then upsdrvctl failed to start your driver since it
   doesn't support -a.  This is because your driver is somewhat dated
   and has not been upgraded by its author to support these new
   features.  For now, start it by hand, supplying the port information
   on the command line:

	/usr/local/ups/bin/<driver> <port>

   For example, it might look like this:

	/usr/local/ups/bin/mydriver /dev/ttyS1

   Your driver may require additional switches to get started.  If it
   doesn't work the first time, check the help text (-h) and see if
   anything applies to your hardware.

   *** Warning: all old style drivers will be removed from the tree
   ***          after 0.45.5.  This means your hardware will not be
   ***          supported if it has not been converted by then.
   ***
   ***          See the FAQ for more information

8. Start the network server.

	/usr/local/ups/sbin/upsd

   *** Additional info: man page: upsd(8)

9. Verify that some data is available.

	/usr/local/ups/bin/upsc localhost	

   There may be a lot of data, but the thing that matters is STATUS.
   If your system is running on line power, you should have OL in that
   field.  Otherwise, you are probably have misconfigured the driver 
   in step 5.

   *** Additional info: man page: upsc(8)

Configuring low-battery shutdowns
=================================

The whole point of UPS software is to bring down the OS cleanly when you
run out of battery power.  Everything else is ultimately eye candy.  To
make sure your system shuts down properly, you will need to perform some
additional configuration and run upsmon.  Here are the basics:

1. Set up the access levels in upsd.conf, including a password.
   The directives you will need to use are ACL and ACCESS.

   *** Additional info: man pages: upsd(8), upsd.conf(5)

2. Edit upsmon.conf, and put in that password.

   *** Additional info: man pages: upsmon(8), upsmon.conf(5)

3. Make upsd reload its config file ('upsd -c reload' or 'kill -HUP <pid>'),
   or just restart it to make the change take effect.

5. Start upsmon.

6. Look for messages in the syslog to indicate success.  It should look
   something like this:

	May 29 01:11:27 mybox upsmon[102]: Startup successful
	May 29 01:11:28 mybox upsmon[103]: UPS [myups@mybox]: login successful
	May 29 01:11:28 mybox upsd[100]: Client 10.1.1.1 logged into UPS [myups]

6. Optional, but desirable: edit your shutdown scripts to power down the
   UPS after the filesystems are remounted read-only.  This is the -k
   argument which is described in the shutdown documentation.

More information can be found in the README file, the shutdown.txt document, 
the upsmon(8) man page and the upsmon.conf(5) man page.