Re: [sbt] use sbt to launch daemon then exit sbt

427 views
Skip to first unread message

Mark Harrah

unread,
Dec 10, 2012, 9:24:23 AM12/10/12
to simple-b...@googlegroups.com
On Fri, 7 Dec 2012 04:21:33 -0800 (PST)
Levon Kirakosyan <le...@toort.net> wrote:

> Hi. I'm developing a server application using scala and sbt. Sbt manages a
> bunch of maven dependencies for my project so I need to stick with it. The
> question is how can I start my server as a daemon i.e. launch it as
> independent jvm (it will write it's pid to a file for later kill) and be
> able to end sbt session.

It is best to generate a script and run that outside of sbt. One plugin that generates the script is:

https://github.com/sbt/sbt-start-script

-Mark

>
> --
> You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/simple-build-tool/-/9RBKORkMmXsJ.
> To post to this group, send email to simple-b...@googlegroups.com.
> To unsubscribe from this group, send email to simple-build-t...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/simple-build-tool?hl=en.
>

Levon

unread,
Dec 10, 2012, 9:26:10 AM12/10/12
to simple-b...@googlegroups.com
Thanks Mark. I'll try that.

bwbecker

unread,
Feb 10, 2013, 6:44:42 AM2/10/13
to simple-b...@googlegroups.com


On Monday, December 10, 2012 9:24:23 AM UTC-5, Mark Harrah wrote:
On Fri, 7 Dec 2012 04:21:33 -0800 (PST)
Levon Kirakosyan <le...@toort.net> wrote:

> Hi. I'm developing a server application using scala and sbt. Sbt manages a
> bunch of maven dependencies for my project so I need to stick with it. The
> question is how can I start my server as a daemon i.e. launch it as
> independent jvm (it will write it's pid to a file for later kill) and be
> able to end sbt session.

It is best to generate a script and run that outside of sbt.  One plugin that generates the script is:

 https://github.com/sbt/sbt-start-script

-Mark


Thanks for the reference to sbt-start-script.  Looks like just the tool I need, but it's not working for me.
I've added
addSbtPlugin("com.typesafe.sbt" % "sbt-start-script" % "0.6.0")
to ~/.sbt/plugins/plugins.sbt, reloaded and updated.  SBT reports

[info] [SUCCESSFUL ] com.typesafe.sbt#sbt-start-script;0.6.0!sbt-start-script.jar (614ms)

but when I attempt to use

> add-start-script-tasks
[error] Not a valid command: add-start-script-tasks
[error] Expected '/'
[error] Expected ':'
[error] Not a valid key: add-start-script-tasks
[error] add-start-script-tasks
[error]                       ^

I don't know how to debug this one.  Suggestions on how to proceed?

Thanks,
 

Indrajit Raychaudhuri

unread,
Feb 11, 2013, 7:16:59 PM2/11/13
to simple-b...@googlegroups.com
`about` command at sbt prompt should show the plugins available. If it doesn't show "com.typesafe.sbt.SbtStartScript" under 'Available Plugins', which I suspect is the case here, your 'plugins' project has gone stale.

Do these at your console and you'll be all set:

> reload plugins
> clean
> reload return

Mark is likely to come up with a better idea though.

- Indrajit


Thanks,
 

--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simple-build-t...@googlegroups.com.

To post to this group, send email to simple-b...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages