Closed
Bug 1019013
Opened 10 years ago
Closed 10 years ago
tweaks::cleanup should work with puppet disabled, at least on linux
Categories
(Infrastructure & Operations :: RelOps: Puppet, task)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: rail, Assigned: mrrrgn)
References
Details
(Whiteboard: [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/1130] )
Attachments
(1 file, 3 obsolete files)
(deleted),
patch
|
rail
:
review+
mrrrgn
:
checked-in+
|
Details | Diff | Splinter Review |
... because we are going to use puppetles spot instances
ATM we use it only for Ubuntu and Mac (not for builders).
/tmp is cleanup up at boot time by default. We should make sure to delete $::users::builder::home/.mozilla/firefox/console.log on boot.
Comment 2•10 years ago
|
||
These should go into the pre-run scripts, right?
Reporter | ||
Comment 3•10 years ago
|
||
(In reply to Dustin J. Mitchell [:dustin] from comment #2)
> These should go into the pre-run scripts, right?
Actually, yes. There would be no need to install extra packages, such as tmpreaper, tmpwatch, etc.
Comment 4•10 years ago
|
||
Ian, just to put this on your radar :)
Comment 6•10 years ago
|
||
Comment on attachment 8484243 [details] [diff] [review]
tmpclean-puppet.diff
Review of attachment 8484243 [details] [diff] [review]:
-----------------------------------------------------------------
::: modules/runner/templates/tasks/cleanup.erb
@@ +8,5 @@
> +
> +if [ "$USER" != "<%= scope.lookupvar('::config::builder_username') %>" ]; then
> + sudo -E -u <%= scope.lookupvar('::config::builder_username') %> $0 $*
> + exit $?
> +fi
so, do we actually want to sudo here? it's more likely we can delete files in /home and /tmp as root, right?
Comment 7•10 years ago
|
||
(In reply to Chris AtLee [:catlee] from comment #6)
> Comment on attachment 8484243 [details] [diff] [review]
> tmpclean-puppet.diff
>
> Review of attachment 8484243 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: modules/runner/templates/tasks/cleanup.erb
> @@ +8,5 @@
> > +
> > +if [ "$USER" != "<%= scope.lookupvar('::config::builder_username') %>" ]; then
> > + sudo -E -u <%= scope.lookupvar('::config::builder_username') %> $0 $*
> > + exit $?
> > +fi
>
> so, do we actually want to sudo here? it's more likely we can delete files
> in /home and /tmp as root, right?
Per http://www.explainshell.com/explain?cmd=sudo+-E+-u++cltbld+%240+%24*
-u user The -u (user) option causes sudo to run the specified command as a user other than root. To
specify a uid instead of a user name, use #uid. When running commands as a uid, many shells
require that the '#' be escaped with a backslash ('\'). Security policies may restrict uids
to those listed in the password database. The sudoers policy allows uids that are not in the
password database as long as the targetpw option is not set. Other security policies may not
support this.
Comment 8•10 years ago
|
||
(In reply to Justin Wood (:Callek) from comment #7)
> (In reply to Chris AtLee [:catlee] from comment #6)
> > so, do we actually want to sudo here? it's more likely we can delete files
> > in /home and /tmp as root, right?
>
(err re-read your Q, and forgive me jumping in, /me goes to relearn how to read)
Reporter | ||
Comment 9•10 years ago
|
||
(In reply to Chris AtLee [:catlee] from comment #6)
> so, do we actually want to sudo here? it's more likely we can delete files
> in /home and /tmp as root, right?
I think you are right, no sudo here. It would fail cleaning up /tmp
Reporter | ||
Comment 10•10 years ago
|
||
Attachment #8484243 -
Attachment is obsolete: true
Attachment #8484243 -
Flags: review?(catlee)
Attachment #8484366 -
Flags: review?(catlee)
Reporter | ||
Comment 11•10 years ago
|
||
Comment on attachment 8484366 [details] [diff] [review]
tmpclean-puppet-1.diff
We may need to avoid cleaning up /tmp if we run runner multiple times without reboots.
Attachment #8484366 -
Flags: review?(catlee)
Updated•10 years ago
|
Whiteboard: [kanban:engops:https://kanbanize.com/ctrl_board/6/388]
Updated•10 years ago
|
Whiteboard: [kanban:engops:https://kanbanize.com/ctrl_board/6/388] → [kanban:engops:https://kanbanize.com/ctrl_board/6/392]
Updated•10 years ago
|
Whiteboard: [kanban:engops:https://kanbanize.com/ctrl_board/6/392]
Updated•10 years ago
|
Whiteboard: [kanban:engops:https://kanbanize.com/ctrl_board/6/486]
Updated•10 years ago
|
Whiteboard: [kanban:engops:https://kanbanize.com/ctrl_board/6/486] → [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/1119] [kanban:engops:https://kanbanize.com/ctrl_board/6/486]
Updated•10 years ago
|
Whiteboard: [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/1119] [kanban:engops:https://kanbanize.com/ctrl_board/6/486] → [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/1128] [kanban:engops:https://kanbanize.com/ctrl_board/6/486]
Updated•10 years ago
|
Whiteboard: [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/1128] [kanban:engops:https://kanbanize.com/ctrl_board/6/486] → [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/1129] [kanban:engops:https://kanbanize.com/ctrl_board/6/486]
Updated•10 years ago
|
Whiteboard: [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/1129] [kanban:engops:https://kanbanize.com/ctrl_board/6/486] → [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/1130] [kanban:engops:https://kanbanize.com/ctrl_board/6/486]
Updated•10 years ago
|
Whiteboard: [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/1130] [kanban:engops:https://kanbanize.com/ctrl_board/6/486] → [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/1130]
Assignee | ||
Updated•10 years ago
|
Assignee: rail → winter2718
Assignee | ||
Comment 12•10 years ago
|
||
This changes the cleanup bash script just a bit, and applies the change to all the places where tweaks::cleanup was before. This is now possible since runner works on OSX.
Attachment #8484366 -
Attachment is obsolete: true
Attachment #8526563 -
Flags: review?(rail)
Reporter | ||
Comment 13•10 years ago
|
||
Comment on attachment 8526563 [details] [diff] [review]
cleanup-osx-and-linux.diff
Review of attachment 8526563 [details] [diff] [review]:
-----------------------------------------------------------------
::: modules/runner/templates/tasks/cleanup.erb
@@ +8,5 @@
> +
> +BUILDER_HOME="<%= scope.lookupvar('::users::builder::home') %>"
> +
> +if [ $(uname) = "Darwin" ]; then
> + rm -fv "${BUILDER_HOME}/.mozilla/firefox/console.log"
I think the logic should be inverted here, Darwin should remove "${BUILDER_HOME}/Library/Application Support/Firefox/console.log"
Assignee | ||
Comment 14•10 years ago
|
||
Comment on attachment 8526563 [details] [diff] [review]
cleanup-osx-and-linux.diff
Review of attachment 8526563 [details] [diff] [review]:
-----------------------------------------------------------------
Derp, yes!
Assignee | ||
Comment 15•10 years ago
|
||
Attachment #8526563 -
Attachment is obsolete: true
Attachment #8526563 -
Flags: review?(rail)
Attachment #8526750 -
Flags: review?(rail)
Assignee | ||
Comment 16•10 years ago
|
||
Testing this out over the weekend, will merge if all goes well. :)
Assignee | ||
Comment 17•10 years ago
|
||
Reporter | ||
Comment 18•10 years ago
|
||
Comment on attachment 8526750 [details] [diff] [review]
cleanup-osx-and-linux.diff
Review of attachment 8526750 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM!
Attachment #8526750 -
Flags: review?(rail) → review+
Assignee | ||
Updated•10 years ago
|
Attachment #8526750 -
Flags: checked-in+
Assignee | ||
Comment 19•10 years ago
|
||
Okay, this seems to be working out. Shipping it!
Assignee | ||
Updated•10 years ago
|
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•