pt_util8
Load or dump a protection server database
Usage
pt_util [-w]
[-user]
[-group]
[-members]
[-name]
[-system]
[-xtra]
[-prdb
<prdb
file>]
[-datafile
<data
file>]
[-help]
Overview
The pt_util command can be used to load or dump the protection database. It should only be used when ptserver is not running.
The most likely reason to use it is to initialize the protection database when bringing up a new cell. The current syntax for this, presented below, needs improvement. pt_util can also be used when problems are suspected with the database. It can be used to dump the database or portions thereof, in several different ways, and to reload it.
The textual representation of the database has the following form: For users,
name flags/quota viceid ownerid creatorid
For groups,
name flags/quota viceid ownerid creatorida-username a-user-viceid
The second line is repeated for each member of the group. When reading the database, membership is not reported unless -members is also included.
Options
If you don't specify any options, the only thing you'll learn is the ubik database epoch and version.
-
-w -
Write to the protection database instead of reading. Only the file arguments make sense in combination with this argument.
-
-user -
When reading, display users.
-
-group -
When reading, display groups (but not necessarily members).
-
-members -
When reading, display groups and also group members.
-
-name -
When reading, follow name hashes, instead of id hashes. This may print different information if the database was corrupted. Otherwise, it should print exactly the same information, except in a different order.
-
-system -
When reading, display system data, or more precisely, do not display entries with a viced <= -32768 or >= +97537.
-
-xtra -
When reading, display extra users and groups, or more precisely, do not display entries that are in the range -32767...+97536 inclusive.
-prdb<prdb file>-
Specifies the complete pathname of the file in which the Protection Database resides. Provide the complete name, including the ending .DB0.
-datafile<data file>-
Specify the file to which to dump (or
-wfrom which to read) textual database records.
-
-help -
Prints the online help for this command. All other valid options are ignored.
Cautions
Entry timestamps and other information is not preserved when dumping the protection database.
Examples
The following example shows how to initialize the database from scratch.
Before you do this, make sure ptserver is not running. If you have multiple database servers, make sure prdb.* does not exist on any server machine.
Now, type this in EXACTLY, including the leading space on the line indicated. But do use Control-D at the end, not up-arrow D.
pt_util -wadmin 128/20 1 -204 -204system:administrators 130/20 -204 -204 -204admin 1^D
You will see this:
# pt_util -wpt_util: /var/lib/openafs/db/prdb.DB0: Bad UBIK_MAGIC. Is 0 should be 354545Ubik Version is: 2.0admin 128/20 1 -204 -204system:administrators 130/20 -204 -204 -204Error while creating system:administrators: Entry for id already existsadmin 1pt_util: Ubik Version number changed during execution.Old Version = 2.0, new version = 33554432.0#
To make a complete copy of the database,
# pt_util -user -members -datafile /tmp/out
To load from the complete copy,
# pt_util -w -datafile /tmp/out
Don't do this until you read cautions, above.
Privilege required
The issuer must be logged in as the superuser "root" on a database server machine to use pt_util.
Releases
12 releases since Debian 3.0 (Woody); the text changed 11 times.
-group since Debian 5.0 (Lenny);
-help since Debian 10 (Buster);
-members since Debian 5.0 (Lenny);
-name since Debian 5.0 (Lenny);
-system since Debian 5.0 (Lenny);
-user since Debian 5.0 (Lenny);
-xtra since Debian 5.0 (Lenny).
-d until Debian 4.0 (Etch);
-g until Debian 4.0 (Etch);
-h until Debian 4.0 (Etch);
-m until Debian 4.0 (Etch);
-n until Debian 4.0 (Etch);
-p until Debian 4.0 (Etch);
-s until Debian 4.0 (Etch);
-u until Debian 4.0 (Etch).