How do I start/stop JBoss on system startup on Mac Lion? - jboss

I'm using Mac Lion (10.7.3) and I just downloaded JBoss 7.1.0. I would like JBoss to run when I start my machine. So I created this directory
/Library/StartupItems/JBoss/
and then created a file named "JBoss" within the above directory containing ...
#!/bin/sh
. /etc/rc.common
StartService ()
{
ConsoleMessage "Starting JBoss"
$JBOSS_HOME/bin/standalone.sh
}
StopService ()
{
ConsoleMessage "Stopping JBoss"
# Don't know what to put here.
}
RunService "$1"
What, if anything, do I need to put in the "StopService" clause to stop JBoss? Also, is this the right way to go about running JBoss in the background when I start my machine?
Thanks, - Dave

Looking in the README.txt it states this:
If the server is running in a background process, the server can be stopped using the JBoss CLI:
JBOSS_HOME>/bin/jboss-cli.sh --connect --command=:shutdown

Related

Installing php extension for SQL Anywhere on server with CentOS, Plesk, php-fpm

we got a new WebServer with CentOS, Plesk and php-fpm.
Now we don't get the php extension running.
What we did:
installed latest SQL Anywhere 17 (ebf29577)
copied php-7.3.0_sqlanywhere_r.so to /opt/plesk/php/7.3/lib64/php/modules/
loading php-7.3.0_sqlanywhere_r.so via /opt/plesk/php/7.3/etc/php.d/sqlanywhere.ini
this leads to an error:
WARNING: [pool plesk-php73-fpm.plesk-service.localdomain] child 11616 said into stderr: "NOTICE: PHP message: PHP Warning: request_startup() for sqlanywhere module failed in Unknown on line 0"
(This leads to php 7.3 fpm is not loading at all)
next try was to switch from FPM to CGI: same error
module is loadable itself within shell if LD_LIBRARY_PATH was enhanced with path /opt/sqlanywhere17/lib64/
some tries getting the cause by strace did not help
Has anybody an idea or maybe even successfully installed php extension.
Thanks
Florian
after a lot of tests we found a solution:
in Plesk Domain php settings we had to add:
[php-fpm-pool-settings]
env[LD_LIBRARY_PATH]="/opt/sqlanywhere_v2/lib64:$LD_LIBRARY_PATH"
Now all libs are found and it works
For me solution was, creating custom handler:
plesk bin php_handler --add -displayname "PHP SQLAnywhere 7.4" -path /opt/php-custom-handlers/7.4/php-sqlanywhere.fcgi -clipath /opt/plesk/php/7.4/bin/php -phpini /opt/plesk/php/7.4/etc/php.ini -type fastcgi
php-sqlanywhere.fcgi contents:
#!/bin/bash
LD_LIBRARY_PATH=/opt/sqlanywhere17/lib64
export LD_LIBRARY_PATH
exec /opt/plesk/php/7.4/bin/php-cgi "$#"
And finally using this handler on domain php settings and adding on additional directives:
extension=sqlanywhere.so

uWSGI + virtualenv 'No module named site'

So this seems to be a really common problem with this setup, but I can't find any solutions that work on SO. I've setup a very new Ubuntu 15.04 server, then installed nginx, virtualenv (and -wrapper), and uWSGI (via apt-get, so globally, not inside the virtualenv).
My virtualenv is located at /root/Env/example. Inside of the virtualenv, I installed Django, then at /srv/www/example/app ran Django's startproject command with the project name example, so I have vaguely this structure:
-root
-Env
-example
-bin
-lib
-srv
-www
-example
-app
-example
manage.py
-example
wsgi.py
...
My example.ini file for uWSGI looks like this:
[uwsgi]
project = example
plugin = python
chdir = /srv/www/example/app/example
home = /root/Env/example
module = example.wsgi:application
master = true
processes = 5
socket = /run/uwsgi/app/example/example.socket
chmod-socket = 664
uid = www-data
gid = www-data
vacuum = true
But no matter whether I run this via uwsgi --ini /etc/uwsgi/apps-enabled/example.ini or via daemon, I get the exact same error:
Python version: 2.7.9 (default, Apr 2 2015, 15:37:21) [GCC 4.9.2]
Set PythonHome to /root/Env/example
ImportError: No module named site
I should note that the Django project works via the built-in development server ./manage.py runserver, and that when I remove home = /root/Env/example the thing works (but is obviously using the global Python and Django rather than the virtualenv versions, which means it's useless for a proper virtualenv setup).
Can anyone see some obvious path error that I'm not seeing? As far as I can tell, home is entirely correct based on my directory structure, and everything else in the ini too, so why is it not working with this ImportError?
In my case, I was seeing this issue because the django app I was trying to run was written in python 3 whereas uwsgi was configured for python 2. I fixed the problem by:
recompiling uwsgi to support both python 2 and python 3 apps
(I followed this guide)
adding this to my mydjangoproject_uwsgi.ini:
plugins = python35 # or whatever you specified while compiling uwsgi
For other folks using Django, you should also make sure you are correctly specifying the following:
# Django dir that contains manage.py
chdir = /var/www/project/myprojectname
# Django wsgi (myprojectname is the name of your top-level project)
module = myprojectname.wsgi:application
# the virtualenv you are using (full path)
home = /home/ubuntu/Env/mydjangovenv
plugins = python35
As #Freek said, site refers to a python module.
The error claims that python cannot find that package, which is because you have specified python_home to the wrong location.
I've encountered with the same problem and my uwsgi.ini is like below:
[uwsgi]
# variable
base = /home/xx/
# project settings
chdir = %(base)/
module = botservice.uwsgi:application
home = %(base)/env/bin
For this configuration uwsgi can find python executable in /env/bin but no packages could be found under this folder. So I changed home to
home = %(base)/env/
and it worked for me.
In your case, I suggest digging into home directive and point it to a location which contains both python executable and packages.
The site module is in the root of django.
First check is to activate the virtualenv manually (source /root/Env/example/bin/activate, start python and import site). If that fails, pip install django.
Assuming that django is correctly installed in the virtualenv, make sure that uWSGI activates the virtualenv. Relevant uWSGI configuration directives:
plugins = python
virtualenv = /root/Env/example
and in case you have error importing example.wsgi:
pythonpath = /srv/www/example/app/example

Gitblit services not started

After the execution of batch file in Gitblit, gitblit service won't start.
Install Java 7
Install Gitblit GO in Win 7 - 64 bit machine
Goto service and view the service status.
Win 7 - gitblit GO-1.3.2 - jdk-7u51-windows-x64
gitblit service is required to open the gitblit in browser?
Based on this following site, i exected the gitblit batch files.
http://gitblit.com/setup_go.html
Kindly let me know, what else i need to do.
Regards,
Sathishkumar Pannerselvam
Service isn't required to start Gitblit.
On Windows Envrionnement : you can use the batch script gitblit.cmd to start it. But don't forget the configuration's step in the file gitblit.properties (server.httpPort...). After you can access Gitblit with this url http:\localhost:8080
I encountered a similar problem.
But I solved as follows:
Open installService.cmd with text editor like notepad.
In line 12, I changed SET ARCH=amd64 into SET ARCH=x86. (The architecture of my computer is x86.)
Run installService.cmd by double-clicking it or run installService in Command Prompt.
CD may not be found .Try to add CD definition:
#REM arch = x86, amd64, or ia32
SET ARCH=amd64
SET CD=E:/gitblit-1.8.0
It may work.

wsadmin AdminApp.install of a 23MB EAR is hanging

I'm able to log into my local WAS 8 admin console and deploy a 23MB EAR with all of the defaults with no problems. However, when I attempt to do the install using wsadmin and this Jython script...
AdminApp.install('C:\Development\MyApp\MyApp.ear')
AdminConfig.save()
... wsadmin just hangs. I've been running this script right now for well over 10 minutes with my CPU at 70% on the java.exe process responsible for the deploy.
I would like to run my EAR deploys/undeploys using wsadmin if at all possible to bypass the need to log into the admin console.
Are there settings specific to wsadmin that I could tweak to make this deploy successful?
EDIT I
I tweaked my wsadmin call to launch like this (it gets called from a DOS command line...)
C:\Development\batch>call "C:\Development\WebSphere\WAS8.0\bin\wsadmin" -lang jython -conntype none -javaoption -Xms256m -Xmx1024m -f MyApp\MyAppDeploy.py
and now I'm getting java.lang.OutOfMemoryError...
Exception in thread "Bundle File Closer" java.lang.OutOfMemoryError
at java.util.zip.ZipFile.close(Native Method)
java/lang/OutOfMemoryError
at java/util/zip/ZipFile.close (Native Method)
at java/util/zip/ZipFile.close (ZipFile.java:408)
at org/eclipse/osgi/baseadaptor/bundlefile/ZipBundleFile.close (ZipBundleFile.java:313)
at org/eclipse/osgi/baseadaptor/bundlefile/MRUBundleFileList.dispatchEvent (MRUBundleFileList.java:183)
at org/eclipse/osgi/framework/eventmgr/EventManager.dispatchEvent (EventManager.java:227)
at org/eclipse/osgi/framework/eventmgr/EventManager$EventThread.run (EventManager.java:337)
Exception in thread "Bundle File Closer" at Exception in thread "Thread-10" java.lang.OutOfMemoryErrorjava.lang.O
utOfMemoryError
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:156 at )
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startjava.util.zip.ZipFile(.BundleContextImpl.java
:75Exception in thread "Thread-10" java/lang/OutOfMemoryError
1closejava.lang.OutOfMemoryError
at java/util/zip/ZipFile.close (Native Method)
at java/util/zip/ZipFile.close (ZipFile.java:408)
at org/eclipse/osgi/baseadaptor/bundlefile/ZipBundleFile.close (ZipBundleFile.java:313)
at org/eclipse/osgi/baseadaptor/bundlefile/MRUBundleFileList.dispatchEvent (MRUBundleFileList.java:183)
at org/eclipse/osgi/framework/eventmgr/EventManager.dispatchEvent (EventManager.java:227)
at org/eclipse/osgi/framework/eventmgr/EventManager$EventThread.run (EventManager.java:337)
at java.nio.CharBuffer.wrap(CharBuffer.java:361)
at sun.nio.cs.StreamEncoder$CharsetSE.implWrite(StreamEncoder.java:399)
at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:159)
at java.io.OutputStreamWriter.write(OutputStreamWriter.java:229)
at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:122)
at java.io.PrintStream.write(PrintStream.java:500)
at java.io.PrintStream.print(PrintStream.java:643)
at com.ibm.jvm.io.ConsolePrintStream.print(ConsolePrintStream.java:java/lang/OutOfMemoryError
at java/nio/CharBuffer.wrap (CharBuffer.java:361)
at sun/nio/cs/StreamEncoder$CharsetSE.implWrite (StreamEncoder.java:399)
at sun/nio/cs/StreamEncoder.write (StreamEncoder.java:159)
at java/io/OutputStreamWriter.write (OutputStreamWriter.java:229)
at java/io/BufferedWriter.flushBuffer (BufferedWriter.java:122)
at java/io/PrintStream.write (PrintStream.java:500)
at java/io/PrintStream.print (PrintStream.java:643)
at com/ibm/jvm/io/ConsolePrintStream.print (ConsolePrintStream.java:275)
at java/io/PrintStream.append (PrintStream.java:1039)
at java/io/PrintStream.append (PrintStream.java:51)
at java/lang/StackTraceElement.appendTo (StackTraceElement.java:197)
at java/lang/StackTraceElement.appendTo (StackTraceElement.java:217)
at java/lang/StackTraceElement.appendTo (StackTraceElement.java:165)
at java/lang/Throwable.printStackTrace (Throwable.java:375)
at java/lang/Throwable.printStackTrace (Throwable.java:212)
at java/lang/ThreadGroup.uncaughtException (ThreadGroup.java:779)
at java/lang/ThreadGroup.uncaughtException (ThreadGroup.java:772)
at java/lang/Thread.uncaughtException (Thread.java:1223)
The following solved it for me. This launched from the DOS command line on my PC.
call "C:\Development\WebSphere\WAS8.0\bin\wsadmin" -lang jython -javaoption -Xmx1024m -f %1

Foreman start fails on Windows following Heroku tutorial

I'm following the heroku tutorial for Heroku/Facebook integration (but I suspect this issue has nothing to do with facebook integration) and I got stuck on the stage where I was supposed to start foreman (I've installed the Heroku installbelt for windows, which includes foreman):
> foreman start
gives:
C:/RailsInstaller/Ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:247:in `to_specs': Could not find foreman (>= 0) amongst [POpen4-0.1.4, Platform-0.4.0, ZenTest-4.6.2, abstract-1.0.0, actionm
ailer-3.0.11, actionmailer-3.0.9, actionpack-3.0.11, actionpack-3.0.9, activemodel-3.0.11, activemodel-3.0.9, activerecord-3.0.11, activerecord-3.0.9, activerecord-sqlserver-adapter-3.0.15, activereso
urce-3.0.11, activeresource-3.0.9, activesupport-3.0.11, activesupport-3.0.9, addressable-2.2.6, annotate-2.4.0, arel-2.0.10, autotest-4.4.6, autotest-growl-0.2.16, autotest-rails-pure-4.1.2, autotest
-standalone-4.5.8, builder-2.1.2, bundler-1.0.15, diff-lcs-1.1.3, erubis-2.6.6, factory_girl-1.3.3, factory_girl_rails-1.0, faker-0.3.1, gravatar_image_tag-1.0.0.pre2, heroku-2.14.0, i18n-0.5.0, json-
1.6.1, launchy-2.0.5, mail-2.2.19, mime-types-1.17.2, mime-types-1.16, nokogiri-1.5.0-x86-mingw32, open4-1.1.0, pg-0.11.0-x86-mingw32, polyglot-0.3.3, polyglot-0.3.1, rack-1.2.4, rack-1.2.3, rack-moun
t-0.6.14, rack-test-0.5.7, rails-3.0.11, rails-3.0.9, railties-3.0.11, railties-3.0.9, rake-0.9.2.2, rake-0.8.7, rb-readline-0.4.0, rdoc-3.11, rdoc-3.8, rest-client-1.6.7, rspec-2.6.0, rspec-core-2.6.
4, rspec-expectations-2.6.0, rspec-mocks-2.6.0, rspec-rails-2.6.1, rubygems-update-1.8.11, rubyzip-0.9.4, rubyzip2-2.0.1, spork-0.9.0.rc8-x86-mingw32, sqlite3-1.3.3-x86-mingw32, sqlite3-ruby-1.3.3, te
rm-ansicolor-1.0.7, thor-0.14.6, tiny_tds-0.4.5-x86-mingw32, treetop-1.4.10, treetop-1.4.9, tzinfo-0.3.31, tzinfo-0.3.29, webrat-0.7.1, will_paginate-3.0.pre2, win32-api-1.4.8-x86-mingw32, win32-open3
-0.3.2-x86-mingw32, win32-process-0.6.5, windows-api-0.4.0, windows-pr-1.2.1, zip-2.0.2] (Gem::LoadError)
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:256:in `to_spec'
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems.rb:1210:in `gem'
from C:/Program Files (x86)/ruby-1.9.3/bin/foreman:18
Since I'm a complete noob in this I'm not sure if my question here is a duplicate for Error on 'foreman start' while following the Python/Flask Heroku tutorial (because it's not quite the same error). If so, does anyone have a method for deploying a development environment on windows (for Heruko, Python, Facebook app)? Or should I use Ubuntu for this?
Thanks
Although this question doesn't seem to be of interest to anyone here (5 views in ~2 hours, 0 answers, 0 comments...), I have found the solution and ready to share it with anyone that will encounter it:
Install the latest ruby from rubyinstaller.org (1.9.3-p194) - Sometimes there is a collision installs of the same version, in my case I've just uninstalled all versions of ruby, but if you already have other application that needs older version then you have to be more careful
Check that your system is default to use this version by invoking ruby -v in command line prompt: and getting ruby 1.9.3p194 (2012-04-20) [i386-mingw32] (you may have to close and re-open cmd, to include the new environment variables)
Still in cmd, invoke:
gem install foreman
gem install taps
now go to your Procfile app (e.g. your heroku example app from the tutorial) and execute foreman start, you should see something like this:
18:23:52 web.1 | started with pid 7212
18:23:54 web.1 | * Running on http://0.0.0.0:5000/
18:23:54 web.1 | * Restarting with reloader
after manually adding the ruby path to my system PATH environment variable (Win 7), it still didn't work.
i had to change the default install path of Heroku from
C:\Program Files(x86)\Heroku
to
C:\Heroku
as it didn't properly handle the space in the path. I also tried C:\PROGRA~2\Heroku\ruby-1.9.2\bin to no avail. I imagine any space-less path will do.
hth