Chapter 4. Maintaining Files and Objects Referenced in ToolTalk Messages

ToolTalk messages can reference files of interest or ToolTalk objects. The ToolTalk service maintains information about files and objects, and needs to be informed of changes to these files or objects.

The ToolTalk service provides wrapped shell commands to move, copy, and remove files that inform the ToolTalk service of any changes.

Exporting File Systems

To ensure that applications which use the ToolTalk service have access to a mounted file system, always export the actual file system name, not a symbolic link, to the file system. If a user's machine mounts a file system that is exported with a symbolic link, applications that use the ToolTalk service can neither reference files in that file system in ToolTalk messages, nor can they create ToolTalk objects in files in that file system. For example,


Note: The machine twinpeaks has a disk mounted on /home/twinpeaks.


  • A symbolic link is made on the machine twinpeaks from /export/twinpeaks to /home/twinpeaks.

  • /export/twinpeaks is added to the /etc/exports file on machine twinpeaks.

  • The file system is exported.

When the machine northwest mounts twinpeaks:/export/twinpeaks on /mnt, any attempt by applications to either send ToolTalk messages that reference files in /mnt, or to create objects in files in /mnt, will fail. To solve the problem:

  1. On machine northwest, unmount twinpeaks:/export/twinpeaks.

  2. On machine twinpeaks, rename the entry in the /etc/exports file to /home/twinpeaks.

  3. On machine northwest, mount twinpeaks:/home/twinpeaks.

ToolTalk-Enhanced Shell Commands

The ToolTalk-enhanced shell commands first invoke the standard shell commands with which they are associated (for example, ttmv invokes mv) and then update the ToolTalk service with the file changes. It is recommended that application users use the ToolTalk-enhanced shell commands when they are working with files that contain ToolTalk objects.

Table 4-1. ToolTalk-Enhanced Shell Commands

Command

Definition

Synttax

ttcopy

Copies files that contain objects that reside on the same machine

.

 

ttcopy source-file
destination-file

ttmv

Moves files that contain objects and removes old version of file.

ttmv old new

ttrm

Removes files that contain objects.

ttrm file

ttrmdir

Removes empty directories that are associated with ToolTalk object specs.

This command also allows youto create an object spec for a directory. When an object spec is created, the path name of a file or directory is supplied.

ttrmdir directory

tttar

Archives and de-archives files that contain ToolTalk objects.

tttar c|t|x pathname1 pathname2

The ToolTalk-enhanced shell commands can be changed to look like the standard shell commands. To change the ToolTalk-enhanced shell commands, users can alias the ToolTalk-enhanced shell commands in their shell startup file so they appear as standard shell commands:

# ToolTalk-aware shell commands in .cshrc 
alias mv     ttmv
alias cp     ttcopy
alias rm     ttrm
alias rmdir  ttrmdir
alias tar    tttar

Displaying, Checking, and Repairing Databases

Use the ToolTalk database utility ttdbck to display, check, or repair ToolTalk databases.

Information about files and objects in the ToolTalk databases can become out-dated if the ToolTalk-enhanced shell commands are not used to copy, move and remove them. For example, you can remove a file old_file that contains ToolTalk objects from the file system with the standard rm command. However, because the standard shell command does not inform the ToolTalk service that old_file has been removed, the information about the file and the individual objects remains in the ToolTalk database. To remove the file and object information from the ToolTalk database, use the ttdbck utility.


Note: ToolTalk databases are typically accessible only to root; therefore, the ttdbck utility is normally run as root. See ttdbck(8) in the man pages for complete details on how to run this utility.