top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Using the bin/daemon.sh script on ubuntu

0 votes
600 views

Pleas point me to a good source how to use that (with ubuntu and Tomcat 7)?

The internet is full of selfmade /etc/init.d/ scripts, but mostly it isn't used it as a real service (jsvc). Keyword: bin/*daemon.sh*
Even the books "Apache Tomcat 7" and "Tomcat 7 Essentials" are not talking about it.

On the docs I've found this [http://tomcat.apache.org/tomcat-7.0-doc/setup.html#Unix_daemon]:

cd $CATALINA_HOME/bin
tar xvfz commons-daemon-native.tar.gz
cd commons-daemon-1.0.x-native-src/unix
./configure
make
cp jsvc ../..
cd ../..

But what about:
* set env. variables (maybe: catalina.sh?, /etc/profiles?)
* adjust the heap size
* logging to the right directory (like: /var/log/tomcat/...)
* specifying the User: "tomcat"

posted Jul 30, 2013 by Deepankar Dubey

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+1 vote

1) The script can be used directly. Maybe you can clarify your question?

2) The script is fairly readable, though less-well documented than bin/catalina.sh. Most of the environment variables recognized by bin/catalina.sh are also recognized by bin/daemon.sh. For instance:

CATALINA_HOME
CATALINA_BASE
CATALINA_OPTS
CATALINA_PID
CATALINA_OUT
CATALINA_TMP (note: catalina.sh uses CATALINA_TMPDIR)
JAVA_ENDORSED_DIRS
JAVA_HOME
JAVA_OPTS
TOMCAT_USER

It also accepts these (undocumented, other than by reading the script itself) command-line arguments with fairly obvious behavior:

 --java-home
 --catalina-home
 --catalina-base
 --catalina-pid
 --tomcat-user
 --service-start-wait-time (sets the "wait" time for jsvc)
answer Jul 30, 2013 by Mandeep Sehgal
+1 vote

/etc/profiles is executed when you enter bash shell, so if Tomcat starts at boot time, it won't be able to access environment variables defined in /etc/profile.

I set JAVA_HOME, CATALINA_BASE and CATALINA_HOME environment variables in /etc/init.d/tomcat (which is a copy of daemon.sh), but I guess there may be a better place to do that.

This link [http://unix.stackexchange.com/questions/44370/how-to-make-unix-service-see-environment-variables] recommends to put environment variables in /etc/default/tomcat, and then to source them from /etc/init.d/tomcat.

answer Jul 30, 2013 by Luv Kumar
Similar Questions
+1 vote

I want to run a python script which contains simple form of html on firefox browser , but don't know what should be the configuration on ubuntu 12.04 to run this script i.e CGI configuration.

My code is

ubder 
in /var/www/cgi-bin/forms__.py

#!/usr/bin/env python
import webapp2

form ="""

 """

class MainPage(webapp2.RequestHandler):
 def get(self):
 #self.response.headers['Content-Type'] = 'text/plain'
 self.response.out.write(form)

app = webapp2.WSGIApplication([('/', MainPage)], debug=True)
+1 vote

I have a perl script test.pl. I want to create desktop shortcut. While I click on this shortcut icon it will run my perl script and keep the terminal open.

I have tried the command

ln -s test.pl ~/Desktop/abc

while I click on this abc Icon from my desktop. It run and same time the terminal exit. Could you please help here?

My requirement is:

I want to create desktop shortcut for particular perl program. While I click on this icon from desktop, it should run and keep the terminal open.

0 votes

I just had to run kino as root, because I didn't have permission to use the firewire port to talk to my Sony Handi-cam digital hi8 movie camera.

So, while I have a root session going, what do I have to do to make the user 1000, me, be able to use the firewire port?

0 votes

I have an Ubuntu VDI image (created through Virtual box) in one laptop and want to install Ubuntu on bare metal using this VDI image.
Is it possible ?

...