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

failed to create symbolic link #71

Closed
avdv opened this issue Nov 12, 2013 · 3 comments
Closed

failed to create symbolic link #71

avdv opened this issue Nov 12, 2013 · 3 comments

Comments

@avdv
Copy link

avdv commented Nov 12, 2013

I'm using the java_server archetype.

The debian:packageBin task creates a symlink in /usr/bin pointing to the final target file.

This link is invalid when created in the staging directory and becomes valid once installed on the system.

After having run the debian:packageBin task once, it fails on subsequent calls with

ln: failed to create symbolic link `repo-service': File exists

The check at https://github.com/sbt/sbt-native-packager/blob/master/src/main/scala/com/typesafe/sbt/packager/linux/LinuxPackageMapping.scala#L74 is wrong, because File.exists returns false for broken symlinks.

Using "ln -f -s" should fix this.

@jsuereth
Copy link
Member

Thanks for the issue and diagnosis! I'm more than happy to take a patch if you get time before I have a chance to fix this :).

@muuki88
Copy link
Contributor

muuki88 commented Dec 20, 2013

This seems already be fixed: https://github.com/sbt/sbt-native-packager/blob/master/src/main/scala/com/typesafe/sbt/packager/linux/LinuxPackageMapping.scala#L76

I tested it and I can make multiple debian:packageBin calls, without failing.

@jsuereth
Copy link
Member

Great! I'll mark as resolved, should be in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants