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

FIX #435 Adding loader and control functions #439

Merged
merged 2 commits into from
Dec 16, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
${{loader-functions}}
${{control-functions}}

addGroup ${{daemon_group}}
addUser ${{daemon_user}} ${{daemon_group}} "${{app_name}} user-daemon" "${{daemon_shell}}"

startService ${{app_name}} || echo "${{app_name}} could not be registered or started"
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
${{control-functions}}

# Removing system user/group : ${{daemon_user}} and ${{daemon_group}}

# Scriptlet syntax: http://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Syntax
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
${{control-functions}}

# Adding system user/group : ${{daemon_user}} and ${{daemon_group}}
if ! getent group | grep -q "^${{daemon_group}}:" ;
then
echo "Creating system group: ${{daemon_group}}"
groupadd --system ${{daemon_group}}
fi
if ! getent passwd | grep -q "^${{daemon_user}}:";
then
echo "Creating system user: ${{daemon_user}}"
useradd --gid ${{daemon_group}} --no-create-home --system -c '${{app_name}} daemon-user' ${{daemon_user}}
fi

addGroup ${{daemon_group}}
addUser ${{daemon_user}} ${{daemon_group}} "${{app_name}} user-daemon" "${{daemon_shell}}"
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
${{loader-functions}}

# Halting ${{app_name}}
echo "Shutdown ${{app_name}}"
service ${{app_name}} stop || echo "Could not stop ${{app_name}}"
2 changes: 1 addition & 1 deletion test-project-simple/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ libraryDependencies ++= Seq(

mainClass in Compile := Some("ExampleApp")

enablePlugins(JavaAppPackaging, JDebPackaging)
enablePlugins(JavaServerAppPackaging, JDebPackaging)

maintainer := "Josh Suereth <[email protected]>"
packageSummary := "Minimal Native Packager"
Expand Down
16 changes: 15 additions & 1 deletion test-project-simple/src/main/scala/ExampleApp.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
import java.util.concurrent._

object ExampleApp extends App {

println("Hello, world!")
val executorService = Executors newFixedThreadPool 2

while (true) {
for(i <- 0 to 5) executorService execute HelloWorld(i)
Thread sleep 5000
}

}

case class HelloWorld(i: Int) extends Runnable {
def run() {
println(s"[$i] Hello, world!")
}
}
2 changes: 2 additions & 0 deletions test-project-simple/src/templates/etc-default
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-J-Xms64m
-J-Xmx128m