Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server deb packages are not lintian clean #391

Closed
fhars opened this issue Oct 27, 2014 · 5 comments
Closed

server deb packages are not lintian clean #391

fhars opened this issue Oct 27, 2014 · 5 comments

Comments

@fhars
Copy link

fhars commented Oct 27, 2014

Following the "Getting Started" examples and running debian:lintian results in a package with many warnings and errors.

With this build.sbt:

import com.typesafe.sbt.SbtNativePackager._
import NativePackagerKeys._
import com.typesafe.sbt.packager.archetypes.ServerLoader.{SystemV, Upstart}

name := "example-server"

version := "1.0"

packageArchetype.java_server

maintainer in Linux := "John Smith <john.smith@example.com>"

packageSummary in Linux := "A small package summary"

packageDescription := "A longer description of your application"

serverLoading in Debian := SystemV

you get:

N: Processing binary package example-server (version 1.0, arch all) ...
E: example-server: file-in-etc-not-marked-as-conffile etc/init/example-server.conf
E: example-server: no-copyright-file
W: example-server: description-synopsis-starts-with-article
W: example-server: non-standard-dir-perm etc/ 0775 != 0755
W: example-server: non-standard-dir-perm etc/default/ 0775 != 0755
W: example-server: non-standard-dir-perm etc/init.d/ 0775 != 0755
W: example-server: non-standard-dir-perm etc/init/ 0775 != 0755
W: example-server: non-standard-dir-perm usr/ 0775 != 0755
W: example-server: non-standard-dir-perm usr/bin/ 0775 != 0755
W: example-server: symlink-should-be-relative usr/bin/example-server /usr/share/example-server/bin/example-server
W: example-server: non-standard-dir-perm usr/share/ 0775 != 0755
W: example-server: non-standard-dir-perm usr/share/example-server/bin/ 0775 != 0755
W: example-server: non-standard-dir-perm usr/share/example-server/lib/ 0775 != 0755
W: example-server: non-standard-dir-perm var/ 0775 != 0755
W: example-server: non-standard-dir-perm var/log/ 0775 != 0755
W: example-server: non-standard-dir-perm var/run/ 0775 != 0755
E: example-server: dir-or-file-in-var-run var/run/example-server/
E: example-server: prerm-calls-updaterc.d 2
E: example-server: prerm-calls-updaterc.d 2
E: example-server: prerm-calls-updaterc.d -f
W: example-server: script-in-etc-init.d-not-registered-via-update-rc.d etc/init.d/example-server
W: example-server: binary-without-manpage usr/bin/example-server
W: example-server: maintainer-script-ignores-errors postrm
W: example-server: maintainer-script-ignores-errors preinst
W: example-server: maintainer-script-ignores-errors postinst
W: example-server: maintainer-script-ignores-errors prerm
@muuki88 muuki88 added the debian label Oct 27, 2014
@muuki88
Copy link
Contributor

muuki88 commented Oct 27, 2014

E: example-server: file-in-etc-not-marked-as-conffile etc/init/example-server.conf

This is a problem

E: example-server: no-copyright-file

The maintainer has to tackle this

example-server: dir-or-file-in-var-run var/run/example-server/

That's an interesting one. I wonder what debian expects here? Maybe we have to remove the mapping and create this folder only within the bash scripts

E: example-server: prerm-calls-updaterc.d 2

Shouldn't the pre-remove script shutdown the service?

non-standard-dir-perm var/run/ 0775 != 0755

We should fix this!

@muuki88 muuki88 added the bug label Oct 27, 2014
@fhars
Copy link
Author

fhars commented Oct 27, 2014

Yes, the no-copyright-file and the binary-without-manpage are the only ones that should actually be there for a minimal example package.

For the others, see:

@fhars
Copy link
Author

fhars commented Oct 29, 2014

Looking over the issues list, the dir-or-file-in-var-run is actually the root cause behind #357

@muuki88
Copy link
Contributor

muuki88 commented Oct 29, 2014

Smooth! Thanks for doing this research. Hopefully I can fix this soon. Or you provide a pull request :)

@muuki88
Copy link
Contributor

muuki88 commented Nov 3, 2014

  • dir-or-file-in-var-run var/run/example-server/
  • update-rc.d 2 isn't really called. There is a check hash update-rc.d 2>/dev/null if it exists. ✅
  • maintainer-script-ignores-errors. I will do more about this in Make bash script more robust #340 For now I only set the set -e flag
  • script-in-etc-init.d-not-registered-via-update-rc.d this appeared now. I think lintian isn't very clever and in this case :/

For the directory permissions I will delay this until we switch to java7. If you call this in java 6

val file = new File("test/test2")
file mkdirs()

all non-existing directories will (always?) be created with 775. I tried to write a helper, but this will get to tedious very fast and clumpy in the code

val directory: String = _
val start = ("", Seq[LinuxPackageMapping]())
val mappings = directory.split("/").foldLeft(start) {
    case ((path, mappings), dir ) => 
         val nextPath = path + "/" + dir
         val mapping = packageTemplateMapping(nextPath)() withUser user withGroup group withPerms "755"
        (nextPath, mappings :+ mapping)
}
// get the mappings
mappings._2

We actually have a still valid fix for this in #142

@muuki88 muuki88 closed this as completed in d4034dc Nov 6, 2014
muuki88 added a commit that referenced this issue Nov 6, 2014
FIX #391 Fixing all lintian errors and some warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants