NNADMIN(1M)
π NNADMIN β the manual bestie π
okay so this is nnadmin(1M), aka nn database administration. welcome to the control room π
β¨ NAME β¨
nnadmin β nn database administration, but make it y2k β¨
β¨ SYNOPSIS β¨
nnadmin [ commands ]
β¨ DESCRIPTION β¨
so nnadmin is literally the control program for the nnmaster(1M) daemon β and that daemon is the one responsible for building and maintaining the database that the nn(1) news reader uses. main character energy, honestly π
with nnadmin you can:
- display extracts from the log file π
- display the "raw" contents of the database π«£
- make consistency checks on the database π
- tell the running
nnmasterto expire one or more groups β³ - alter the options of the running
nnmasterποΈ - and much more. like, much more. iykyk π
nnadmin runs in two modes: interactive and non-interactive.
Interactive mode keeps it cute and simple: one-line menus show you the available operations, and you just type the letter associated with the command (normally the first letter in the command name). slay. easy.
Non-interactive mode is where the commands argument comes in β it gets used as a series of key-strokes interpreted exactly as if you'd typed them from the keyboard in interactive mode. for example, to stop the nnmaster, you can invoke nnadmin like this:
nnadmin MK
that selects the (M)aster submenu from the main menu, then the (K)ill entry from the submenu. chef's kiss.
β οΈ heads up bestie: in non-interactive mode the menus are not displayed and the commands are not echoed!nnadminexits when there are no more key-strokes left to read from thecommandsargument. and no, you cannot specify a group name in thecommandsargument, so all thennadminfunctionalities that relate to specific groups are only available in interactive mode. π
some "dangerous" commands require you to confirm them by following them with "Y" on the command line. the most notable are IY (initialize database) and EY (expire all groups). these commands get marked with a [Y] right after the command name. respect the [Y], fr fr π
you can also invoke an interactive nnadmin using the :admin command in nn. π§
β¨ SHELL ESCAPES β¨
at all prompts you can hit ! to spawn a subshell. iconic.
where that subshell wakes up depends on where you summoned it from:
- from the MASTER or DUMP menus β the working directory gets changed to the database directory
- from the GROUP menu β it gets changed to the group's spool directory (if it exists)
β¨ MAIN MENU β¨
from the main menu (you'll know it by the ADMIN prompt) you can pick from these operations:
C)onfβ show current configuration parameters such as directories, files, programs, network usage, etc. the receipts, basically πE)xpire [Y]β send a request to thennmasterdaemon to schedule (and run) expire for all groups in the database.G)roupsβ enter the GROUP submenu.I)nit [Y]β send a request to thennmasterdaemon to recollect all groups in the database.L)ogβ enter the LOG submenu.M)asterβ enter the MASTER submenu.Q)uitβ quitnnadmin. bye bestie π¦S)tatβ print general statistics about the database. see the section on Database Statistics below.U)pdateβ update the incore copy of the database master index.V)alidateβ make a thorough consistency check on the database. if inconsistencies are found in a group, you'll be asked whether a request should be sent to thennmasterdaemon to recollect that group. (and in non-interactive mode, requests get sent automatically for all corrupted groups β no asking, it just does it.)W)akeupβ send a wakeup signal to thennmasterdaemon so it receives messages sent to it, performs the required actions, and then collects articles as necessary. wake up babe πΈZ(silent validation) β identical to the Validate operation, except no output is produced during the consistency check. this is the one thennmasteruses to execute the-Coption. the quiet, mysterious one π€«
β¨ THE MASTER MENU β¨
the master menu (you'll spot it by the MASTER prompt) gives you access to overall database info and lets you send control messages to the nnmaster daemon.
C)heckβ in interactive mode and in verbose batch mode (nnadmin MC), print a message telling you whethernnmasteris running or not. in silent batch mode (nnadmin =MC), it exits with a status code of0ifnnmasteris running and1otherwise β which may be useful in administrative scripts. yes bestie, that's a0/1exit status, write it down πD)umpβ enter the DUMP submenu.F)ilesβ print a listing (usingls(1)) of all the data and index files in the database.G)roupβ print the master index entry for a single group, identified by its internal group number.K)illβ stop thennmasteronce it has finished its current task. not a jump scare, it waits its turn π«ΆO)ptionsβ change the runtime options of the runningnnmasterdaemon. currently, only the value of the-rand-eoptions can be modified.S)tatβ print general statistics about the database. see the section on Database Statistics below.T)raceβ turn the trace option-ton or off in the runningnnmaster.
β¨ THE DUMP MENU β¨
the dump menu (the DUMP prompt bestie) lets you print the master index entry for various selections of groups in the database. pick your filter, get your data π₯
A)llβ print all groups in the database.E)mptyβ print the empty groups in the database.H)olesβ print the groups where theminfield in the active file is not the first article saved in the database (because it doesn't exist, or because it's ignored for some other reason, e.g. bad or old).I)gnoredβ print groups which are ignored, either in theGROUPSfile or because of some other condition (mainly no spool directory).N)on-emptyβ print the non-empty groups in the database.V)alidβ print the groups which are present in the active file.in(W)alidβ print the groups in the database which are not present in the active file.
β¨ THE LOG MENU β¨
the log menu (LOG prompt, obviously π ) lets you extract specific entries from the log file, and truncate the log file.
every entry in the log file shares this format:
<class>: <date> <time> (<user>): <message>
where:
<class>identifies the message class<date>and<time>say when the entry was made<user>says who created the entry (the letter"M"denotes thennmaster)<message>is the text of the entry
to extract the log file entries of a specific class, just type the letter identifying the class:
Aβ admin to master communication π this class of messages is related to the sending of messages from annnadminprogram to thennmasterdaemon.Bβ bad articles reports about bad articles which have been ignored or removed (controlled by the-band-Boptions tonnmaster).Cβ collection statistics statistics about collection of new articles. the message has the format:
Collect: nnn art, ppp gr, ttt s
meaning that nnn articles in ppp groups were collected in ttt seconds (real time).
Eβ fatal errors fatal errors encountered during operation. these errors require manual intervention to be fixed. (some of the fatal errors occur if things that "cannot happen" happen anyway β and that may indicate a bug in the software π)Mβ nnmaster messages. master start/stop messages.Nβ NNTP related messages various messages related to the NNTP part of thennmaster, mostly about lost connections and failed attempts to connect to the NNTP server. these messages should only appear if you use NNTP, and your NNTP server is down for some reason. rip πͺ¦Oβ old articles reports related to ignoring (and removing) old articles when building the database (controlled by the-Oand-Boptions tonnmaster).Rβ reports non-fatal errors which let thennmastercontinue operation, but may prevent a user from runningnn(file access problems). reported problems should be checked. the most common report message will probably be:
some.group: no directory
which indicates that the spool directory for that group has disappeared (most likely because it has been rmgroup'ed).
Tβ trace output messages produced as a result of using the-toption on thennmaster. this is primarily for debugging purposes.Uβ usage statistics ifnnis compiled with theSTATISTICSoption enabled, an entry will be made in the log file every time a user has spent more than five minutes on news reading. the message will have the following format:
USAGE hours.minutes
since it's possible to suspend nn, or leave the terminal while nn is active, nn tries to be intelligent when it calculates the usage time so it reflects the actual time spent on news reading. the usage statistics can be summarized using the nnusage(1M) program.
Vβ validation errors when inconsistencies are detected in the database during validation, an entry for each corrupted group will be entered in the log file.Xβ expire statistics messages similar to the Collect statistics reporting the result of running expire on the database. reports related to ignoring, removing, renumbering, and reactivation of groups are also given class X.
to extract a specific entry class, grep(1) is used β so it may take a while on a large log file. be patient bestie β³
there are also a few special operations on the log file:
G)roupβ extract the entries which refers to a specified group.(1-9) tailβ invoketail(1)to extract the last 10-90 entries in the log file.spaceβ equivalent to1(list the last 10 lines of the log).(.) allβ display the complete log file.(@) clean [Y]β move theLogfile toLog.old, and create a new emptyLogfile. if you want to clean out the old log file as well, simply repeat the clean operation (this will result in an emptyLog.oldfile). π§Ό
β¨ THE GROUP MENU β¨
Okay so when you slide into the group menu (you'll know it by the GROUP prompt, it's giving β¨labeledβ¨), nnadmin asks you for the name of a news group, and you can type it in with the usual completion feature, which is fully described in the nn(1) manual. Then you get to do these things to that group:
C)lear_flagβ clears a group-specific flag. Flags are explained in the section right below, keep scrolling bestie πD)ataβ dumps the contents of the data file that holds the extracted article headers for the group.E)xpireβ asks thennmasterto run expire on the group.F)ilesβ lists the files containing the index and data for the group (it usesls(1)to do it).G)roupβ switches to a different group.H)eaderβ dumps the master index entry for the group.R)ecollectβ asks thennmasterto recollect all the articles in the group.S)et_flagβ sets a group-specific flag. Again, see below πV)alidateβ performs validation on the group's database information.Z)ap [Y]β removes the group from the news system, and this happens by running thermgroupprogram, which must live in theNEWS_LIBdirectory. And like. obviously this should be done with great caution. no cap. π
πΈ INDIVIDUAL GROUP FLAGS πΈ
You can set and clear these flags per individual group to control how nnmaster will behave on that group going forward.
Heads up bestie: these flags get reset to their default value if you reinitialize the database withnnmaster -I. So if you want a flag change to be permanent, set or clear it in theGROUPSfile instead. Periodt.
A)lways_digestβ Normallynnmasterwill only attempt to split digests into individual articles if it can easily recognize an article as a digest. And "easily" means: the word "digest" appears somewhere in the subject line, and one of the first few lines in the body of the article loosely matches the subject. But some news groups frequently receive digests that break one or both of these requirements π. So to havennmastersplit those digests into individual articles anyway, you can turn on the "always digest" flag on those news groups. This tellsnnmasterto treat all articles in the group as digests. (Naturally, articles that turn out not to contain other articles are still treated as normal articles β it's not chaotic, it's just thorough.)C)ontrolβ this is a special flag for the control group. It indicates that the"Newsgroups:"field in the article header cannot be trusted β i.e. it does not specify the groups to which the article has been posted. πD)irectory missingβ this flag says the spool directory for the news group can't be found (the group has probably been removed withrmgroup(1M)). It gets set automatically by thennmasterif it can't access the directory. While the flag is set,nnmastercompletely ignores the group, so you can use it to disable news collection in specific groups. And if you recreate the group or the directory by hand, you must also clear this flag to make thennmasterrecognize the group again. πM)oderatedβ indicates that the group is moderated. This flag is normally initialized automatically from the active file, and it should not be changed lightly. fr fr, leave it alone.N)ever_digestβ the exact opposite of the "always digest" flag; when it's set, thennmasterwill never attempt to split any articles in that group into subarticles. π«
π DATABASE STATISTICS DISPLAY π
When you pick the (S)tat operation in the main or master menus, you get some general stats about the database:
initializedβ the time when the database was last rebuilt usingnnmaster -I.last_scan,last_sizeβ the time stamp on the active file, and its size, the last time thennmasterread it.no of groupsβ the total number of groups in the database.Articlesβ the total number of articles in all groups. Note: this is not an exact number, because it counts split digests as a single article (which makes the number too small), and it may count some articles that have already been expired (which makes the number too large). So it's giving approximate, not giving precise. πDisk usageβ the total number of (1 kbyte) disk blocks occupied by the database.
π MASTER INDEX ENTRIES π
The master index entries you see when you select the (H)eader operation in the master and group menus contain this info:
group_name group_numberβ the first line of the display shows the name of the group and the internal group number, which is what identifies the group in the database.first/last artβ the numbers of the first and last article currently stored in the database.active infoβ the numbers of the first and last article in the news system, as read from the active file. These normally match the numbers above, but they can differ while thennmasteris working on the group (or if it hasn't yet collected all the articles in the group). it's giving "in progress" vibes.Offsets: index->..., data->...β these values show the starting position for the next write operation on the index and data files. They're mainly used for consistency checking and for recovery after a system crash. But heads up: after an "expire by rewrite" operation (that's expire method 2) which is performed "in-situ", the data and index files may physically be longer than the actual data stored in them. πFlags:β shows the current flags set for this group. If no flags are set, the field is simply omitted from the display. And there's one extra flag that wasn't explained above: theBLOCKEDflag. It's a temporary locking flag that thennmastersets on a group while it's updating the database files for that group, so thatnnclients can't access that group. it's literally holding the door, bestie πͺ
π§ RAW DATABASE DISPLAY π§
When you select the (D)ata operation in the group menu, you get a combined display of the raw data and index files for that group. The index file contains a single 32 bit value for each existing article number. That value is an offset into the data file, pointing to the header for the corresponding article.
When nn wants to access the articles from number N to the last article, it looks up the offset for article number N in the index file, and uses that as the starting point for reading article header information in the data file. Then it just reads to the end of the data file, where the article headers for articles number N+1, N+2, and so on follow immediately after the header for article number N. slay, sequential. π
The article header information shows up in a very terse form; each of the output lines is described below, for reference purposes:
offset = xxxx , article # = nnnnn (type)β this shows the offset into the data file and the article number. The offset is stored in the index file for quick access. If no type is printed, it's a normal article. The other types are:"digest header"and"digest sub-article".xpost(count): nnn, nnn, nnn, ...β cross-postings to other groups are encoded as a list of internal group numbers.ts=nn hp=nn fp=nn lp=nn ref=nn[+Re] lines=nnβ these values are used bynnto sort, present, and access an article:tsis the time stamp on the article; it's a simple encoding of the posting date and time found in theDate:field.hp,fp, andlpare offsets into the file containing the article text: the header position, first text position, and last text position. The first will be zero for normal articles, but not for articles in a split digest. The last will be equal to the length of the file for normal articles, but not inside digests.refis the number of references on theReference:line. If"+Re"follows the number, the subject line contained a"Re:"prefix which has been removed.
Sender(length): nameβ the name of the sender in "ready to print" format, i.e. reduced to 16 characters as explained in thennmanual.Subj(length): subjectβ this is the full subject line from the article header (except forRe:prefixes in various formats).
π FILES π
The $db, $lib, and $news used below are synonyms for DB_DIRECTORY, LIB_DIRECTORY, and the news system's lib directories respectively.
$db/MASTERβ Database master index$db/GROUPSβ News group names inMASTERfile order$db/DATA/nnn.xβ Index file for group number nnn$db/DATA/nnn.dβ Data file for group number nnn$master/GATEβ Message channel fromnnadmintonnmaster$master/MPIDβ The process id of thennmasterdaemon.$Logβ The log file (truncate it regularly!)
The MASTER file contains a record for each news group, occurring in the same sequence as the group names in the GROUPS file. And that sequence also defines the group numbers used to identify the files in the database and in a few other places. β¨
The GATE file gets created by nnadmin when needed, and removed by nnmaster once it has read it. So to send a message to the nnmaster, you have to be allowed to write in the $master directory. that's the vibe check right there.
π SEE ALSO π
nn(1), nncheck(1), nngrep(1), nntidy(1) nnquery(1M), nnusage(1M), nnmaster(8)
β οΈ WARNINGS β οΈ
The GATE file is created with the owner and modes of the user that runs nnadmin, which may cause problems if the owner of the nnmaster process (normally "news") is not allowed to read the created GATE file (a "umask" of 022 is ok.). So unless you allow ordinary users to create files in the LIB directory where the GATE file resides, only the owner of the directory (normally "news") and "root" can use nnadmin to send messages to the nnmaster. π
However! To send a wakeup signal to the master, anybody can run:
nnmaster -w
π BUGS π
The user interface is completely out of line with the rest of the nn family, and the way to run nnadmin in the non-interactive mode is a bit bizarre. And this is not likely to change, because I believe there are more important things to do! it's giving "I know, I know, leave me alone" energy π
π AUTHOR π
Kim F. Storm, Texas Instruments A/S, Denmark E-mail: storm@texas.dk
and that's the whole page bestie, we did it π«Ά this one came from the 4th Berkeley Distribution, Release 6.7.5, and it's literally titled NNADMIN(1M). iconic. go forth and manage some news, mwah π
β¨ππ¦
π¦ where this page comes from
- ubuntu stonking: nn 6.7.5-1 Β· permissive
- Copyright 1988, 1990, Kim F. Storm. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms