This is slightly off-topic, but while I'm talking about Fanr I thought I may try my luck...
Does anyone know how to run Fanr (or any Fantom webservice) as a daemon on nix? (In my case specifically CentOS 5)?
There's a good init.d template script at stackoverflow which I've followed - putting the one line fanr cmd in a .sh script.
But to work, it expects the .sh to execute and return. But running the fan fanr::WebRepoMain ... script grabs focus and stays in the foreground.
andyWed 1 Aug 2012
It's not perfect - but I have an init.d script that works pretty well (start/stop/restart/status) - its for Debian 6 - but should be at least a good starting point. I'll post when I get back from vacation - early next sometime.
SlimerDudeThu 2 Aug 2012
Thanks Andy, but no need. nohup is what I was looking for...
... but then I had trouble stopping the service. Finding the pid of java launched from fanlaunch launched from fanr launched from my script used in the service script was a bit beyond my novice sys admin skills!
So I opted to use this Java Daemon Script which, although it looks over the top, actually works simply and as advertised. I just had to pull the Java cmd line from a running fan process (via ps aux | grep fan)
andyWed 15 Aug 2012
Been meaning to post this for awhile anyways - so for anyone else's benefit:
SlimerDude Wed 1 Aug 2012
This is slightly off-topic, but while I'm talking about Fanr I thought I may try my luck...
Does anyone know how to run
Fanr
(or any Fantom webservice) as a daemon on nix? (In my case specifically CentOS 5)?There's a good
init.d
template script at stackoverflow which I've followed - putting the one line fanr cmd in a .sh script.But to work, it expects the
.sh
to execute and return. But running thefan fanr::WebRepoMain ...
script grabs focus and stays in the foreground.andy Wed 1 Aug 2012
It's not perfect - but I have an init.d script that works pretty well (start/stop/restart/status) - its for Debian 6 - but should be at least a good starting point. I'll post when I get back from vacation - early next sometime.
SlimerDude Thu 2 Aug 2012
Thanks Andy, but no need. nohup is what I was looking for...
... but then I had trouble stopping the service. Finding the pid of
java
launched fromfanlaunch
launched fromfanr
launched from my script used in the service script was a bit beyond my novice sys admin skills!So I opted to use this Java Daemon Script which, although it looks over the top, actually works simply and as advertised. I just had to pull the Java cmd line from a running fan process (via
ps aux | grep fan
)andy Wed 15 Aug 2012
Been meaning to post this for awhile anyways - so for anyone else's benefit:
http://andyfrank.com/blog/2012/08/initd-for-fantom/