{"id":75428,"date":"2020-01-18T16:28:20","date_gmt":"2020-01-18T10:58:20","guid":{"rendered":"https:\/\/www.vskills.in\/certification\/tutorial\/?p=75428"},"modified":"2024-04-12T14:33:31","modified_gmt":"2024-04-12T09:03:31","slug":"unix-daemon","status":"publish","type":"page","link":"https:\/\/www.vskills.in\/certification\/tutorial\/unix-daemon\/","title":{"rendered":"Unix Daemon"},"content":{"rendered":"<p>Tomcat can be run as a daemon using the jsvc tool from the commons-daemon project. Source tarballs for jsvc are included with the Tomcat binaries, and need to be compiled. Building jsvc requires a C ANSI compiler (such as GCC), GNU Autoconf, and a JDK.<\/p>\n<p>Before running the script, the JAVA_HOME environment variable should be set to the base path of the JDK. Alternately, when calling the .\/configure script, the path of the JDK may be specified using the &#8211;with-javaparameter, such as .\/configure &#8211;with-java=\/usr\/java.<\/p>\n<p>Using the following commands should result in a compiled jsvc binary, located in the $CATALINA_HOME\/bin folder. This assumes that GNU TAR is used, and that CATALINA_HOME is an environment variable pointing to the base path of the Tomcat installation.<\/p>\n<p>Please note that you should use the GNU make (gmake) instead of the native BSD make on FreeBSD systems.<\/p>\n<p>&nbsp;<\/p>\n<p>cd $CATALINA_HOME\/bin<\/p>\n<p>tar xvfz commons-daemon-native.tar.gz<\/p>\n<p>cd commons-daemon-1.0.x-native-src\/unix<\/p>\n<p>.\/configure<\/p>\n<p>make<\/p>\n<p>cp jsvc ..\/..<\/p>\n<p>cd ..\/..<\/p>\n<p>&nbsp;<\/p>\n<p>Tomcat can then be run as a daemon using the following commands.<\/p>\n<p>CATALINA_BASE=$CATALINA_HOME<\/p>\n<p>&nbsp;<\/p>\n<p>cd $CATALINA_HOME<\/p>\n<p>.\/bin\/jsvc \\<\/p>\n<p>-classpath $CATALINA_HOME\/bin\/bootstrap.jar:$CATALINA_HOME\/bin\/tomcat-juli.jar \\<\/p>\n<p>-outfile $CATALINA_BASE\/logs\/catalina.out \\<\/p>\n<p>-errfile $CATALINA_BASE\/logs\/catalina.err \\<\/p>\n<p>-Dcatalina.home=$CATALINA_HOME \\<\/p>\n<p>-Dcatalina.base=$CATALINA_BASE \\<\/p>\n<p>-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \\<\/p>\n<p>-Djava.util.logging.config.file=$CATALINA_BASE\/conf\/logging.properties \\<\/p>\n<p>org.apache.catalina.startup.Bootstrap<\/p>\n<p>&nbsp;<\/p>\n<p>You may also need to specify -jvm server if the JVM defaults to using a server VM rather than a client VM. This has been observed on OSX.<\/p>\n<p>jsvc has other useful parameters, such as -user which causes it to switch to another user after the daemon initialization is complete. This allows, for example, running Tomcat as a non privileged user while still being able to use privileged ports. Note that if you use this option and start Tomcat as root, you&#8217;ll need to disable theorg.apache.catalina.security.SecurityListener check that prevents Tomcat starting when running as root.<\/p>\n<p>jsvc &#8211;help will return the full jsvc usage information. In particular, the -debug option is useful to debug issues running jsvc.<\/p>\n<p>The file $CATALINA_HOME\/bin\/daemon.sh can be used as a template for starting Tomcat automatically at boot time from \/etc\/init.d with jsvc. that the Commons-Daemon JAR file must be on your runtime class path to run Tomcat in this manner. The Commons-Daemon JAR file is in the Class-Path entry of the bootstrap.jar manifest, but if you get a Class Not Found Exception or a No Class Def Found Error for a Commons-Daemon class, add the Commons-Daemon JAR to the -cp argument when launching jsvc.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tomcat can be run as a daemon using the jsvc tool from the commons-daemon project. Source tarballs for jsvc are included with the Tomcat binaries, and need to be compiled. Building jsvc requires a C ANSI compiler (such as GCC), GNU Autoconf, and a JDK. Before running the script, the JAVA_HOME environment variable should be&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[8678],"tags":[8686],"class_list":["post-75428","page","type-page","status-publish","hentry","category-tomcat","tag-unix-daemon"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Unix Daemon - Tutorial<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.vskills.in\/certification\/tutorial\/unix-daemon\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Unix Daemon - Tutorial\" \/>\n<meta property=\"og:description\" content=\"Tomcat can be run as a daemon using the jsvc tool from the commons-daemon project. Source tarballs for jsvc are included with the Tomcat binaries, and need to be compiled. Building jsvc requires a C ANSI compiler (such as GCC), GNU Autoconf, and a JDK. Before running the script, the JAVA_HOME environment variable should be...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vskills.in\/certification\/tutorial\/unix-daemon\/\" \/>\n<meta property=\"og:site_name\" content=\"Tutorial\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/vskills.in\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-12T09:03:31+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/unix-daemon\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/unix-daemon\/\",\"name\":\"Unix Daemon - Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\"},\"datePublished\":\"2020-01-18T10:58:20+00:00\",\"dateModified\":\"2024-04-12T09:03:31+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/unix-daemon\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.vskills.in\/certification\/tutorial\/unix-daemon\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/unix-daemon\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Unix Daemon\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"name\":\"Tutorial\",\"description\":\"Vskills - A initiative in elearning and certification\",\"publisher\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\",\"name\":\"Vskills\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"contentUrl\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"width\":73,\"height\":55,\"caption\":\"Vskills\"},\"image\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/vskills.in\/\",\"https:\/\/x.com\/vskills_in\",\"https:\/\/www.linkedin.com\/company-beta\/1371554\/\",\"https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Unix Daemon - Tutorial","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.vskills.in\/certification\/tutorial\/unix-daemon\/","og_locale":"en_US","og_type":"article","og_title":"Unix Daemon - Tutorial","og_description":"Tomcat can be run as a daemon using the jsvc tool from the commons-daemon project. Source tarballs for jsvc are included with the Tomcat binaries, and need to be compiled. Building jsvc requires a C ANSI compiler (such as GCC), GNU Autoconf, and a JDK. Before running the script, the JAVA_HOME environment variable should be...","og_url":"https:\/\/www.vskills.in\/certification\/tutorial\/unix-daemon\/","og_site_name":"Tutorial","article_publisher":"https:\/\/www.facebook.com\/vskills.in\/","article_modified_time":"2024-04-12T09:03:31+00:00","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/unix-daemon\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/unix-daemon\/","name":"Unix Daemon - Tutorial","isPartOf":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website"},"datePublished":"2020-01-18T10:58:20+00:00","dateModified":"2024-04-12T09:03:31+00:00","breadcrumb":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/unix-daemon\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vskills.in\/certification\/tutorial\/unix-daemon\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/unix-daemon\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vskills.in\/certification\/tutorial\/"},{"@type":"ListItem","position":2,"name":"Unix Daemon"}]},{"@type":"WebSite","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","name":"Tutorial","description":"Vskills - A initiative in elearning and certification","publisher":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization","name":"Vskills","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","contentUrl":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","width":73,"height":55,"caption":"Vskills"},"image":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/vskills.in\/","https:\/\/x.com\/vskills_in","https:\/\/www.linkedin.com\/company-beta\/1371554\/","https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw"]}]}},"_links":{"self":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/75428","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/comments?post=75428"}],"version-history":[{"count":3,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/75428\/revisions"}],"predecessor-version":[{"id":76370,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/75428\/revisions\/76370"}],"wp:attachment":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/media?parent=75428"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/categories?post=75428"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/tags?post=75428"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}