nisrmdir Command

Purpose

Removes NIS+ objects from the namespace.

Syntax

nisrmdir-i ] [  -f ] [  -s Hostname ] Dirname

Description

The nisrmdir command removes existing NIS+ directories and subdirectories. The nisrmdir command can also remove replicas from serving a directory.

The nisrmdir command modifies the object that describes the directory (indicated in the parameter Dirname), then notifies each replica to remove it. If this notification fails, then the directory object is returned to its original state unless the -f flag is used.

nisrmdir fails if the NIS+ master server is not running.

Item Description
-i Sets the nisrmdir command in interactive mode. With the -i flag, the nisrm command asks for confirmation before removing the specified object. If the directory's name in Dirname is not fully qualified, then the -i flag is forced, preventing the unintended removal of another directory.
-f Sets the nisrm command in force mode. The -f flag forces nisrmdir to succeed even though the command might not be able to contact the affected replica servers. Use this flag when you know that a replica is down and cannot respond to the removal notification. When the replica is finally rebooted, it reads the updated directory object, notes that it is no longer a replica for Dirname, and therefore, stops responding to lookups for that directory.
Note: You can clean up the files that held the removed directory by manually removing the appropriate files in the /var/nis directory.
-s Hostname Specifies that the server Hostname should be removed as a replica for the directory Dirname. If the -s flag is not used, then all replicas and the master server for Dirname are removed and the directory removed from the namespace.

Examples

  1. To remove the directory xyz under the abc.com. domain, enter:
    nisrmdir xyz.abc.com.
  2. To remove a replica serving the directory xyz.abc.com., enter:
    nisrmdir -s replica.abc.com xyz.abc.com.
  3. To force the removal of the directory xyz.abc.com. from the namespace, enter:
    nisrmdir -f xyz.abc.com.

Environment

Item Description
NIS_PATH With this variable set, if the NIS+ directory name is not fully qualified, nisrmdir searches each directory indicated until the directory is found.

Exit Status

Item Description
0 Successful completion.
1 An error occurred.