0

I am trying to package a cron as part of my debian package (https://github.com/indykish/megam_akka.git).

The debian package is built using the sbt-native-packager. I placed the cron script inside my bin directory as here https://github.com/indykish/megam_akka/blob/master/bin/megamherk.cron.d

I changed my build.sbt to pickup the megamher.cron.d as here https://github.com/indykish/megam_akka/blob/master/build.sbt

I have attached the snippet of code here:

 linuxPackageMappings in Debian <+= (baseDirectory) map { bd =>
 (packageMapping((bd / "bin/herk_stash") -> "/usr/share/megamherk/bin/herk_stash")
 withUser "root" withGroup "root" withPerms "0755")
 }

linuxPackageMappings in Debian <+= (baseDirectory) map { bd =>
(packageMapping((bd / "bin/megamherk.cron.d") -> "/etc/cron.d/megamherk")
withUser "root" withGroup "root" withPerms "0755")
}

I ran:

sbt clean compile

sbt dist:dist

sbt debian:packageBin

The generated debian bundle inside the target directory doesn't have the cron bundled.

I referred this debian documentation (http://www.debian.org/doc/manuals/maint-guide/dother.en.html#crond)

Am I missing something here ? How do I make sbt-native-package pickup a cron job ?

4

1 回答 1

1

打包简单文件的最简单方法是使用默认目录结构。

src/linux/...

在您的情况下,您会将文件放入

src/linux/etc/cron.d/megamherk

您的区域设置将被重新应用。因此,如果megamherk是可执行的,它将保持可执行。

如果这对您不起作用,请打开带有小测试用例的工单。

干杯,穆基

于 2014-03-10T12:54:14.837 回答