|
|
The File Update Daemon (FUD):
See fud(1M).
The FUD monitors selected files that have similar data, but different structures, and keeps the files synchronized. The FUD monitors a specified group of files and, when a file changes in one environment, an associated conversion or update command is automatically run to update the equivalent file in the other environment.
For example, the FUD keeps track of mounted filesystems as recorded in the UnixWare 7 file /etc/mnttab, and converts and updates this information for use in the Linux environment file, /linux/etc/mtab. Thus, mount information for both environments is always the same.
Some directories and files are linked between the UnixWare 7 and Linux environments, but applications that bypass standard interfaces can destroy the links. The FUD can be used monitor the integrity of symbolic links and report an error to the system log (/var/adm/syslog) if a link is broken. You can review the system log and manually restore links as necessary. Also see fud_log(1M).
To monitor a linked file, include an entry that specifies the filename in /etc/fud.d/fud.conf. For example, to monitor the link integrity for /linux/etc/passwd, enter:
/linux/etc/passwd target [ -L /linux/etc/passwd ] && exit 0; fud_log -l "/linux/etc/passwd"
In addition to monitoring link integrity, the FUD can automatically restore links that have been broken.
To monitor and enable automatic re-linking, include an entry in /etc/fud.d/fud.conf. There are several different cases for which an entry might be made.
In the following example, the source and target files have similar data structures. If the link between the files is destroyed, they are re-linked.
# file data structures are compatible, link target to UnixWare 7 version /linux/usr/bin/passwd target [ -L /linux/usr/bin/passwd ] && exit 0; ln -s /unixware/usr/bin/passwd /linux/usr/bin/passwd
If the link to a target file (usually a Linux file) is destroyed, the contents of the previously linked files might be different. This example writes the difference between the files to the system log (/var/adm/syslog), throws out changes by removing the target file, and links the UnixWare 7 source file to the target file.
# special link: if link is destroyed, note the diff in syslog and restore link /linux/etc/shadow target [ -L /linux/etc/shadow ] && exit 0; diff /unixware/etc/shadow /linux/etc/shadow >> /var/adm/syslog; rm /linux/etc/shadow; ln -s /unixware/etc/shadow /linux/etc/shadowAnd finally, some links are protected so that, if an incompatible file is created, it is automatically removed.
# file is incompatible with linked /etc/passwd files, remove file if its created
/linux/usr/sbin/adduser source [ ! -r /linux/usr/sbin/adduser ] && exit
0; rm /linux/usr/sbin/adduser
The FUD monitors and, if necessary, restores links for user and group management files (see ``User and group management'' ).