]> Cypherpunks.ru repositories - nncp.git/blob - doc/admin.texi
Add various documentation indices
[nncp.git] / doc / admin.texi
1 @node Administration
2 @cindex administration
3 @unnumbered Administration
4
5 NNCP uses following files/directories you should be aware of:
6
7 @itemize
8
9 @item
10     @ref{Configuration} file, for example @file{/usr/local/etc/nncp.hjson}.
11     Should not be globally readable, because it contains private keys.
12
13 @item
14     @ref{Spool} directory with inbound/outbound encrypted packets, for
15     example @file{/var/spool/nncp}.
16
17     It also contains temporary files (in @file{tmp/} directory),
18     possibly left alone, if some of the commands failed and prematurely
19     exited and that should be cleaned from time to time.
20
21     Partly transferred files are stored with @file{.part} suffix. And
22     possibly they also require cleanup if they are completely lost.
23
24     It can contain @file{.nock} files: fully downloaded, but still not
25     checksummed. Can be checksummed (with @file{.nock} extension removing)
26     with @command{nncp-check -nock}.
27
28     Also it can contain @file{seen/} and @file{hdr/} subdirectories,
29     that should be cleaned too from time to time.
30
31     All of that cleaning tasks can be done with @ref{nncp-rm} utility.
32
33     @cindex shared spool
34     @cindex setgid
35     @pindex umask
36     @anchor{Shared spool}
37     If you want to share single spool directory with multiple grouped
38     Unix users, then you can @command{setgid} it and assure that umask
39     is group friendly. For convenience you can set @option{umask}
40     globally for invoked NNCP commands in the configuration file. For
41     example:
42
43 @example
44 $ chgrp nncp /usr/local/etc/nncp.hjson /var/spool/nncp
45 $ chmod g+r /usr/local/etc/nncp.hjson
46 $ chmod g+rwxs /var/spool/nncp
47 $ echo 'umask: "007"' >> /usr/local/etc/nncp.hjson
48 @end example
49
50 @item
51     @ref{Log} file, for example @file{/var/spool/nncp/log}. It should be
52     rotated. Choose you own preferable way to do it.
53
54     @pindex newsyslog
55     Example @url{https://www.newsyslog.org/manual.html, newsyslog}'s entry:
56 @example
57 /var/spool/nncp/log             644     7       100     *       BCYN
58 @end example
59
60 @item
61     Optional @ref{CfgIncoming, incoming} directories where uploaded
62     files are stored. Probably you want to run @ref{nncp-reass} from
63     time to time to reassemble all chunked uploads. Example crontab
64     entry:
65
66 @example
67 */1     *       *       *       *       nncp-reass -all -noprogress
68 @end example
69
70 @pindex daemontools
71 @pindex supervise
72 @pindex multilog
73 @item
74     Possibly long running @ref{nncp-daemon}, @ref{nncp-caller},
75     @ref{nncp-toss}, @ref{nncp-check} daemons. As all software, they can
76     fail and you should place them under some supervisor control.
77
78     For example you can use @url{http://cr.yp.to/daemontools.html,
79     daemontools} for that task to run them under probably existing
80     @verb{|uucp|} user:
81
82 @example
83 # mkdir -p /var/service/.nncp-toss/log
84 # cd /var/service/.nncp-toss
85
86 # cat > run <<EOF
87 #!/bin/sh -e
88 exec 2>&1
89 exec setuidgid uucp /usr/local/bin/nncp-toss -cycle 10
90 EOF
91
92 # cat > log/run <<EOF
93 #!/bin/sh -e
94 exec setuidgid uucp multilog t ./main
95 EOF
96
97 # chmod -R 755 /var/service/.nncp-toss
98 # mv /var/service/.nncp-toss /var/service/nncp-toss
99 @end example
100
101 @pindex inetd
102 @item
103     @ref{nncp-daemon} can also be run as
104     @url{https://en.wikipedia.org/wiki/Inetd, inetd} service on UUCP's port:
105
106 @example
107 uucp    stream  tcp6    nowait  nncpuser        /usr/local/bin/nncp-daemon      nncp-daemon -quiet -ucspi
108 @end example
109
110 @cindex UCSPI
111 @pindex tcpserver
112 @item
113     Or it can be also run as a @command{daemontools} daemon under
114     @url{http://cr.yp.to/ucspi-tcp.html, UCSPI-TCP}. In the example
115     below it uses native daemontools's logging capability:
116
117 @example
118 # mkdir -p /var/service/.nncp-daemon/log
119 # cd /var/service/.nncp-daemon
120
121 # cat > run <<EOF
122 #!/bin/sh -e
123 NNCPLOG=FD:4 exec envuidgid nncpuser tcpserver -DHRU -l 0 ::0 uucp \
124         /usr/local/bin/nncp-daemon -quiet -ucspi 4>&1
125 EOF
126
127 # cat > log/run <<EOF
128 #!/bin/sh -e
129 exec setuidgid uucp multilog ./main
130 EOF
131
132 # chmod -R 755 /var/service/.nncp-daemon
133 # mv /var/service/.nncp-daemon /var/service/nncp-daemon
134 @end example
135
136 @end itemize