Re: ufsrestore not /dev/fd friendly
- From: Robert Lawhead <news0000.5.unixguru@xxxxxxxxxxxxxxx>
- Date: Thu, 04 May 2006 01:19:06 -0700
Darren Dunham wrote:
Robert Lawhead <news0000.5.unixguru@xxxxxxxxxxxxxxx> wrote:Hi Darren, thanks for your reply. I wasn't sure that opensolaris
I've searched the sunsolve (public) archives to see if this is a
documented problem, to no avail. No success with Google either.
Is this a known problem? Is there a chance of its being fixed?
I've never heard of it. I suppose the use of archive files is not so
common that someone has cared to notice or report it?
Just poking, it looks like when it first reads the file it isn't able to
handle the fact that it can't complete a 64K read. So it's not so much
that it can't read from a file descriptor, it's that it can't properly
read from a pipe. (just a guess)
Is there a preferred mechanism for bug reports against the
Solaris Express releases?
Go to www.opensolaris.org and click on 'Bug Database' on the left.
You'll get a link to report a bug.
was the right place for the solaris express release feedbacks,
but if you say so, I'll give it a try.
You're probably correct that the use of archive files isn't all
that common... but they are handy if you are using home-brewed
backups w/o catalogs. I've found that its easy to use
"ufsrestore ta archive_file | sed ... " to construct a list of
paths (with archive name prepended) that can be processed by
'frcode' to produce a db that can be searched using gnu locate.
Nothing fancy, (no owner, perms, date, etc.) but handy to determine
on which tapes a file is present without having to mount them.
#! /bin/ksh
# $Id: updatecatalog,v 1.3 2006/05/04 08:03:31 rml Exp rml $
# Create "locate" db from directory of ufsdump "archive" files
PATH=/usr/bin:/usr/sbin:/usr/local/gnu/libexec
ETC=${ETC:-/usr/local/etc}
ARCHIVES=${ARCHIVES:-$ETC/Backup/Archive}
CATALOG_DB=${CATALOG_DB:-/usr/local/gnu/var/catalogdb}
FRCODE_OPTIONS=${FRCODE_OPTIONS:-""}
trap 'rm -f ${CATALOG_DB}.$$; exit' HUP TERM INT QUIT
cd $ARCHIVES || exit 1
for archive in *; do
if [ -r "$archive" ]; then
ufsrestore ta $archive 2>/dev/null \
| awk '{print $2}' | sed "s,^.,$archive,"
else
echo Can\'t read $archive... skipping
fi
done | \
sort -f | $frcode $FRCODE_OPTIONS > ${CATALOG_DB}.$$
mv ${CATALOG_DB}.$$ ${CATALOG_DB}
chmod 644 ${CATALOG_DB}
Then ...
% alias catalog='/usr/local/gnu/bin/locate -d /usr/local/gnu/var/catalogdb'
% catalog inetd.conf
2006-04-01:foo:/etc/inet/inetd.conf
2006-04-01:foo:/etc/inetd.conf
2006-04-01:foo:/usr/share/man/man4/inetd.conf.4
2006-05-03:foo:/etc/inet/inetd.conf
2006-05-03:foo:/etc/inet/RCS/inetd.conf,v
2006-05-03:foo:/etc/inetd.conf
2006-05-03:foo:/usr/share/man/man4/inetd.conf.4
I thought that the reads were successful (fd 4 in the truss below),
and returned 64kb.
12734: open("2006-05-03:foo:var", O_RDONLY|O_LARGEFILE) = 4
12734: read(4, "\0\0\001 D Y <9E\0\0\0\0".., 64512) = 64512
12734: stat(".", 0xFFBFED30) = 0
12734: brk(0x000721D0) = 0
12734: brk(0x000821D0) = 0
12734: read(4, "\0\0\0\0\0\0\0\0\0\0\0\0".., 64512) = 64512
12734: brk(0x000821D0) = 0
12734: brk(0x000921D0) = 0
12734: read(4, "\0\0\0\0\0\0\0\0\0\0\0\0".., 64512) = 64512
12734: getpid() = 12734 [12732]
12734: sysconfig(_CONFIG_MAXPID) = 30000
12734: lstat64("/tmp/rstdir1146698910.LeaW3y", 0xFFBFEBB0) Err#2 ENOENT
12734: fstat(-1, 0xFFBFE8E8) Err#9 EBADF
12734: openat(AT_FDCWD, "/tmp/rstdir1146698910.LeaW3y",
O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_LARGEFILE, 0600) = 6
12734: fcntl(6, F_GETFD, 0x00000001) = 0
12734: fstat64(6, 0xFFBDE848) = 0
12734: brk(0x000921D0) = 0
12734: brk(0x000941D0) = 0
12734: fstat64(6, 0xFFBDE6F0) = 0
12734: ioctl(6, TCGETA, 0xFFBDE7D4) Err#25 ENOTTY
12734: llseek(6, 0, SEEK_CUR) = 0
...
12734: llseek(6, 0, SEEK_CUR) = 0
12734: write(6, "\0\0\002\0\f\001 .\0\0\0".., 8192) = 8192
12734: write(6, " S U N W g n o m e - v f".., 8192) = 8192
12734: write(6, " n a r y - s h a r e\0\0".., 8192) = 8192
12734: read(4, "\0\0 Q f\014\0\t S P R O".., 64512) = 64512
.
- Follow-Ups:
- Re: ufsrestore not /dev/fd friendly
- From: Robert Lawhead
- Re: ufsrestore not /dev/fd friendly
- References:
- ufsrestore not /dev/fd friendly
- From: Robert Lawhead
- Re: ufsrestore not /dev/fd friendly
- From: Darren Dunham
- ufsrestore not /dev/fd friendly
- Prev by Date: Re: restricted shell - not so restrict
- Next by Date: syslog events from ssh in 2 lines
- Previous by thread: Re: ufsrestore not /dev/fd friendly
- Next by thread: Re: ufsrestore not /dev/fd friendly
- Index(es):
Relevant Pages
|