Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Sep 2005 05:17:15 GMT
From:      Graham Todd <gtodd@bellanet.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/86144: New port: <sysutils>/<freebsd-snapshot> ports version of RSE snapshot utilities
Message-ID:  <200509150517.j8F5HFmH077953@www.freebsd.org>
Resent-Message-ID: <200509150520.j8F5K9iX050380@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         86144
>Category:       ports
>Synopsis:       New port: <sysutils>/<freebsd-snapshot> ports version of RSE snapshot utilities
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 15 05:20:09 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Graham Todd
>Release:        5.4 RELEASE
>Organization:
Bellanet
>Environment:
>Description:
      Version of RSE snapshot utilities that installs in LOCALBASE as a port. For information on these utilities see:

      http://people.freebsd.org/~rse/snapshot/

Included below iw output of:

shar `find freebsd-snapshot-management` > freebsd-snapshot-management

>How-To-Repeat:
      
>Fix:
      
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	freebsd-snapshot-management
#	freebsd-snapshot-management/pkg-descr
#	freebsd-snapshot-management/Makefile
#	freebsd-snapshot-management/pkg-message
#	freebsd-snapshot-management/distinfo
#	freebsd-snapshot-management/pkg-plist
#	freebsd-snapshot-management/pkg-deinstall
#	freebsd-snapshot-management/files
#	freebsd-snapshot-management/files/patch-install.sh
#	freebsd-snapshot-management/files/patch-amd.map.snap
#	freebsd-snapshot-management/files/patch-snapshot.8
#	freebsd-snapshot-management/files/patch-rc.conf
#	freebsd-snapshot-management/files/patch-crontab
#
echo c - freebsd-snapshot-management
mkdir -p freebsd-snapshot-management > /dev/null 2>&1
echo x - freebsd-snapshot-management/pkg-descr
sed 's/^X//' >freebsd-snapshot-management/pkg-descr << 'END-of-freebsd-snapshot-management/pkg-descr'
X[description of the port]
X
XAuthor:	Author's name and e-mail address
XWWW:	http://port.home.page/
END-of-freebsd-snapshot-management/pkg-descr
echo x - freebsd-snapshot-management/Makefile
sed 's/^X//' >freebsd-snapshot-management/Makefile << 'END-of-freebsd-snapshot-management/Makefile'
X# New ports collection makefile for:	freebsd-snapshot
X# Date created:		2005-09-07
X# Whom:			gtodd@bellanet.org
X#
X# $FreeBSD$
X#
X
XPORTNAME=	freebsd-snapshot
XPORTVERSION=	20050402.1
XCATEGORIES=	sysutils
XMASTER_SITES=   http://people.freebsd.org/~rse/dist/
X
XMAINTAINER=	gtodd@bellanet.org
XCOMMENT=	UFS2 snapshot utilities by Ralf S. Engelschall
X
XPREFIX=		${LOCALBASE}
X
XMAN8=		snapshot.8 periodic-snapshot.8
X
X.include <bsd.port.pre.mk>
X.include <bsd.port.post.mk>
END-of-freebsd-snapshot-management/Makefile
echo x - freebsd-snapshot-management/pkg-message
sed 's/^X//' >freebsd-snapshot-management/pkg-message << 'END-of-freebsd-snapshot-management/pkg-message'
XFreeBSD UFS2 Snapshots Management Environment
X
XFor more information on these utilities see:
X
Xhttp://people.freebsd.org/~rse/snapshot/
END-of-freebsd-snapshot-management/pkg-message
echo x - freebsd-snapshot-management/distinfo
sed 's/^X//' >freebsd-snapshot-management/distinfo << 'END-of-freebsd-snapshot-management/distinfo'
XMD5 (freebsd-snapshot-20050402.1.tar.gz) = 54ae93e0b3073bcd616a47de4543dc77
XSIZE (freebsd-snapshot-20050402.1.tar.gz) = 14622
END-of-freebsd-snapshot-management/distinfo
echo x - freebsd-snapshot-management/pkg-plist
sed 's/^X//' >freebsd-snapshot-management/pkg-plist << 'END-of-freebsd-snapshot-management/pkg-plist'
Xsbin/snapshot
Xsbin/periodic-snapshot
Xetc/amd.map.snap
END-of-freebsd-snapshot-management/pkg-plist
echo x - freebsd-snapshot-management/pkg-deinstall
sed 's/^X//' >freebsd-snapshot-management/pkg-deinstall << 'END-of-freebsd-snapshot-management/pkg-deinstall'
X#!/bin/sh
X
X#   make sure system tools are used first
XPATH="/bin:/usr/bin:/sbin:/usr/sbin:$PATH"
X
X#   edit a textfile
Xeditfile () {
X        file="$1"; shift
X    if [ ! -f $file ]; then
X        cp /dev/null $file
X    fi
X    if [ ! -s $file ]; then
X        echo "" >>$file # workaround sed(1) bug related to '$r ...'
X    fi
X        sed <$file >$file.new "$@"
X        if cmp $file $file.new >/dev/null 2>&1; then
X                rm -f $file.new
X        else
X                cp -p $file $file.old
X                cat $file.new >$file
X                rm -f $file.new
X        fi
X}
X
X
X#   uninstall /etc/crontab extension
Xeditfile /etc/crontab \
X     -e '/maintenance (FreeBSD UFS2 snapshots only)/,/periodic-snapshot weekly/d'
X
X#   install /etc/rc.conf extension
Xeditfile /etc/rc.conf \
X    -e '/UFS2 Snapshot Access/,/amd_flags/d'
X
X#   install /etc/periodic.conf extension
Xeditfile /etc/periodic.conf \
X   -e '/UFS2 Snapshot Creation/,/snapshot_schedule/d'
END-of-freebsd-snapshot-management/pkg-deinstall
echo c - freebsd-snapshot-management/files
mkdir -p freebsd-snapshot-management/files > /dev/null 2>&1
echo x - freebsd-snapshot-management/files/patch-install.sh
sed 's/^X//' >freebsd-snapshot-management/files/patch-install.sh << 'END-of-freebsd-snapshot-management/files/patch-install.sh'
X--- install.sh.orig	Tue Jan 25 04:53:44 2005
X+++ install.sh	Thu Sep  8 21:59:15 2005
X@@ -30,17 +30,18 @@
X case "$cmd" in
X     install )
X         #   install programs
X-        install -c -o root -g wheel -m 555 snapshot /usr/sbin/snapshot
X-        install -c -o root -g wheel -m 555 periodic-snapshot /usr/sbin/periodic-snapshot
X+        install -c -o root -g wheel -m 555 snapshot /usr/local/sbin/snapshot
X+        install -c -o root -g wheel -m 555 periodic-snapshot /usr/local/sbin/periodic-snapshot
X 
X         #   install manual pages
X-        install -c -o root -g wheel -m 444 snapshot.8 /usr/share/man/man8/snapshot.8
X-        install -c -o root -g wheel -m 444 periodic-snapshot.8 /usr/share/man/man8/periodic-snapshot.8
X-        gzip -9 -f /usr/share/man/man8/snapshot.8
X-        gzip -9 -f /usr/share/man/man8/periodic-snapshot.8
X+        install -c -o root -g wheel -m 444 snapshot.8 /usr/local/man/man8/snapshot.8
X+        install -c -o root -g wheel -m 444 periodic-snapshot.8 /usr/local/man/man8/periodic-snapshot.8
X+# gzip using ports Makefile
X+#       gzip -9 -f /usr/local/man/man8/snapshot.8
X+#       gzip -9 -f /usr/local/man/man8/periodic-snapshot.8
X 
X 		#   install /etc/amd.map.snap configuration
X-        install -c -o root -g wheel -m 444 amd.map.snap /etc/amd.map.snap
X+        install -c -o root -g wheel -m 444 amd.map.snap /usr/local/etc/amd.map.snap
X 
X         #   install /etc/crontab extension
X         editfile /etc/crontab \
X@@ -60,15 +61,15 @@
X     
X     uninstall )
X         #   uninstall programs
X-        rm -f /usr/sbin/snapshot
X-        rm -f /usr/sbin/periodic-snapshot
X+        rm -f /usr/local/sbin/snapshot
X+        rm -f /usr/local/sbin/periodic-snapshot
X 
X         #   uninstall manual pages
X-        rm -f /usr/share/man/man8/snapshot.8.gz
X-        rm -f /usr/share/man/man8/periodic-snapshot.8.gz
X+        rm -f /usr/local/share/man/man8/snapshot.8.gz
X+        rm -f /usr/local/share/man/man8/periodic-snapshot.8.gz
X 
X 		#   uninstall /etc/amd.map.snap configuration
X-        rm -f /etc/amd.map.snap
X+        rm -f /usr/local/etc/amd.map.snap
X 
X         #   uninstall /etc/crontab extension
X         editfile /etc/crontab \
END-of-freebsd-snapshot-management/files/patch-install.sh
echo x - freebsd-snapshot-management/files/patch-amd.map.snap
sed 's/^X//' >freebsd-snapshot-management/files/patch-amd.map.snap << 'END-of-freebsd-snapshot-management/files/patch-amd.map.snap'
X--- amd.map.snap.orig	Wed Sep  7 23:13:55 2005
X+++ amd.map.snap	Wed Sep  7 23:14:14 2005
X@@ -3,6 +3,6 @@
X #
X 
X /defaults type:=program
X-*         mount:="/usr/sbin/snapshot snapshot mount /${key} ${fs}";\
X-          unmount:="/usr/sbin/snapshot snapshot umount ${fs}"
X+*         mount:="/usr/local/sbin/snapshot snapshot mount /${key} ${fs}";\
X+          unmount:="/usr/local/sbin/snapshot snapshot umount ${fs}"
X 
END-of-freebsd-snapshot-management/files/patch-amd.map.snap
echo x - freebsd-snapshot-management/files/patch-snapshot.8
sed 's/^X//' >freebsd-snapshot-management/files/patch-snapshot.8 << 'END-of-freebsd-snapshot-management/files/patch-snapshot.8'
X--- snapshot.8.orig	Thu Sep  8 21:28:06 2005
X+++ snapshot.8	Thu Sep  8 21:29:26 2005
X@@ -219,12 +219,12 @@
X By using an
X .Xr amd 8
X map
X-.Pa /etc/amd.map.snap
X+.Pa /usr/local/etc/amd.map.snap
X containing
X .Bd -literal -offset indent
X /defaults type:=program
X-*         mount:="/usr/sbin/snapshot snapshot mount /${key} ${fs}";\\
X-          unmount:="/usr/sbin/snapshot snapshot umount ${fs}"
X+*         mount:="/usr/local/sbin/snapshot snapshot mount /${key} ${fs}";\\
X+          unmount:="/usr/local/sbin/snapshot snapshot umount ${fs}"
X .Ed
X .Pp
X and a
X@@ -232,7 +232,7 @@
X configuration of
X .Bd -literal -offset indent
X amd_enable="YES"
X-amd_flags="-a /.am -c 1800 -w 60 -l syslog /snap /etc/amd.map.snap"
X+amd_flags="-a /.am -c 1800 -w 60 -l syslog /snap /usr/local/etc/amd.map.snap"
X .Ed
X .Pp
X even non-privileged users can access arbitrary snapshots
END-of-freebsd-snapshot-management/files/patch-snapshot.8
echo x - freebsd-snapshot-management/files/patch-rc.conf
sed 's/^X//' >freebsd-snapshot-management/files/patch-rc.conf << 'END-of-freebsd-snapshot-management/files/patch-rc.conf'
X--- rc.conf.orig	Thu Sep  8 22:16:44 2005
X+++ rc.conf	Thu Sep  8 22:17:04 2005
X@@ -1,3 +1,3 @@
X #   UFS2 Snapshot Access
X amd_enable="YES"
X-amd_flags="-a /.am -c 1800 -w 60 -l syslog /snap /etc/amd.map.snap"
X+amd_flags="-a /.am -c 1800 -w 60 -l syslog /snap /usr/local/etc/amd.map.snap"
END-of-freebsd-snapshot-management/files/patch-rc.conf
echo x - freebsd-snapshot-management/files/patch-crontab
sed 's/^X//' >freebsd-snapshot-management/files/patch-crontab << 'END-of-freebsd-snapshot-management/files/patch-crontab'
X--- crontab.orig	Tue Sep 13 14:50:00 2005
X+++ crontab	Tue Sep 13 14:49:20 2005
X@@ -1,4 +1,4 @@
X # Perform hourly/daily/weekly maintenance (FreeBSD UFS2 snapshots only).
X-0       *       *       *       *       root    periodic-snapshot hourly
X-0       0       *       *       *       root    periodic-snapshot daily
X-0       0       *       *       0       root    periodic-snapshot weekly
X+0       *       *       *       *       root    /usr/local/sbin/periodic-snapshot hourly
X+0       0       *       *       *       root    /usr/local/sbin/periodic-snapshot daily
X+0       0       *       *       0       root    /usr/local/sbin/periodic-snapshot weekly
END-of-freebsd-snapshot-management/files/patch-crontab
exit
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200509150517.j8F5HFmH077953>