top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration
Print Preview

Using the bin/daemon.sh script on ubuntu

0 votes
156 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 Google+ Share Button LinkedIn Share Button Multiple Social 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.

+1 vote

I am using VirtualBox with Ubuntu version 14 installed in it. I have created 4 virualbox ports vboxnet0,1,2,3.

I would like to add 2 new ethernet ports in Ubuntu to assign each ethernet port to a vboxnet , I am already having eth0 and eth1, I would like to add 2 more ethernet ports, please help?


Useful Links with Similar Problem
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...