~iheino+ub/+junk/nut-upsconf-docfix

« back to all changes in this revision

Viewing changes to INSTALL.nut

  • Committer: Tuomas Heino
  • Author(s): Laurent Bigonville
  • Date: 2014-04-22 20:46:12 UTC
  • Revision ID: iheino+ub@cc.hut.fi-20140422204612-1x2gh3nkezfsdao4
Tags: upstream-2.7.2
ImportĀ upstreamĀ versionĀ 2.7.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Installation instructions
 
2
=========================
 
3
 
 
4
This chapter describe the various methods for installing Network UPS Tools.
 
5
 
 
6
Whenever it is possible, prefer <<Installing_packages, installing from packages>>.
 
7
Packagers have done an excellent and hard work at improving NUT integration into
 
8
their system.
 
9
 
 
10
[[Installing_source]]
 
11
Installing from source
 
12
----------------------
 
13
 
 
14
These are the essential steps for compiling and installing this software.
 
15
 
 
16
The NUT linkdoc:packager-guide[Packager Guide], which presents the best
 
17
practices for installing and integrating NUT, is also a good reading.
 
18
 
 
19
[NOTE]
 
20
.Keep in mind that...
 
21
================================================================================
 
22
 
 
23
- the paths shown below are the default values you get by just calling
 
24
configure by itself.  If you have used --prefix or similar, things will be
 
25
different.  Also, if you didn't install this program from source yourself, the
 
26
paths will probably have a number of differences.
 
27
 
 
28
- by default, your system probably won't find the man pages, since they
 
29
install to /usr/local/ups/man.  You can fix this by editing your MANPATH, or
 
30
just do this:
 
31
 
 
32
        man -M /usr/local/ups/man <man page>
 
33
 
 
34
- if your favorite system offers up to date binary packages, you should always
 
35
prefer these over a source installation. Along with the known advantages of such
 
36
systems for installation, upgrade and removal, there are many integration issues
 
37
that have been addressed.
 
38
 
 
39
================================================================================
 
40
 
 
41
 
 
42
Prepare your system
 
43
~~~~~~~~~~~~~~~~~~~~
 
44
 
 
45
System User creation
 
46
^^^^^^^^^^^^^^^^^^^^
 
47
 
 
48
Create at least one system user and a group for running this software. You
 
49
might call them "ups" and "nut".  The exact names aren't important as
 
50
long as you are consistent.
 
51
 
 
52
The process for doing this varies from one system to the next, and
 
53
explaining how to add users is beyond the scope of this document.
 
54
 
 
55
For the purposes of this document, the user name and group name 
 
56
will be 'ups' and 'nut' respectively.
 
57
 
 
58
Be sure the new user is a member of the new group!  If you forget to
 
59
do this, you will have problems later on when you try to start upsd.
 
60
 
 
61
 
 
62
Build and install
 
63
~~~~~~~~~~~~~~~~~
 
64
 
 
65
[[Configuration]]
 
66
Configuration
 
67
^^^^^^^^^^^^^
 
68
 
 
69
Configure the source tree for your system.  Add the '--with-user' and
 
70
'--with-group' switch to set the user name and group that you created
 
71
above.
 
72
 
 
73
        ./configure --with-user=ups --with-group=nut
 
74
 
 
75
If you need any other switches for configure, add them here.  For example:
 
76
 
 
77
* to build and install USB drivers, add '--with-usb' (note that you
 
78
  need to install libusb development package or files).
 
79
 
 
80
* to build and install SNMP drivers, add '--with-snmp' (note that
 
81
  you need to install libsnmp development package or files).
 
82
 
 
83
* to build and install CGI scripts, add '--with-cgi'.
 
84
 
 
85
See <<Configure_options,Configure options>> from the User Manual,
 
86
docs/configure.txt or './configure --help' for all the available
 
87
options.
 
88
 
 
89
If you alter paths with additional switches, be sure to use those
 
90
new paths while reading the rest of the steps.    
 
91
 
 
92
Reference: <<Configure_options,Configure options>> from the
 
93
User Manual.
 
94
 
 
95
 
 
96
Build the programs
 
97
^^^^^^^^^^^^^^^^^^
 
98
 
 
99
        make
 
100
 
 
101
This will build the NUT client and server programs and the
 
102
selected drivers. It will also build any other features that were
 
103
selected during <<Configuration,configuration>> step above. 
 
104
 
 
105
 
 
106
Installation
 
107
^^^^^^^^^^^^
 
108
 
 
109
[NOTE]
 
110
=====================================================================
 
111
 
 
112
you should now gain privileges for installing software if necessary:
 
113
 
 
114
        su
 
115
 
 
116
=====================================================================
 
117
 
 
118
Install the files to a system level directory:
 
119
 
 
120
        make install
 
121
 
 
122
This will install the compiled programs and man pages, as well as
 
123
some data files required by NUT. Any optional features selected
 
124
during configuration will also be installed.
 
125
 
 
126
This will also install sample versions of the NUT configuration
 
127
files. Sample files are installed with names like ups.conf.sample
 
128
so they will not overwrite any existing real config files you may
 
129
have created.
 
130
 
 
131
If you are packaging this software, then you will probably want to
 
132
use the DESTDIR variable to redirect the build into another place,
 
133
i.e.:
 
134
 
 
135
        make DESTDIR=/tmp/package install
 
136
        make DESTDIR=/tmp/package install-conf
 
137
 
 
138
[[StatePath]]
 
139
State path creation
 
140
^^^^^^^^^^^^^^^^^^^
 
141
 
 
142
Create the state path directory for the driver(s) and server to use
 
143
for storing UPS status data and other auxiliary files, and make it
 
144
owned by the user you created.
 
145
 
 
146
        mkdir -p /var/state/ups
 
147
        chmod 0770 /var/state/ups
 
148
        chown root:nut /var/state/ups
 
149
 
 
150
[[Ownership]]
 
151
Ownership and permissions
 
152
^^^^^^^^^^^^^^^^^^^^^^^^^
 
153
 
 
154
Set ownership data and permissions on your serial or USB ports
 
155
that go to your UPS hardware.  Be sure to limit access to just
 
156
the user you created earlier.
 
157
 
 
158
These examples assume the second serial port (ttyS1) on a typical
 
159
Slackware system.  On FreeBSD, that would be cuaa1.  Serial ports
 
160
vary greatly, so yours may be called something else.
 
161
 
 
162
        chmod 0660 /dev/ttyS1
 
163
        chown root:nut /dev/ttyS1
 
164
 
 
165
////////////////////////////////////////////////////////////////////////////////
 
166
FIXME: TBR
 
167
////////////////////////////////////////////////////////////////////////////////
 
168
 
 
169
The setup for USB ports is slightly more complicated. Device files
 
170
for USB devices, such as /proc/bus/usb/002/001, are usually
 
171
created "on the fly" when a device is plugged in, and disappear
 
172
when the device is disconnected.  Moreover, the names of these
 
173
device files can change randomly. To set up the correct
 
174
permissions for the USB device, you may need to set up (operating
 
175
system dependent) hotplugging scripts.  Sample scripts and
 
176
information are provided in the scripts/hotplug and
 
177
scripts/udev directories. For most users, the hotplugging scripts
 
178
will be installed automatically by "make install". 
 
179
 
 
180
(If you want to try if a driver works without setting up
 
181
hotplugging, you can add the "-u root" option to upsd, upsmon, and
 
182
drivers; this should allow you to follow the below
 
183
instructions. However, don't forget to set up the correct
 
184
permissions later!).
 
185
 
 
186
NOTE: if you are using something like devfs or udev, make sure
 
187
these permissions stay set across a reboot.  If they revert to the
 
188
old values, your drivers may fail to start.
 
189
 
 
190
 
 
191
You are now ready to configure NUT, and start testing and using it.
 
192
 
 
193
You can jump directly to the <<Configuration_notes,NUT configuration>>.
 
194
 
 
195
 
 
196
[[Installing_packages]]
 
197
Installing from packages
 
198
------------------------
 
199
 
 
200
This chapter describes the specific installation steps when using
 
201
binary packages that exist on various major systems.
 
202
 
 
203
[[Debian]]
 
204
Debian, Ubuntu and other derivatives
 
205
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
206
 
 
207
NOTE: NUT is packaged and well maintained in these systems.
 
208
The official Debian packager is part of the NUT Team.
 
209
 
 
210
Using your prefered method (apt-get, aptitude, Synaptic, ...), install
 
211
the 'nut' package, and optionaly the following:
 
212
 
 
213
- 'nut-cgi', if you need the CGI (HTML) option,
 
214
- 'nut-snmp', if you need the snmp-ups driver,
 
215
- 'nut-xml', for the netxml-ups driver,
 
216
- 'nut-powerman-pdu', to control the PowerMan daemon (PDU management)
 
217
- 'nut-dev', if you need the development files.
 
218
 
 
219
////////////////////////////////////////////////////////////////////////////////
 
220
- nut-client
 
221
////////////////////////////////////////////////////////////////////////////////
 
222
 
 
223
Configuration files are located in /etc/nut.
 
224
linkman:nut.conf[5] must be edited to be able to invoke /etc/init.d/nut
 
225
 
 
226
NOTE: Ubuntu users can access the APT URL installation by clicking on link:apt://nut[this link].
 
227
 
 
228
 
 
229
[[Mandriva]]
 
230
Mandriva
 
231
~~~~~~~~
 
232
 
 
233
NOTE: NUT is packaged and well maintained in these systems.
 
234
The official Mandriva packager is part of the NUT Team.
 
235
 
 
236
Using your prefered method (urpmi, RPMdrake, ...), install one of the two below
 
237
packages:
 
238
 
 
239
- 'nut-server' if you have a 'standalone' or 'netserver' installation,
 
240
- 'nut' if you have a 'netclient' installation.
 
241
 
 
242
Optionaly, you can also install the following:
 
243
 
 
244
- 'nut-cgi', if you need the CGI (HTML) option,
 
245
- 'nut-devel', if you need the development files.
 
246
 
 
247
 
 
248
[[Suse]]
 
249
Suse / Opensuse
 
250
~~~~~~~~~~~~~~~
 
251
 
 
252
NOTE: NUT is packaged and well maintained in these systems.
 
253
The official Suse packager is part of the NUT Team.
 
254
 
 
255
Install the 'nut-classic' package, and optionaly the following:
 
256
 
 
257
- 'nut-drivers-net', if you need the snmp-ups or the netxml-ups drivers,
 
258
- 'nut-cgi', if you need the CGI (HTML) option,
 
259
- 'nut-devel', if you need the development files,
 
260
 
 
261
NOTE: Suse and Opensuse users can use the
 
262
link:http://software.opensuse.org/search?baseproject=ALL&p=1&q=nut[one-click install method]
 
263
to install NUT.
 
264
 
 
265
 
 
266
[[RedHat]]
 
267
Red Hat, Fedora and CentOS
 
268
~~~~~~~~~~~~~~~~~~~~~~~~~~
 
269
 
 
270
NOTE: NUT is packaged and well maintained in these systems.
 
271
The official Red Hat packager is part of the NUT Team.
 
272
 
 
273
Using your prefered method (yum, Add/Remove Software, ...), install one of the
 
274
two below packages:
 
275
 
 
276
- 'nut' if you have a 'standalone' or 'netserver' installation,
 
277
- 'nut-client' if you have a 'netclient' installation.
 
278
 
 
279
Optionaly, you can also install the following:
 
280
 
 
281
- 'nut-cgi', if you need the CGI (HTML) option,
 
282
- 'nut-xml', if you need the netxml-ups driver,
 
283
- 'nut-devel', if you need the development files.
 
284
 
 
285
 
 
286
[[FreeBSD]]
 
287
FreeBSD
 
288
~~~~~~~
 
289
 
 
290
You can either install NUT as a binary package or as a port.
 
291
 
 
292
Binary package
 
293
^^^^^^^^^^^^^^
 
294
 
 
295
To install the main component, use the following command:
 
296
 
 
297
        # pkg_add -r nut
 
298
 
 
299
Port
 
300
^^^^
 
301
 
 
302
The port is located under /usr/ports/sysutils/nut. 
 
303
To install it, use the following command:
 
304
 
 
305
        # cd /usr/ports/sysutils/nut/ && make install clean
 
306
 
 
307
You have to define WITH_NUT_CGI to build the optional CGI scripts.
 
308
 
 
309
Optionaly, you can also install the following ports:
 
310
 
 
311
- sysutils/nut-snmp, for the SNMP driver,
 
312
- sysutils/nut-usb, for the USB drivers,
 
313
- sysutils/nut-libupsclient, for the upsclient library.
 
314
 
 
315
 
 
316
You are now ready to configure NUT, and start testing and using it.
 
317
 
 
318
You can jump directly to the
 
319
<<Configuration_notes,NUT configuration>>.