]> Cypherpunks.ru repositories - nncp.git/blob - doc/admin.texi
Unify @ref and @command usage
[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{@ref{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 @command{@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 @command{@ref{nncp-reass}}
63     from 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 @command{@ref{nncp-daemon}},
75     @command{@ref{nncp-caller}}, @command{@ref{nncp-toss}},
76     @command{@ref{nncp-check}} daemons. As all software, they can
77     fail and you should place them under some supervisor control.
78
79     For example you can use @url{http://cr.yp.to/daemontools.html,
80     daemontools} for that task to run them under probably existing
81     @verb{|uucp|} user:
82
83 @example
84 # mkdir -p /var/service/.nncp-toss/log
85 # cd /var/service/.nncp-toss
86
87 # cat > run <<EOF
88 #!/bin/sh -e
89 exec 2>&1
90 exec setuidgid uucp /usr/local/bin/nncp-toss -cycle 10
91 EOF
92
93 # cat > log/run <<EOF
94 #!/bin/sh -e
95 exec setuidgid uucp multilog t ./main
96 EOF
97
98 # chmod -R 755 /var/service/.nncp-toss
99 # mv /var/service/.nncp-toss /var/service/nncp-toss
100 @end example
101
102 @pindex inetd
103 @item
104     @command{@ref{nncp-daemon}} can also be run as
105     @url{https://en.wikipedia.org/wiki/Inetd, inetd} service on UUCP's port:
106
107 @example
108 uucp    stream  tcp6    nowait  nncpuser        /usr/local/bin/nncp-daemon      nncp-daemon -quiet -ucspi
109 @end example
110
111 @cindex UCSPI
112 @pindex tcpserver
113 @item
114     Or it can be also run as a @command{daemontools} daemon under
115     @url{http://cr.yp.to/ucspi-tcp.html, UCSPI-TCP}. In the example
116     below it uses native daemontools's logging capability:
117
118 @example
119 # mkdir -p /var/service/.nncp-daemon/log
120 # cd /var/service/.nncp-daemon
121
122 # cat > run <<EOF
123 #!/bin/sh -e
124 NNCPLOG=FD:4 exec envuidgid nncpuser tcpserver -DHRU -l 0 ::0 uucp \
125         /usr/local/bin/nncp-daemon -quiet -ucspi 4>&1
126 EOF
127
128 # cat > log/run <<EOF
129 #!/bin/sh -e
130 exec setuidgid uucp multilog ./main
131 EOF
132
133 # chmod -R 755 /var/service/.nncp-daemon
134 # mv /var/service/.nncp-daemon /var/service/nncp-daemon
135 @end example
136
137 @end itemize