@@ -224,6 +224,11 @@ configure(distributions) {
224224configure(distributions. findAll { [' zip' , ' tar' , ' integ-test-zip' ]. contains(it. name) }) {
225225 // CopySpec does not make it easy to create an empty director so we create the directory that we want, and then point CopySpec to its
226226 // parent to copy to the root of the distribution
227+ File logs = new File (buildDir, ' logs-hack/logs' )
228+ task createLogDir(type : EmptyDirTask ) {
229+ dir " ${ logs} "
230+ dirMode 0755
231+ }
227232 File plugins = new File (buildDir, ' plugins-hack/plugins' )
228233 task createPluginsDir(type : EmptyDirTask ) {
229234 dir " ${ plugins} "
@@ -247,6 +252,12 @@ configure(distributions.findAll { ['zip', 'tar', 'integ-test-zip'].contains(it.n
247252 MavenFilteringHack . filter(it, expansions)
248253 }
249254 }
255+ into(' ' ) {
256+ from {
257+ dirMode 0755
258+ logs. getParent()
259+ }
260+ }
250261 into(' ' ) {
251262 from {
252263 dirMode 0755
@@ -497,7 +508,9 @@ task run(type: RunTask) {
497508Map<String , String > expansionsForDistribution (distributionType ) {
498509 final String defaultHeapSize = " 1g"
499510 final String packagingPathData = " path.data: /var/lib/elasticsearch"
500- final String packagingPathLogs = " path.logs: /var/log/elasticsearch"
511+ final String pathLogs = " /var/log/elasticsearch"
512+ final String packagingPathLogs = " path.logs: ${ pathLogs} "
513+ final String packagingLoggc = " ${ pathLogs} /gc.log"
501514
502515 String footer = " # Built for ${ project.name} -${ project.version} " +
503516 " (${ distributionType} )"
@@ -533,6 +546,11 @@ Map<String, String> expansionsForDistribution(distributionType) {
533546 ' rpm' : packagingPathLogs,
534547 ' def' : ' #path.logs: /path/to/logs'
535548 ],
549+ ' loggc' : [
550+ ' deb' : packagingLoggc,
551+ ' rpm' : packagingLoggc,
552+ ' def' : ' logs/gc.log'
553+ ],
536554
537555 ' heap.min' : defaultHeapSize,
538556 ' heap.max' : defaultHeapSize,
0 commit comments