Ori.livneh has submitted this change and it was merged.

Change subject: base: standardize the path and file name of core dumps
......................................................................


base: standardize the path and file name of core dumps

* Set aside /var/tmp/core for core dumps. Chmod it 1773.
* Set kernel.core_pattern sysctl param so core dumps are written to that
  directory, and set a file name pattern of 
'core.<host>.<executable>.<pid>.<timestamp>'.
  - <host> and <timestamp> because files get scp'd around and this helps
    preserve their origin.
  - <executable> for quick visual identification.
  - <pid> so multiple core dumps from one executable don't clobber one another.
* Sweep dumps that haven't been accessed in one week.

Change-Id: If647290429877fff7f31e26ddab0e9ac783816ee
---
M modules/base/manifests/environment.pp
1 file changed, 24 insertions(+), 0 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  BBlack: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/modules/base/manifests/environment.pp 
b/modules/base/manifests/environment.pp
index 408b21a..7edd8d5 100644
--- a/modules/base/manifests/environment.pp
+++ b/modules/base/manifests/environment.pp
@@ -76,4 +76,28 @@
         mode    => '0444',
         content => "${::realm}\n",
     }
+
+
+    ### Core dumps
+
+    # Write core dumps to 
/var/tmp/core/core.<host>.<executable>.<pid>.<timestamp>.
+    # Remove core dumps with atime > one week.
+
+    file { '/var/tmp/core':
+        ensure => directory,
+        owner  => 'root',
+        group  => 'root',
+        mode   => '1773',
+    }
+
+    sysctl::parameters { 'core_dumps':
+        values  => { 'kernel.core_pattern' => 
'/var/tmp/core/core.%h.%e.%p.%t', },
+        require => File['/var/tmp/core'],
+    }
+
+    tidy { '/var/tmp/core':
+        age     => '1w',
+        recurse => 1,
+        matches => 'core.*',
+    }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/171206
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If647290429877fff7f31e26ddab0e9ac783816ee
Gerrit-PatchSet: 5
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh <[email protected]>
Gerrit-Reviewer: BBlack <[email protected]>
Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: Mark Bergsma <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: Rush <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to