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 ?

Unheilig
  • 16,196
  • 193
  • 68
  • 98
indykish
  • 31
  • 4

1 Answers1

1

The easiest way to package simple files is to use the default directory structure.

src/linux/...

In your case you would put your file in

src/linux/etc/cron.d/megamherk

You locale settings will be reapplied. So if megamherk is executable it will stay executable.

If this doesn't work for you open a ticket with a small test case.

cheers, Muki

Muki
  • 3,513
  • 3
  • 27
  • 50