[Voyage-linux] voyage-utils stop should clean /ro $VOYAGE_SYSTEM_SYNCDIRS

Joaquin Seoane (spam-protected)
Tue Aug 28 16:27:08 HKT 2007


On Saturday 25 de August de 2007 a las 21:41:51 (+0800), Punky wrote:

> I welcome any patches that improve Voyage.  May I know what is the
> different between the current and the one you propose?  I didn't look
> at the code deeply.

Sorry for the poor explanation. The point is that syncronizing
directories when stopping the system should create in the /ro directory
an exact copy of the corresponding /rw content.  In your version you
overwrite the old /ro, so, if something is deleted in /rw, it will
reappear in the next reboot:

                               cp -Rp $DIR/* /ro$DIR/

In my version I delete /ro, before the copy.  I use tar instead of "cp -Rp"
in order to preserve symlinks, ownerships, hidden files, etc:

                               rm -rf  /ro$DIR
                               mkdir -p  /ro$DIR
                               (cd $DIR; tar cf - .) | (cd /ro$DIR/; tar xpf -)

Now I realize that permissions and ownership of /ro$DIR are not correct
in my version. Probably it is more correct, quicker and safer to use
rsync, but it is not in the distribution:

                               rsync -aR --delete $DIR /ro

Or, if still using tar:
                               rm -rf  /ro$DIR
                               (tar cf - $DIR) | (cd /ro; tar xpf -)

I had to make this change because our Voyage application has a mailer
agent (postfix), and all delayed messages saved in /ro during a reboot got sent
after every reboot (the problem with postfix is even worse, because it
renames the spool files after reboot).

> On 8/15/07, Joaquin Seoane <jsp at dit.upm.es> wrote:
> > Hi all,
> >
> > Stopping the voyage should copy /rw $VOYAGE_SYSTEM_SYNCDIRS to /ro as
> > is, without old content.  Any file removed or renamed en /rw synced dirs
> > should be removed or renamed in /ro. Current voyage-utils overwrite ro:
> >
> > ========================================================================
> >         'stop')
> >                 if [ -f /etc/voyage.conf ] ; then
> >                 . /etc/voyage.conf
> >                 /usr/local/sbin/remountrw
> >                 for DIR in $VOYAGE_SYSTEM_SYNCDIRS
> >                 do
> >                 echo -n "Synchronizing $DIR ... "
> >                                 cp -Rp $DIR/* /ro$DIR/
> >                                 echo "Done."
> >                         done
> >                         /usr/local/sbin/remountro
> >                 fi
> >                 ;;
> > ========================================================================
> >
> > I think it should be changed to something like:
> >
> > ========================================================================
> >
> >    'stop')
> >         if [ -f /etc/voyage.conf ] ; then
> >             . /etc/voyage.conf
> >             /usr/local/sbin/remountrw
> >             for DIR in $VOYAGE_SYSTEM_SYNCDIRS
> >             do
> >                 echo -n "Synchronizing $DIR ... "
> >                 rm -rf  /ro$DIR
> >                 mkdir -p  /ro$DIR
> >                 (cd $DIR; tar cf - .) | (cd /ro$DIR/; tar xpf -)
> >                 echo "Done."
> >             done
> >             /usr/local/sbin/remountro
> >         fi
> >         ;;
> >     *)
> >
> > ========================================================================






More information about the Voyage-linux mailing list