<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018111#M427897</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;you need not change this - Solaris has a compatibility link /bin -&amp;gt; /usr/bin&lt;BR /&gt;like HP-UX.&lt;BR /&gt;&lt;BR /&gt;The solution is to change&lt;BR /&gt;export VAR=value&lt;BR /&gt;to&lt;BR /&gt;VAR=value; export VAR&lt;BR /&gt;&lt;BR /&gt;Solaris will call your script at startup NOT via the interpreter in your file but with a hardcoded one NOT being able to parse your original statement.&lt;BR /&gt;&lt;BR /&gt;mfG Peter&lt;BR /&gt;</description>
    <pubDate>Tue, 12 Dec 2006 12:53:46 GMT</pubDate>
    <dc:creator>Peter Nikitka</dc:creator>
    <dc:date>2006-12-12T12:53:46Z</dc:date>
    <item>
      <title>Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018104#M427890</link>
      <description>I was making a Shutdown/Startup script for JBOSS on solaris and while having it run as root I was getting an error of "is not an Identifier" while exporting stuff like JAVA_HOME; JBOSS_HOME. Once I removed them and put in the complete path instead of a relative one then everything worked fine &lt;BR /&gt;&lt;BR /&gt;But my question is how can i export JAVA_HOME ; JBOSS_HOME in my script.</description>
      <pubDate>Mon, 11 Dec 2006 12:44:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018104#M427890</guid>
      <dc:creator>Hunki</dc:creator>
      <dc:date>2006-12-11T12:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018105#M427891</link>
      <description>Put the line "set -a", on a line by itself, near the top of your script before any variable definition or precede every variable name with the keyword "export" like&lt;BR /&gt;&lt;BR /&gt;export JAVA_HOME=/path_to/java/binaries</description>
      <pubDate>Mon, 11 Dec 2006 14:13:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018105#M427891</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-12-11T14:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018106#M427892</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;the SOlaris executable /usr/bin/sh is NOT the posix compliant shell - it is really the old Bourne Shell. So this syntax is invalid there:&lt;BR /&gt;export VAR=value&lt;BR /&gt;&lt;BR /&gt;You have to use&lt;BR /&gt;VAR=value; export VAR&lt;BR /&gt;instead.&lt;BR /&gt;&lt;BR /&gt;Using ksh or bash as interpreter will make the first construct valid.&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Tue, 12 Dec 2006 04:04:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018106#M427892</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-12-12T04:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018107#M427893</link>
      <description>I tried it with ksh but the i was getting the same error. ( "is not an Identifier" ).How will it work with ksh.&lt;BR /&gt; &lt;BR /&gt;hunki</description>
      <pubDate>Tue, 12 Dec 2006 11:19:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018107#M427893</guid>
      <dc:creator>Hunki</dc:creator>
      <dc:date>2006-12-12T11:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018108#M427894</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;check first the call of the correct interpreting shell in the first line of your script. It should be&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;&lt;BR /&gt;Please send an example of the failing assignment to a variable as well!&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Tue, 12 Dec 2006 11:54:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018108#M427894</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-12-12T11:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018109#M427895</link>
      <description>I am using : &lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;&lt;BR /&gt;do I need to change it to :&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;&lt;BR /&gt;thanks,&lt;BR /&gt;hunki</description>
      <pubDate>Tue, 12 Dec 2006 12:00:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018109#M427895</guid>
      <dc:creator>Hunki</dc:creator>
      <dc:date>2006-12-12T12:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018110#M427896</link>
      <description>export JAVA_HOME=/usr/bin/java ...</description>
      <pubDate>Tue, 12 Dec 2006 12:01:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018110#M427896</guid>
      <dc:creator>Hunki</dc:creator>
      <dc:date>2006-12-12T12:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018111#M427897</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;you need not change this - Solaris has a compatibility link /bin -&amp;gt; /usr/bin&lt;BR /&gt;like HP-UX.&lt;BR /&gt;&lt;BR /&gt;The solution is to change&lt;BR /&gt;export VAR=value&lt;BR /&gt;to&lt;BR /&gt;VAR=value; export VAR&lt;BR /&gt;&lt;BR /&gt;Solaris will call your script at startup NOT via the interpreter in your file but with a hardcoded one NOT being able to parse your original statement.&lt;BR /&gt;&lt;BR /&gt;mfG Peter&lt;BR /&gt;</description>
      <pubDate>Tue, 12 Dec 2006 12:53:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018111#M427897</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-12-12T12:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018112#M427898</link>
      <description>Can you attach your script so that it can be looked at?</description>
      <pubDate>Tue, 12 Dec 2006 17:08:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018112#M427898</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-12-12T17:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018113#M427899</link>
      <description>Okie here is the script ... the requirement has changed a little .&lt;BR /&gt;&lt;BR /&gt;I use this script as :&lt;BR /&gt;&lt;BR /&gt;jboss start&lt;BR /&gt;jboss stop &lt;BR /&gt;&lt;BR /&gt;and I have 2 instances of jboss running here : &lt;BR /&gt;&lt;BR /&gt;default &amp;amp; default2&lt;BR /&gt;&lt;BR /&gt;I want the the script be modified so that I can specify individual instances of JBOSS and start or stop them like this :&lt;BR /&gt;&lt;BR /&gt;jb start default &lt;BR /&gt;jb stop default &lt;BR /&gt;&lt;BR /&gt;OR &lt;BR /&gt;&lt;BR /&gt;jb start default2&lt;BR /&gt;jb stop default2&lt;BR /&gt;&lt;BR /&gt;( default and default2 are mentioned in the script )&lt;BR /&gt;&lt;BR /&gt;Can the script be modified to reflect this requirement while also keeping the startup /stop option open since its startup script. ( I mean $2 ( default etc )  shud be optional and shud not hamper while the jboss is restarted by the system after the reboot )&lt;BR /&gt;&lt;BR /&gt;-----------------------&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;# File:      jboss4.04.server&lt;BR /&gt;#&lt;BR /&gt;# Purpose:   Start/Stop JBoss Application Server&lt;BR /&gt;#&lt;BR /&gt;# Parameter:  start|stop|check&lt;BR /&gt;#&lt;BR /&gt;#&lt;BR /&gt;# Changes:&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;usage() {&lt;BR /&gt; echo "Usage: jboss start|stop" 1&amp;gt;&amp;amp;2&lt;BR /&gt; exit 1&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;#############main############&lt;BR /&gt;&lt;BR /&gt;[ $# -ne 1 ] &amp;amp;&amp;amp; usage&lt;BR /&gt;&lt;BR /&gt;fct=$1&lt;BR /&gt;&lt;BR /&gt;check_running(){&lt;BR /&gt; if [ `ps -u gtaq | grep java | grep -v grep | wc -l` -ne 0 ]; then&lt;BR /&gt;  return 0&lt;BR /&gt; else&lt;BR /&gt;  return 1&lt;BR /&gt; fi&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;### main ###&lt;BR /&gt;case "$fct" in&lt;BR /&gt;start)&lt;BR /&gt; check_running &amp;amp;&amp;amp; echo "JBoss already running!" &amp;amp;&amp;amp; exit 1&lt;BR /&gt; echo "Starting JBoss..."&lt;BR /&gt; su - gtaq -c "nohup /export/home/jack/jboss-4.0.4.GA/bin/run.sh -c default &amp;gt;/dev/null 2&amp;gt;/dev/null &amp;amp;"&lt;BR /&gt; su - gtaq -c "nohup /export/home/jack/jboss-4.0.4.GA/bin/run.sh -c default2_test &amp;gt;/dev/null 2&amp;gt;/dev/null &amp;amp;"&lt;BR /&gt; echo "Server startup may take a while - "&lt;BR /&gt; echo "check logfile /export/home/jack/jboss-4.0.4.GA/server/default/log/server.log for completion"&lt;BR /&gt; echo "check logfile /export/home/jack/jboss-4.0.4.GA/server/default2/log/server.log for completion"&lt;BR /&gt; ;;&lt;BR /&gt;stop)&lt;BR /&gt; su - gtaq -c "/export/home/jack/jboss-4.0.4.GA/bin/shutdown.sh -S default"&lt;BR /&gt; su - gtaq -c "/export/home/jack/jboss-4.0.4.GA/bin/shutdown.sh -S -s jnp://localhost:1201"&lt;BR /&gt; ;;&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 12 Dec 2006 17:41:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018113#M427899</guid>
      <dc:creator>Hunki</dc:creator>
      <dc:date>2006-12-12T17:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018114#M427900</link>
      <description>&lt;!--!*#--&gt;&amp;gt;I want the the script be modified so that I can specify individual instances of &amp;gt;JBOSS and start or stop them like this :&lt;BR /&gt;&lt;BR /&gt;&amp;gt;jb start default &lt;BR /&gt;&amp;gt;jb stop default &lt;BR /&gt;&lt;BR /&gt;&amp;gt;OR &lt;BR /&gt;&lt;BR /&gt;&amp;gt;jb start default2&lt;BR /&gt;&amp;gt;jb stop default2&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Yes you can stop individual instances of the server by using a nested case statement for example:&lt;BR /&gt;&lt;BR /&gt;case "$fct" in&lt;BR /&gt;start)&lt;BR /&gt;  case $2 in&lt;BR /&gt;    default)&lt;BR /&gt;      echo "starting default jboss server"&lt;BR /&gt;      ;;&lt;BR /&gt;    default2)&lt;BR /&gt;      echo "starting default2 jboss server"&lt;BR /&gt;      ;;&lt;BR /&gt;    "")&lt;BR /&gt;      echo "starting all jboss servers..."&lt;BR /&gt;      ;;&lt;BR /&gt;    *)&lt;BR /&gt;      echo "invalid parameter...exiting"&lt;BR /&gt;      exit&lt;BR /&gt;      ;;&lt;BR /&gt;  esac&lt;BR /&gt;  ;;&lt;BR /&gt;stop)&lt;BR /&gt;  case $2 in&lt;BR /&gt;    default)&lt;BR /&gt;      echo "stopping default jboss server"&lt;BR /&gt;      ;;&lt;BR /&gt;    default2)&lt;BR /&gt;      echo "stopping default2 jboss server"&lt;BR /&gt;      ;;&lt;BR /&gt;    "")&lt;BR /&gt;      echo "stopping all jboss servers..."&lt;BR /&gt;      ;;&lt;BR /&gt;    *)&lt;BR /&gt;      echo "invalid parameter...exiting"&lt;BR /&gt;      exit&lt;BR /&gt;      ;;&lt;BR /&gt;  esac&lt;BR /&gt;  ;;&lt;BR /&gt;esac</description>
      <pubDate>Tue, 12 Dec 2006 18:48:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018114#M427900</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-12-12T18:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018115#M427901</link>
      <description>Thanks for replying Sandman !&lt;BR /&gt;&lt;BR /&gt;One more thing by putting in the nested case statements do I hamper the system's ability to start and stop jboss while a rebooting or shutting down the system because for the system there is not $2 here. &lt;BR /&gt;The $2 is for us while restarting JBOSS on the command line. Please correct me if I am wrong.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;hunki</description>
      <pubDate>Tue, 12 Dec 2006 18:57:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018115#M427901</guid>
      <dc:creator>Hunki</dc:creator>
      <dc:date>2006-12-12T18:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018116#M427902</link>
      <description>&amp;gt;One more thing by putting in the nested case statements do I hamper the &amp;gt;system's ability to start and stop jboss while a rebooting or shutting down the &amp;gt;system because for the system there is not $2 here. &lt;BR /&gt;&amp;gt;The $2 is for us while restarting JBOSS on the command line. Please correct &amp;gt;me if I am wrong.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;It will be okay during a reboot since the code below relies on $2 being empty:&lt;BR /&gt;&lt;BR /&gt;"")&lt;BR /&gt;      echo "starting all jboss servers..."&lt;BR /&gt;&lt;BR /&gt;The above code is nested within the start and stop cases. So when the run-level scripts are being executed and there is no $2 parameter on the command line, it will enter the case mentioned above and either start or stop all the jboss servers (assuming you have a start all or stop all jboss servers script).&lt;BR /&gt;&lt;BR /&gt;~cheers</description>
      <pubDate>Tue, 12 Dec 2006 19:26:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018116#M427902</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-12-12T19:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018117#M427903</link>
      <description>You need to tweak the code below otherwise it will error out if you need to start or stop a particular instance of the jboss server.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [ $# -ne 1 ] &amp;amp;&amp;amp; usage&lt;BR /&gt;&lt;BR /&gt;The above statement will cause commands like:&lt;BR /&gt;&lt;BR /&gt;# jboss stop default&lt;BR /&gt;Or&lt;BR /&gt;# jboss start default&lt;BR /&gt;&lt;BR /&gt;to error out&lt;BR /&gt;&lt;BR /&gt;~hope it helps</description>
      <pubDate>Tue, 12 Dec 2006 19:36:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018117#M427903</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-12-12T19:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018118#M427904</link>
      <description>Thanks Sandman , One more question... &lt;BR /&gt;&lt;BR /&gt;I have two boxes on which I need to have this script and I want the same script to work on both boxes , how to achieve this within the case statement u earlier descirbed. Can u pls send me a layout of the case statements with the box names in it.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;hunki</description>
      <pubDate>Tue, 19 Dec 2006 10:59:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018118#M427904</guid>
      <dc:creator>Hunki</dc:creator>
      <dc:date>2006-12-19T10:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018119#M427905</link>
      <description>I found the way to nest the cases for each boxes.</description>
      <pubDate>Tue, 19 Dec 2006 12:35:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/5018119#M427905</guid>
      <dc:creator>Hunki</dc:creator>
      <dc:date>2006-12-19T12:35:41Z</dc:date>
    </item>
  </channel>
</rss>

