Solaris 10 command-line argument to /etc/init.d/apache

Does anyone know how to control the command-line argument sent to /etc/init.d/apache that ships with Solaris 10 11/06?
# svcs *\apache\*
shows Solaris is running Apache 1.3 as a legacy service with the FMRI lrc:/etc/rc3_d/S50apache.
According to Sun documenation ("How to Modify a Command-Line Argument for an inetd Controlled Service" <http://docs.sun.com/app/docs/doc/817-1985/6mhm8o5ss?a=view>), one should be able to make desired changes using the inetadm command. The problem is,
# inetadm
doesn't show anything at all related to apache or httpd. I thought about changing the inittab file, but Sun's comments in the file pretty much say "hands off."
I'm trying to have Apache SSL enabled at boot time (i.e. argument startssl instead of start). As a temporary hack, I've edited apachectl so that the "start" argument is processed like "startssl."
Thanks!

tmilbank wrote:
Does anyone know how to control the command-line argument sent to /etc/init.d/apache that ships with Solaris 10 11/06?
# svcs *\apache\*
shows Solaris is running Apache 1.3 as a legacy service with the FMRI lrc:/etc/rc3_d/S50apache.
According to Sun documenation ("How to Modify a Command-Line Argument for an inetd Controlled Service" /etc/rc3 services have nothing to do with inetd.
The script is running from the above file (/etc/rc3.d/S50apache).
That's normally apache 1.x. If you do 'svcs -a', you'll see disabled services as well, which will include the apache 2.x server.
<http://docs.sun.com/app/docs/doc/817-1985/6mhm8o5ss?a=view>), one should be able to make desired changes using the inetadm command. The problem is,
Neither version of apache runs from inetd. Are you interested in apache 1.x or apache 2.x?
Darren

Similar Messages

  • How to hide the command line arguments from solaris process

    Hi All,
    When I execute a JAR application from a java file using the Runtime.getRuntime, the command line arguments (user ID and Password details) which I passed for executing the application displayed on Solaris process (ps -ef).
    Could anybody please help me, how can I hide either the process or the command line arguments from the Solaris process?
    I cannot pass any asterix or any special character in place of password, because the executing application doesn't have any functionality to retreive the password which send as asterix characters.
    Please help me
    SumodeV

    Thanks for all the response.
    I have created a design and implement the functionality which executes the JAR application in Solaris environment without showing any details in the process details.
    I have used the Java Reflection method, which invokes the JAR application. I am sharing the details here for all those who looking for it.
    1, Inside the Customer application [Jar File is running for it], collect the necessary session details [Using System.get property method]
    2, Create an independent Java file, which should be used to invoke the JAR application
    3, Create the ProcessBuilder object and use a command - execute the Java file [a wrapper code] using normal Java command
    4, Pass the necessary session details to the ProcessBuilder using the environment() function.
    5. Collect the environment values in the independent Java file (Which was invoked by ProcessBuilder) and set details for its environment using System.setProperty.
    6, Use reflection technique to invoke the JAR plugin [which you want to run]. You can use the standard Java functionality to read the MANIFEST file of JAR and load the main class using URLClassLoader.
    7, Invoke the main method of the JAR file, which run the JAR application in Solaris window
    This solution will make sure that the process cannot display any session details in the Solaris Environment.
    Note: Use String[] array while create the command. Otherwise the JAR application cannot pop-up.
    Regards
    Sumode

  • Read in file name + path using command line arguments

    Hi guys,
    I am trying to use command line arguments to read in the name of two files. The code below works as long as the files are on the class path.
    public class cmdLineArguments {
         public static void main(String[] args) {
              String xmlFile1 = args[0];
                    String xmlFile2 = args[1];
              System.out.println ("\nXmlFile1: " + args[0] + "\nXmlFile2: " + args[1]);
    }I would like to be able to read files that are not on the class path as well by entering their full path along with their names.
    In other words, It works if I type:
    C:\Documents and Settings\user\workspace\CmdLineArgs\src>java cmdLineArgs file1.xml file2.xmlbut not if I type:
    C:\Documents and Settings\user\workspace\CmdLineArgs\src>java cmdLineArgs c:\Documents and Settings\user\desktop\file1.xml c:\Documents and Settings\user\desktop\file2.xmlWould anyone please explain how I can edit the code to make it work? I guess I could take them both as a String, modify them manually (add a \ to it etc) but is there an easier way to do it? Even a reference to a tutorial, article etc about this would be very much appreciated.
    Also, any idea why a code would compile and run fine in Eclipse but would create an error from command line?
    Thanks a lot.

    You need to learn about cmd.exe which is used to process the command line. The arguments passed to any program is the command line split at white space so your command line arguments of
    c:\Documents and Settings\user\desktop\file1.xml c:\Documents and Settings\user\desktop\file2.xmlis turned into an array of
    "c:\Documents", "and", "Settings\user\desktop\file1.xml", "c:\Documents", "and", "Settings\user\desktop\file2.xml"In other words instead of 2 arguments you actually have 6.
    To get round this the file names need to be quoted
    java cmdLineArgs "c:\Documents and Settings\user\desktop\file1.xml" "c:\Documents and Settings\user\desktop\file2.xml"

  • Filenames as Command Line Arguments: How?

    i need to create a program that involves taking in a file name as command line argument, reads the file and then displays its contents on the screen. it needs to work with any file with a .txt extension.
    The only thing i dont fully understand is how to read the file name as a command line argument e.g.
    "java FileReaderApp myfile.txt
    ----contents of file--------
    Thanks in advance
    Carl
    P.S. I have lready read the various helps, utils etc for java and still dont really understand

    Okay, first, it will help if you don't think of "filenames as command line args." The two concepts are totally independent.
    Command line args are Strings. What you do with those Strings is up to you. Processing the command line args is the same, regardless of whether they represent file names or the turnons of the last 50 playmates.
    The args array below contains the command line args.
    public static void main(String[] args) {
    // do stuff
    } Files are generally referred to using the java.io.File. It takes a String for the file name. It doesn't matter where the String comes from.
    Look at FileReader and BufferedReader to actually read the contents of the file.
    http://java.sun.com/j2se/1.4.2/docs/api/java/io/FileReader.html
    http://java.sun.com/j2se/1.4.2/docs/api/java/io/BufferedReader.html
    For the basic command line arg stuff, one of the following should have some info and examples
    http://java.sun.com/docs/books/tutorial/
    http://java.sun.com/learning/new2java/index.html
    http://javaalmanac.com
    http://www.jguru.com
    http://www.javaranch.com
    Bruce Eckel's Thinking in Java
    Joshua Bloch's Effective Java
    Bert Bates and Kathy Sierra's Head First Java

  • Command line arguments

    Hey there,
    I have a program that uses a command line argument at runtime to get a txt file which is then loaded into my program.
    c:\>java FileName infile.txt
    I want to catch what args[0] is so I can print the file name the user entered to the screen when the program is running(so grab the infile.txt). Does anyone know what object I use to do this? Have I made sense?
    Thanks
    Dave

    Yeah I didn't realise I could use args[] like a string
    (first time using args you see....)
    but in my print statement I put ("Reading " ++
    args[0]) ionstead of
    ("Reading " + args[0])
    amazing the smallest thing the greatest stress :)You're not using "args" like a string
    this code:
    class EchoArgs{
    public static void main(String[] args)
    //args is a String array.
    for(int j=0; j<args.length;j++)
        System.out.println("args["+j+"] is:"+args[j]);
    }Would simply echo each arg on its own line back...
    But either way...all args passed from the Command line ARE strings.
    (arg[0] is the first string of the string array, etc..)
    Good ,luck,
    Dave

  • How to Pass Command line arguments to an exe created in LV8.0

    Hi Friends,
    I have Created an exe in LV8.0, which accepts the Folder path as input and executes.
    I want to call this exe passing the parameter (i.e folder path in my case)  from the command line argument. How to pass arguments to the exe ?
    Generally we may be having different types of input parameters to a vi like numeric control, string, boolean etc..If we create an exe that needs three input parameters among which one is boolean, other is string and third is a numeric value.
    How to pass these different types of input controls to the exe as parameters in command line at the same time?
    Thanks and Regards,
    SODLB

    I don't have any experience with the 8.x application builder, but the 7.x one has a checkbox for passing the arguments to the executable.
    As for reading them, there should be an example in the example finder (Help>>Find Examples) which shows how to do this. If you want to pass multiple parameters, I suggest you use a structure similar to NAME=VALUE, so that you can parse each element to find the = and then use a case structure to decide what to do with the parameters. This allows your users to enter or not enter any of the switches.
    Try to take over the world!

  • How to pass command line arguments to Web Start appclient?

    Hi,
    I would like to pass arguments to appclient, but "javaws" unable to do that.
    Do I have to overwrite the JNLP? I use Sun Appserver 9.0, it creates JNLP on the fly!!!
    Please help, thanx!
    MB

    Hi, MB.
    If you are talking about the automatic Java Web Start support for launching app clients in GlassFish, you can pass the equivalent of command line arguments using the query string of the URL you use to launch the app client.
    Briefly, use
    http://host:port/client-path?arg=first-arg&arg=second-arg& ...
    specifying the argument values in the order that you want them passed to the client.
    The GlassFish server will do the right thing and generates the correct JNLP so your arguments are passed to the app client.
    The GlassFish developer's guide http://glassfish.dev.java.net/nonav/javaee5/docs/AS91DG.pdf discusses this and all aspects of the Java Web Start support. You can also take a look at this blog entry http://blogs.sun.com/quinn/entry/command_line_arguments_and_properties that focuses on how to pass arguments.
    Since this technique deals with argument passing in the URL, it works no matter how you launch the app client: a URL in a browser, the javaws command, etc.
    - Tim

  • How to pass command line arguments to JWS app

    Hi,
    I want to pass command line arguments to my JWS application. However those arguments are dynamic (eg the username of the user who launched the app) and thus I can not use the argument tag of JNLP file. So what do I need to do in this case?
    Thanks.

    Well, if it's the username on your server systems you should probably include it in the jnlp: can pass it in the url, write once and remove jnlp href attribute, etc.., etc.. (a quick tour of this forum should suffice).
    If it's the OS username you should be able to retrieve it through system properties.
    Whatever it is, passing dynamic arguments means launching javaws through a shell or a shell script (bat if running on windows), so you won't be able to launch through autogenerated desktop and menu shortcuts.
    Anyway, you have two solutions:
    Clean one: associate an extension to your app and write those infos in a file named after that extension.
    Dirty one (always seen it work, but there's no warranty): javaws -open whateverParamYouLike yourAppURL.jnlp, will pass to your main method '-open' as args[0] and '+whateverParamYouLike+' as args[1]. I gotta admin I used it, but I had the most peculiar reason (my app needed another instance on a different JRE aware of being a secondary instance at startup time).
    Bye.
    PS: I'd really love dukes ;-)

  • Help with char and command line arguments

    I am writing a program that takes 2 command line arguments (such as 4 b, or 3 4, etc.). It uses the first argument to determine the height of a triangle (how many rows high), and the second is the character with which the triangle is drawn.
    My problem is I tend to code backwards - go for the bigger part and then figure out the smaller things. So, I've written a program that prints out this triangle, BUT I can't figure out how to get the command line arguments into it properly. A number works fine because I can:
    size = Integer.parseInt(args[0]);
    but what do I do if the second argument is a character? Args is a String array (I've been fighting with it for the past 4 hours, so I KNOW its a String array) - so how can I get a char to be read as args[1]?
    Here is my code before adding in the second argument (the char):
    public class Triangle
    public static final void main(String[] args)
    int size;
    if (args.length > 0)
    try
    size = Integer.parseInt(args[0]);
    catch(NumberFormatException e)
    System.out.println("Input Error");
    createFilledTriangle(size);
    System.out.println();
    public static void createFilledTriangle(int size)
    int i = 0;
    int j = 0;
    for(i = size, j = 1; i > 0; i--, j +=2)
    printChar(" ", i);
    printChar("*", j); <-----Instead of using * I want to use the second command line arg
    System.out.println();
    private static void printChar(String str, int total)
    for(int i = 0, i < total; i++)
    if(i%2 == 1)
    System.out.print(str);
    else
    System.out.print(" ");
    Thank you for any help in advance!

    I was sure i send it the other day, i probably send it to the wron guy.
    This will give you more idea about drawing.
    import java.awt.*;
    import java.awt.event.*;
    public class Args extends Frame
         Panel panel = new Tpan();
         int   arg1;
         char  arg2;
    public Args(int a1, char a2) 
         super();
         arg1 = a1;
         arg2 = a2;
         setBounds(1,1,600,400);     
         setLayout(new BorderLayout());
         addWindowListener(new WindowAdapter()
         {     public void windowClosing(WindowEvent ev)
              {     dispose();
                   System.exit(0);
         add("Center",panel);
         setVisible(true);     
    public class Tpan extends Panel
    public Tpan()
    public void paint(Graphics g)
         super.paint(g);
         g.setColor(Color.blue);
         g.drawLine(120,110-arg1,80,110);
         g.drawLine(120,110-arg1,160,110);
         g.drawLine(80,110,160,110);
         g.setColor(Color.red);
         g.drawLine(120,110-arg1,120,110);
         g.setColor(Color.black);
         g.drawString(""+arg2,116,110-arg1/2+10);
    public static void main (String[] args) throws InterruptedException
    // get the 2 arguments from the args insread of a1= , a2=
         int  a1  = 60;
         char a2 = 'a';
         new Args(a1,a2);
    Noah
    import java.awt.*;
    import java.awt.event.*;
    public class Args extends Frame
         Panel panel = new Tpan();
         int arg1;
         char arg2;
    public Args(int a1, char a2)
         super();
         arg1 = a1;
         arg2 = a2;
         setBounds(1,1,600,400);     
         setLayout(new BorderLayout());
         addWindowListener(new WindowAdapter()
         {     public void windowClosing(WindowEvent ev)
              {     dispose();
                   System.exit(0);
         add("Center",panel);
         setVisible(true);     
    public class Tpan extends Panel
    public Tpan()
    public void paint(Graphics g)
         super.paint(g);
         g.setColor(Color.blue);
         g.drawLine(120,110-arg1,80,110);
         g.drawLine(120,110-arg1,160,110);
         g.drawLine(80,110,160,110);
         g.setColor(Color.red);
         g.drawLine(120,110-arg1,120,110);
         g.setColor(Color.black);
         g.drawString(""+arg2,116,110-arg1/2+10);
    public static void main (String[] args) throws InterruptedException
    // get the 2 arguments from the args insread of a1= , a2=
         int a1 = 60;
         char a2 = 'a';
         new Args(a1,a2);

  • Need Help with command line arguments for a class method

    Hey guys,
    I'm fairly new to programming in java.
    I want to a write a class method that adds up its command line arguments which are numbers. For example, if the input was .... 5 2 3....then the output would be 10.
    I have been told to use the Convert to convert a string to a double. I'm ok for writing the class method but I have no idea how to use Convert and why I need it in the method.
    Can anybody help please?

    Hey guys,
    I'm fairly new to programming in java.
    I want to a write a class method that adds up its
    command line arguments which are numbers. For
    example, if the input was .... 5 2 3....then the
    output would be 10.Okay. So you would receive the numbers to add as the String[] argument to a main method. The steps are simple:
    1) declare a variable for the count
    2) for each String in the array:
    2.1) extract the value as a double
    2.2) add this to the count
    3) output the resulting count
    I have been told to use the Convert to convert a
    string to a double.
    I'm ok for writing the class
    method but I have no idea how to use ConvertThere is no class Convert in the Java API.
    and why
    I need it in the method. Do you understand you need to somehow convert each String to a double (step 2.1)? Since Convert is unknown to me, maybe you should just take a look at class Double. It can help you do step 2.1, the rest should be trivial enough.
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Double.html
    Give it a go and feel free to post back with a specific problem you are having, accurately described if you please :-)

  • Error while running aiaconfig.sh - The command line argument(s) "weblogicConfig"

    Hi.
    We are Configuring PIP on AIA 11.1.1.7 after installing AIA PIP release. we we run ./aiaconfig.sh we are getting below error message,
    $./aiaconfig.sh
    Starting Oracle Universal Installer...
    Checking swap space: must be greater than 500 MB.   Actual 169130 MB    Passed
    Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed
    Preparing to launch Oracle Universal Installer from /tmp/OraInstall2013-11-20_04-11-10AM. Please wait ...adevaia                                                        @soa-odi-dev1:/u02/app/Oracle/Middleware/AIAHOME/bin$ [WARN ][jrockit] MaxPermSize=256m ignored: Not a valid opt                                                        ion for JRockit
    Log: /u01/app/oraInventory/logs/install2013-11-20_04-11-10AM.log
    The command line argument(s) "weblogicConfig" or the install mode specified is not valid.
    Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
    Usage:
    config.sh [-mode] [-options] [(<CommandLineVariable=Value>)*]
    Where mode include:
    [Mode is a mandatory parameter. Only one mode can be specified.]
         -silent For silent mode operations, the inputs can be a response file or a list of
                  command line variable value pairs.
    Where options include:
         -help, --help, --usage
                  Displays above usage.
         -invPtrLoc <inventory pointer file>
                  Launches the installer with a custom inventory location. The invPtrLoc
                  should point to a file which contains the following information.
                  inventory_loc=<inventory_location>
                  inst_group=<group_name>
         -response, -responseFile <response file>
                  Specifies the response file and path to use.
         -jreLoc <location>
                  Path where Java Runtime Environment is installed. OUI cannot be run without
                  it.
         -logLevel <level>
                  To filter log messages that have a lesser priority level than <level>.
                  Valid options are: severe, warning, info, config, fine, finer, finest,
                  basic, general, detailed, trace. The use of basic, general, detailed, trace
                  is deprecated.
         -debug  For getting the debug information from OUI.
         -force  Allowing silent mode installation into a non-empty directory.
         -printdiskusage
                  Log debug information for disk usage.
         -printmemory
                  Path where Java Runtime Environment is installed. OUI cannot be run without
                  it.
         -printtime
                  Log debug information for time usage.
         -waitforcompletion
                  For windows. setup.exe will wait for completion instead of spawning the
                  java engine and exiting.
         -noconsole
                  For suppressing display of messages to console. Console is not allocated.
         -ignoreSysPrereqs
                  For ignoring the results of the system pre-requisite checks.
         -executeSysPrereqs
                  Execute system pre-requisite checks and exit.
         -paramFile <location of file>
                  Specify location of oraparam.ini file to be used by OUI.
         -novalidation
                  Disables the validations, can be invoked along with GUI or silent mode.
         -nodefaultinput
                  Disables the default computation of values (pre-populating of values when
                  screen is loaded) in GUI install.
         -nocheckForUpdates
                  To disable all updates checking
         -updatesDir
                  To specify the directory where latest updates are downloaded. This could be
                  used in disconnected mode.
    Command Line Variables Usage:
              Command line variables are specified using <name=value>; for example:
                  [ session: | session:compName: | session:compName:version: ]variableName=" valueOfVariable"]
              Installer variables are specified using:
                  varName=value
                  Ex: ORACLE_HOME=<value>
              OUI Session variables are specified using:
                  session:varName=value
                  Ex: session:VARIABLE_NAME=<value>
              OUI Component variables are specified using:
                  session:compInternalName:[Version:]varName
                  Ex 1: session:oracle.comp1:1.0.1:varName=<value>
                  Ex 2: session:oracle.comp1:varName=<value>
                  The lookup order is compInternalName:Version:varName, then compInternalName:varName
    do anyone had any idea on this.
    Thanks a lot,
    RR.

    try checking relevant environment variables like the CLASSPATH.... a major source of failures in Windows is when in the classpath there is a path containing SPACES.... also enabling some "debug" or "verbose" flag (not sure how to do it) would provide more insight...

  • How to run command line argument programe

    Hi guys, I am doing pass command line argument programe in java but I don't know how to run this programe. Path for this programe in my my computer is C:\Users\Desktop\Mainjava\mycode\CommandProgjava*
    {code/}
    public class CommandProg
    public static void main(String[] args)
    System.out.println("d");
    for (int i = 0; i < args.length; i++)
    System.out.println(args);
    {code/}
    Where i need to go and what command i need to give so i can execute this programe(I am using window vista). I only know i have to give
    this command some where CommandProg arg1 arg2 arg3 arg4. Output should be
    Output:
    arg1
    arg2
    arg3
    arg4
    Please help me, Thanks in advance.
    Edited by: JayVirk on Dec 30, 2007 11:33 AM

    Jay,
    Your question isn't very clear, hence Joerg's well meaning but irrelevant advise.
    Do you mean:
    I've written a simple program in java which echos
    it's command-line arguments to back to the console.
    Here's my code:
    package forums;
    public class ArgsEchoer
      public static void main(String[] args) {
        for (String arg : args) {
          System.out.println(arg);
    But can't figure out how to compile and run the program.
    I'm using winblows shista, and it's cr@p.
    Please help me, Thanks in advance.So... where are you at? Have you installed the JDK (java development kit)? Which version? Is your path set? Is your classpath set?
    Start here: http://java.sun.com/developer/onlineTraining/new2java/

  • Error message: "invalid command line argument" while lodaing itunes

    I'm trying to load Itunes onto a computer that already has a version of itunes on it. I get a message that says "error: -1639 invalid command line argument" Does anyone know what this means? Does this mean I can't load itunes onto a computer that already has itunes on it?
    Also, I was able to load itunes on my laptop, but My ipod Icon is not appearing anywhere, not in itunes, not in explorer, not in my computer. I am, however, able to transfer music automatically when I plug the Ipod into the laptop. I have created several playlists and they have transferred over to the ipod as playlists. Any ideas why I can transfer despite not being recognized anywhere on the computer?
    Last thing is, I have plugged the Ipod into three different computers with itunes on them, and the ipod does not show up in the source list.
    I'm somewhat perplexed by all of this. Any help or insight would be greatly appreciated
    Dell   Windows XP Pro  

    hiya!
    "error: -1639 invalid command line argument"
    hmmm. folks typically only get that error if they are installing from removable media (such as a CD), although i have seen it happen if someone tries to install into the "recovery partition" of certain makes of PC.
    if you download and save an installer to your C drive and run the install from there, do you still get the 1639?
    iTunes 6.0.4.2 Installer
    love, b

  • Sending varargs via command line arguments to main()

    When I put A B C D in the command line arguments textbox in my compiler, the output is as expected: A B C D. However, when I put *new String[]{A, B, C, D}*, the output is *new String[]{A, B, C, D}*, not A B C D as I had expected. My code is below. Any suggestions?
    package varargs;
    public class Varargs {
        static void printArray(Object...args){
            for (Object obj : args)
                System.out.print(obj + " ");
            System.out.println();
        public static void main(String...args) {
            printArray((Object[])args);
    }

    The argument(s) that is/are supplied to your main method will be rendered as literal String constants. It looks like you are attempting to use java code as one of your arguments with the expectation that the program will interpret this code. It won't. Your program will simply display whatever it is given even if what you offer as an argument happens to be a construct of the Java language.

  • Sending Command Line Arguments to Jar Executable

    Hi All
    I wish to send Command Line Arguments to Jar Executable.
    i.e. before I Jar'd my program, I would do the following
    public class CmdLnArgmntExp {
    public static void main(String[] args) {
    System.out.println("d");
    for (int i = 0; i < args.length; i++)
    System.out.println(args);
    Running the program in Console.
    Java CmdLnArgmntExp arg1 arg2 arg3 arg4Output:
    arg1
    arg2
    arg3
    arg4
    How would I do this to a Jar executable, hope that made sense
    Thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    java -jar executable-jar-file-containing-class-CmdLnArgmntExp.jar arg1 arg2 arg3 arg4

Maybe you are looking for