3 @unnumbered Administration
5 NNCP uses following files/directories you should be aware of:
10 @ref{Configuration} file, for example @file{/usr/local/etc/nncp.hjson}.
11 Should not be globally readable, because it contains private keys.
14 @ref{Spool} directory with inbound/outbound encrypted packets, for
15 example @file{/var/spool/nncp}.
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.
21 Partly transferred files are stored with @file{.part} suffix. And
22 possibly they also require cleanup if they are completely lost.
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}.
28 Also it can contain @file{seen/} and @file{hdr/} subdirectories,
29 that should be cleaned too from time to time.
31 All of that cleaning tasks can be done with @ref{nncp-rm} utility.
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
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
51 @ref{Log} file, for example @file{/var/spool/nncp/log}. It should be
52 rotated. Choose you own preferable way to do it.
55 Example @url{https://www.newsyslog.org/manual.html, newsyslog}'s entry:
57 /var/spool/nncp/log 644 7 100 * BCYN
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
67 */1 * * * * nncp-reass -all -noprogress
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.
78 For example you can use @url{http://cr.yp.to/daemontools.html,
79 daemontools} for that task to run them under probably existing
83 # mkdir -p /var/service/.nncp-toss/log
84 # cd /var/service/.nncp-toss
89 exec setuidgid uucp /usr/local/bin/nncp-toss -cycle 10
94 exec setuidgid uucp multilog t ./main
97 # chmod -R 755 /var/service/.nncp-toss
98 # mv /var/service/.nncp-toss /var/service/nncp-toss
103 @ref{nncp-daemon} can also be run as
104 @url{https://en.wikipedia.org/wiki/Inetd, inetd} service on UUCP's port:
107 uucp stream tcp6 nowait nncpuser /usr/local/bin/nncp-daemon nncp-daemon -quiet -ucspi
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:
118 # mkdir -p /var/service/.nncp-daemon/log
119 # cd /var/service/.nncp-daemon
123 NNCPLOG=FD:4 exec envuidgid nncpuser tcpserver -DHRU -l 0 ::0 uucp \
124 /usr/local/bin/nncp-daemon -quiet -ucspi 4>&1
127 # cat > log/run <<EOF
129 exec setuidgid uucp multilog ./main
132 # chmod -R 755 /var/service/.nncp-daemon
133 # mv /var/service/.nncp-daemon /var/service/nncp-daemon