Message ID | 20180125131642.28918-1-juerg.haefliger@canonical.com |
---|---|
State | New |
Headers | show |
Series | [kteam-tool] git-build-kernel: Build packages in user's homedir | expand |
On 25/01/18 13:16, Juerg Haefliger wrote: > Rather than polluting the global /tmp directory, build the packages in > the user's home directory ~/tmp. > > Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com> > --- > git-build-kernel/git-build-kernel | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel > index df95e12e3c6e..44cba7257b29 100755 > --- a/git-build-kernel/git-build-kernel > +++ b/git-build-kernel/git-build-kernel > @@ -106,9 +106,9 @@ VERSION=`echo "$chg" | sed -n -e '1s/^.*(\([^)]*\)).*$/\1/p'` > > ### Set up the /tmp work directory > > -WORKDIR="kernel-$LOGNAME-$GITSHASHORT-XXXX" > -WORKDIR="`mktemp -u -d -t $WORKDIR`" > -mkdir "$WORKDIR" || exit > +WORKDIR="kernel-$GITSHASHORT-XXXX" > +WORKDIR="`mktemp -u -d -p /home/$LOGNAME/tmp -t $WORKDIR`" > +mkdir -p "$WORKDIR" || exit > > BUILDDIR="$WORKDIR/build" > LOG="$WORKDIR/build.log" > If /tmp is memory backed then this will be slower but it won't eat up tmp and is less likely be forgotten which I'm all for. Acked-by: Colin Ian King <colin.king@canonical.com>
In my opinion, this would be an undesirable change. We specifically chose to leave the build dirs in /tmp, so that they could be cleaned globally by the sysadmin (via cron job, a reboot, or manually) -- its just that nobody ever enabled a cron job. I think we should instead just implement a one-line cron job to wipe out /tmp/kernel-{foo} builds older than 1 week (or use a standard "clean-temp" daemon). Spreading the builds out to each $HOME/tmp will, IMHO, actually make them *less* likely to get cleaned up by anybody -- particularly since they won't get cleaned by reboot anymore. -Kamal On Thu, Jan 25, 2018 at 5:16 AM, Juerg Haefliger < juerg.haefliger@canonical.com> wrote: > Rather than polluting the global /tmp directory, build the packages in > the user's home directory ~/tmp. > > Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com> > --- > git-build-kernel/git-build-kernel | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/git-build-kernel/git-build-kernel > b/git-build-kernel/git-build-kernel > index df95e12e3c6e..44cba7257b29 100755 > --- a/git-build-kernel/git-build-kernel > +++ b/git-build-kernel/git-build-kernel > @@ -106,9 +106,9 @@ VERSION=`echo "$chg" | sed -n -e > '1s/^.*(\([^)]*\)).*$/\1/p'` > > ### Set up the /tmp work directory > > -WORKDIR="kernel-$LOGNAME-$GITSHASHORT-XXXX" > -WORKDIR="`mktemp -u -d -t $WORKDIR`" > -mkdir "$WORKDIR" || exit > +WORKDIR="kernel-$GITSHASHORT-XXXX" > +WORKDIR="`mktemp -u -d -p /home/$LOGNAME/tmp -t $WORKDIR`" > +mkdir -p "$WORKDIR" || exit > > BUILDDIR="$WORKDIR/build" > LOG="$WORKDIR/build.log" > -- > 2.14.1 > > > -- > kernel-team mailing list > kernel-team@lists.ubuntu.com > https://lists.ubuntu.com/mailman/listinfo/kernel-team > <div dir="ltr">In my opinion, this would be an undesirable change. We specifically chose to leave the build dirs in /tmp, so that they could be cleaned globally by the sysadmin (via cron job, a reboot, or manually) -- its just that nobody ever enabled a cron job. I think we should instead just implement a one-line cron job to wipe out /tmp/kernel-{foo} builds older than 1 week (or use a standard "clean-temp" daemon). Spreading the builds out to each $HOME/tmp will, IMHO, actually make them *less* likely to get cleaned up by anybody -- particularly since they won't get cleaned by reboot anymore.<div><br></div><div> -Kamal</div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 25, 2018 at 5:16 AM, Juerg Haefliger <span dir="ltr"><<a href="mailto:juerg.haefliger@canonical.com" target="_blank">juerg.haefliger@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Rather than polluting the global /tmp directory, build the packages in<br> the user's home directory ~/tmp.<br> <br> Signed-off-by: Juerg Haefliger <<a href="mailto:juerg.haefliger@canonical.com">juerg.haefliger@canonical.com</a><wbr>><br> ---<br> git-build-kernel/git-build-<wbr>kernel | 6 +++---<br> 1 file changed, 3 insertions(+), 3 deletions(-)<br> <br> diff --git a/git-build-kernel/git-build-<wbr>kernel b/git-build-kernel/git-build-<wbr>kernel<br> index df95e12e3c6e..44cba7257b29 100755<br> --- a/git-build-kernel/git-build-<wbr>kernel<br> +++ b/git-build-kernel/git-build-<wbr>kernel<br> @@ -106,9 +106,9 @@ VERSION=`echo "$chg" | sed -n -e '1s/^.*(\([^)]*\)).*$/\1/p'`<br> <br> ### Set up the /tmp work directory<br> <br> -WORKDIR="kernel-$LOGNAME-$<wbr>GITSHASHORT-XXXX"<br> -WORKDIR="`mktemp -u -d -t $WORKDIR`"<br> -mkdir "$WORKDIR" || exit<br> +WORKDIR="kernel-$GITSHASHORT-<wbr>XXXX"<br> +WORKDIR="`mktemp -u -d -p /home/$LOGNAME/tmp -t $WORKDIR`"<br> +mkdir -p "$WORKDIR" || exit<br> <br> BUILDDIR="$WORKDIR/build"<br> LOG="$WORKDIR/build.log"<br> <span class="HOEnZb"><font color="#888888">--<br> 2.14.1<br> <br> <br> --<br> kernel-team mailing list<br> <a href="mailto:kernel-team@lists.ubuntu.com">kernel-team@lists.ubuntu.com</a><br> <a href="https://lists.ubuntu.com/mailman/listinfo/kernel-team" rel="noreferrer" target="_blank">https://lists.ubuntu.com/<wbr>mailman/listinfo/kernel-team</a><br> </font></span></blockquote></div><br></div>
diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel index df95e12e3c6e..44cba7257b29 100755 --- a/git-build-kernel/git-build-kernel +++ b/git-build-kernel/git-build-kernel @@ -106,9 +106,9 @@ VERSION=`echo "$chg" | sed -n -e '1s/^.*(\([^)]*\)).*$/\1/p'` ### Set up the /tmp work directory -WORKDIR="kernel-$LOGNAME-$GITSHASHORT-XXXX" -WORKDIR="`mktemp -u -d -t $WORKDIR`" -mkdir "$WORKDIR" || exit +WORKDIR="kernel-$GITSHASHORT-XXXX" +WORKDIR="`mktemp -u -d -p /home/$LOGNAME/tmp -t $WORKDIR`" +mkdir -p "$WORKDIR" || exit BUILDDIR="$WORKDIR/build" LOG="$WORKDIR/build.log"
Rather than polluting the global /tmp directory, build the packages in the user's home directory ~/tmp. Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com> --- git-build-kernel/git-build-kernel | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)