-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New setting daemonShell. Used in debian package to create user with
specified shell. FIX #235
- Loading branch information
Showing
9 changed files
with
62 additions
and
12 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
src/main/resources/com/typesafe/sbt/packager/debian/postinst-useradd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Adding ${{user}} | ||
if ! id -u ${{user}} > /dev/null 2>&1; then | ||
echo "Creating user ${{user}} in group ${{group}}" | ||
useradd --system --no-create-home --gid ${{group}} --shell /bin/false ${{user}} | ||
useradd --system --no-create-home --gid ${{group}} --shell ${{shell}} ${{user}} | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import NativePackagerKeys._ | ||
import com.typesafe.sbt.packager.archetypes.ServerLoader | ||
|
||
packageArchetype.java_server | ||
|
||
serverLoading in Debian := ServerLoader.Upstart | ||
|
||
daemonUser in Linux := "daemonuser" | ||
|
||
daemonGroup in Linux := "daemongroup" | ||
|
||
daemonShell in Linux := "/bin/bash" | ||
|
||
mainClass in Compile := Some("empty") | ||
|
||
name := "debian-test" | ||
|
||
version := "0.1.0" | ||
|
||
maintainer := "Josh Suereth <joshua.suereth@typesafe.com>" | ||
|
||
packageSummary := "Test debian package" | ||
|
||
packageDescription := """A fun package description of our software, | ||
with multiple lines.""" | ||
|
||
TaskKey[Unit]("check-control-files") <<= (target, streams) map { (target, out) => | ||
val debian = target / "debian-test-0.1.0" / "DEBIAN" | ||
val postinst = IO.read(debian / "postinst") | ||
val postrm = IO.read(debian / "postrm") | ||
assert(postinst contains "useradd --system --no-create-home --gid daemongroup --shell /bin/bash daemonuser", "postinst misses useradd for daemonuser: " + postinst) | ||
() | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % sys.props("project.version")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Run the debian packaging. | ||
> debian:package-bin | ||
$ exists target/debian-test-0.1.0.deb | ||
|
||
# Check defaults | ||
$ exists target/debian-test-0.1.0/DEBIAN/prerm | ||
$ exists target/debian-test-0.1.0/DEBIAN/postinst | ||
|
||
# Check files for defaults | ||
> check-control-files |