[26533] in Source-Commits

home help back first fref pref prev next nref lref last post

Re: /svn/athena r25606 - trunk/debathena/config/reactivate/debian

daemon@ATHENA.MIT.EDU (Benjamin Kaduk)
Tue Jul 3 20:46:33 2012

Date: Tue, 3 Jul 2012 20:46:29 -0400 (EDT)
From: Benjamin Kaduk <kaduk@MIT.EDU>
To: Jonathan D Reed <jdreed@MIT.EDU>
cc: source-commits@MIT.EDU
In-Reply-To: <201207021906.q62J6TBT010680@drugstore.mit.edu>
Message-ID: <alpine.GSO.1.10.1207032044370.18441@multics.mit.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

On Mon, 2 Jul 2012, Jonathan D Reed wrote:

> Author: jdreed
> Date: 2012-07-02 15:06:28 -0400 (Mon, 02 Jul 2012)
> New Revision: 25606
>
> Modified:
>   trunk/debathena/config/reactivate/debian/changelog
>   trunk/debathena/config/reactivate/debian/snapshot-run
> Log:
> In reactivate:
>  * Recover from a 'set -e' failure in snapshot-run and don't leave
>    chroots lying around if possible

I think maybe the logic was that reactivate would just reboot if we left 
stuff lying around.  But as we saw with lightdm, that may not be the 
case...

>
>
> Modified: trunk/debathena/config/reactivate/debian/changelog
> ===================================================================
> --- trunk/debathena/config/reactivate/debian/changelog	2012-07-02 15:54:30 UTC (rev 25605)
> +++ trunk/debathena/config/reactivate/debian/changelog	2012-07-02 19:06:28 UTC (rev 25606)
> @@ -3,8 +3,10 @@
>   * Update debian/copyright for 3-clause BSD and one GPL'd file
>   * Ship 16killprocs-no-really to end sessions faster (Trac: #775)
>   * Use new lightdm-config hooks to actually run session setup and cleanup
> +  * Recover from a 'set -e' failure in snapshot-run and don't leave
> +    chroots lying around if possible
>
> - -- Jonathan Reed <jdreed@mit.edu>  Mon, 02 Jul 2012 10:59:02 -0400
> + -- Jonathan Reed <jdreed@mit.edu>  Mon, 02 Jul 2012 15:06:40 -0400
>
> debathena-reactivate (2.0.34) unstable; urgency=low
>
>
> Modified: trunk/debathena/config/reactivate/debian/snapshot-run
> ===================================================================
> --- trunk/debathena/config/reactivate/debian/snapshot-run	2012-07-02 15:54:30 UTC (rev 25605)
> +++ trunk/debathena/config/reactivate/debian/snapshot-run	2012-07-02 19:06:28 UTC (rev 25606)
> @@ -17,6 +17,20 @@
> # Setup
>
> session=$(schroot -c login -b)
> +cleanup() {

Do you need to set +e here?

> +    # Teardown
> +
> +    # Remove file from above.
> +    # (This also gets nuked in reactivate, but be paranoid)
> +    rm -f /tmp/ticketenv

Unclear if you want to duplicate the chattr -i -f /tmp/ticketenv as well.

Otherwise, I guess it's okay.
-Ben


> +
> +    for daemon in $daemons; do
> +	schr invoke-rc.d "$daemon" stop || [ $? = 100 ]
> +    done
> +
> +    schroot -c "$session" -e
> +}
> +trap 'cleanup' EXIT
> sch() { schroot -r -c "$session" -- "$@"; }          # Run in the chroot
> schq() { schroot -q -r -c "$session" -- "$@"; }      # Run in the chroot quietly
> schr() { schroot -r -c "$session" -u root -- "$@"; } # Run in the chroot as root
> @@ -61,14 +75,3 @@
> schroot -c "$session" -r -p -- sudo -E -u "$USER" -- "$@"
> cd /
>
> -# Teardown
> -
> -# Remove file from above.
> -# (This also gets nuked in reactivate, but be paranoid)
> -rm -f /tmp/ticketenv
> -
> -for daemon in $daemons; do
> -    schr invoke-rc.d "$daemon" stop || [ $? = 100 ]
> -done
> -
> -schroot -c "$session" -e
>
>

home help back first fref pref prev next nref lref last post