Can not run shell script

Hello firends,
I have one simple script to run orbd and one java program: I can not this script on RH linux.
#!/sbin/sh
case "$1" in
'start')
/bin/orbd -ORBInitialPort 2600 &
sleep 5
/bin/java NamdServer -ORBInitialPort 2600& --------This can not run.
echo "Server is up."
'stop')
echo "Usage: $0 { start | stop }"
exit 1
esac
exit 0
I cound not see the process of "java NamdServer" using ps -lef after run this script. I also tried the following option with -classpath, it did not work either.
java -classpath /disk/programs/namd_server_sparc/:. NamdServer -ORBInitialPort 2600
java -classpath . NamdServer -ORBInitialPort 2600
Thanks a lot.

Hi
When you try to execute the NamdServer do you get any output as it tries to start ? or does it fail
silently?
You might need to try and find out if you can run NamdServer in a verbose mode where it tells you whats its
trying to do.
Alternately. you can use the truss command ( man truss to find out more ) on your script.
regards

Similar Messages

  • Can't run shell script to save my life

    Hello,
    I have a shell script which I need Java to start. When I pass the parameters in Java I get an exit value of 2. I never set an exit/error value of 2 in my code. What is even more strange, is that when I run the exact same strings I use in the processCommands array, the shell script starts and complete just fine. I have even tried commenting out getting the exitValue just in case my little script wasn't completely done.
    Here is the code.
                    ArrayList<String> processCommands = new ArrayList<String>();
                    processCommands.add(processorString);
                    processCommands.add(dropboxString);
                    processCommands.add(name);
                    for (String string : processCommands)
                        System.out.print(string + " ");
                    System.out.println("");
                    ProcessBuilder processor = new ProcessBuilder();
                    processor.command(processCommands);
                    Process ProcessPdf = null;
                    ProcessPdf = processor.start();
                    ProcessPdf.waitFor();
                    int exitValue = ProcessPdf.exitValue();
                    System.out.println("Exit Value: " + String.valueOf(exitValue));The input I am working with is:
    //home//adynammic//userfiles//demo//dropbox//process.sh
    //home//adynammic//userfiles//demo//dropbox
    s5.pdf
    The shell script even runs from the command line with all the extra slashes. I am running an Ubuntu system if that helps.
    Your help is greatly appreciated,
    Chem E

    There are a number of things that can be going wrong.
    First, get rid of the extra slashes. They're probably not causing a problem, but there's no need for them, and we might as well eliminate that variable.
    Is that shell script executable by the user that's running your Java code?
    Does the shell script start with a line like
    #!/bin/shwhere /bin/sh is the full path to a valid shell such as bash, zsh, tcsh, etc.?
    Is that shell listed in /etc/shells?
    (Yes, I know, since it works from the command line, this stuff shouldn't be an issue, but, again, let's eliminate variables, just to be sure.)
    Does that script assume some environment variables or pwd that might not be present when running from your Java code?
    Which of those 3 commands gives the exit status of 2? Start with just one of them, and don't add the others until you get that one working.

  • Automator/Applescript not running shell script properly

    I can open Terminal, and this command works:
    lame -h --abr 256 /Users/myhome/Desktop/Some\ Wav\ File.wav /Users/myhome/Desktop/TheMP3.mp3
    But when I try to run the same command in applescript from Automator, it fails.
    set sourceFile to quoted form of POSIX path of "/Users/myhome/Desktop/Some Wav File.wav"
    set mp3File to quoted form of POSIX path of "/Users/myhome/Desktop/TheMP3.mp3"
    set command to "lame -h --abr 256 " & sourceFile & " " & mp3File
    display dialog command
    do shell script command
    The display dialog outputs:
    lame -h --abr 256 '/Users/myhome/Desktop/Some Wav File.wav' '/Users/myhome/Desktop/TheMP3.mp3'
    Which, as little as I know of applescript, is how applescript handles spaces in filesnames. Can anyone please help?

    You need *do shell script* attribute described in the 10.4 Changes section of http://developer.apple.com/mac/library/releasenotes/AppleScript/RN-AppleScript/R N-104/RN-10_4.html#//appleref/doc/uid/TP40000982-CH104-SW1 Additional info can be gained by posting to the AppleScript and Unix forums under OS X Technologies.

  • [Solved] Installed grsecurity, can't run shell scripts. :|

    Fixed, it was TPE.
    For anyone else with this issue, either add your users to the TPE trusted group, or disable TPE altogether.
    https://wiki.gentoo.org/wiki/Hardened/G … _Execution
    Last edited by TheReverend403 (2014-04-14 13:05:28)

    Please remember to mark the thread as solved https://bbs.archlinux.org/viewtopic.php?id=130309

  • Automator - Run Shell Script - Does not return when script launches firefox

    Automator does not work the same on my MacBooks as my Mac mini! Both are latest Snow Leopard. I'm trying to automatically setup my MacBook after it decides if I'm at work, or elsewhere.
    The Automator Action "Run Shell Script" (Shell: /usr/bin/perl) does NOT return control when attempting to launch Firefox:
    system("/Application/Firefix.app/Contents/MacOS/firefox-bin -private news.google.com &");
    Note: the ampersand should cause Firefox to start as a background process.
    It only returns control after I close Firefox. I have a "Show Growl Notification" as the second action, so I know that the first action has not completed. Odd thing is that this works on my Mac mini. I also noticed that another difference: on my MacBook status is displayed in the top toolbar when the Automator application is running.
    Any ideas?

    Thanks, it worked. I forgot about stderr and stdin.
    I'm using Perl as it is part of a bigger script. I can quickly and easily figure out if I am at work where my MacBook is plugged into a network:
    my $ethernet = qx(ifconfig en0) =~ m{status:.active}xms;
    if ($ethernet) {
    # setup stuff for work environment
    } else {
    # setup stuff for mobile environment
    }

  • Can not run the calc scripts by mxl, if the first character is Number

    I found that if you create the calc scrpt like 1abc.csc. You can not run it by mxl. I tried for times but do not know the reason for that. I found that you can use number in the name of the calc scripts(like abc1.csc, a1bc.csc), but not for the first character(like 1abc.csc).
    Below is my mxl scripts:
    ×××××××××××××××××××××××××××××××××××
    login admin identified by password on localhost;
    spool on to 'C:\abc.log' ;
    execute calculation sample.basic.1abc;
    spool off;
    logout;
    ×××××××××××××××××××××××××××××××××××
    I write a bat file below:
    ×××××××××××××××××××××××××××××××××××
    D:\Hyperion\AnalyticServices\bin\essmsh C:\abc.mxl
    ×××××××××××××××××××××××××××××××××××
    I can run the scripts if I change the name "1abc" to "abc1"or "a1bc".
    Of course I can run this calc in EAS, no matter the name is "1abc" or "abc1".
    Anybody find the same problem with me?

    I agree, if ever there was a "best practice" to developing scripts (especially when using variables) it is to enclose in single quotes. I actually use double quote, single quote.
    execute calculation "'$4'"."'$5'"."'$6'";

  • Can't add "Run Shell Script" in Automator

    When I drag "Run Shell Script" to the right pane in Automator nothing happens. All other applications I've tried can be dragged to the right pane. In the system.log I can find the following message:
    Feb  7 16:56:48 Bananaboat Automator[195]: Error : -[AMWorkflowView _addAction:Kör kommandotolksskript] : * -[NSTextView replaceCharactersInRange:withString:]: nil NSString given.
    "Kör kommandotolksskript" is "Run Shell Script" in Swedish.
    Any ideas how to fix this?

    You might have a corrupted file in the action, in which case you could reload it with something like Pacifist. You can't get the digest of a directory, so for comparison, compressing a copy of /System/Library/Automator/Run Shell Script.action on my desktop gives me the following:
    sha1 digest: c209b69777f6a3301d72ddf0eb0ad4e7d4230741
    md5 digest: 09e4ade9056ada3294ffb93bd16de1a7

  • How to run shell script using External Process in Process Flow?

    Hi,
    We can run external process using Process flow.
    I would like to run shell script as external process in Process flow.
    Could any one please explain it?
    Thanks and regards
    Gowtham Sen.

    HI,
    As you said I tried this case. I got the following error. The script is running successfully while I tested at unix command prompt.
    The error is as follows..
    tarting Execution PFPS_SMPL_RUNSHELL
    Starting Task PFPS_SMPL_RUNSHELL
    Starting Task PFPS_SMPL_RUNSHELL:EXTERNALPROCESS
    /SOURCE_FILES/CollectFiles.sh: line 1: ls: command not found
    /SOURCE_FILES/CollectFiles.sh: line 1: wc: command not found
    /SOURCE_FILES/CollectFiles.sh: line 1: ls: command not found
    Completing Task PFPS_SMPL_RUNSHELL:EXTERNALPROCESS
    Starting Task PFPS_SMPL_RUNSHELL:EXTERNALPROCESS_1
    SQL*Plus: Release 10.1.0.2.0 - Production on Fri Sep 29 22:57:39 2006
    Copyright (c) 1982, 2004, Oracle. All rights reserved.
    ERROR:
    ORA-12545: Connect failed because target host or object does not exist
    Enter user-name: SP2-0306: Invalid option.
    Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
    where <logon> ::= <username>[<password>][@<connect_identifier>] | /
    Enter user-name: SP2-0306: Invalid option.
    Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
    where <logon> ::= <username>[<password>][@<connect_identifier>] | /
    SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
    Completing Task PFPS_SMPL_RUNSHELL:EXTERNALPROCESS_1
    Completing Task PFPS_SMPL_RUNSHELL
    Completing Execution PFPS_SMPL_RUNSHELL
    My scenario is---
    I am trying to return a file name from one shell script. I created a external process for that. After completion of this process, I am running another script which takes that file name and trying to create a external table. The both scripts are runnning successfully. But while I am trying to run using process flow, its not coming.
    And I am not getting the way to catch the output of external process and pass it as parameter as another external process.
    Any suggestions are welcome.
    Thanks and regards
    Gowtham Sen.

  • Trouble using Run Shell Script with python in Automator

    Hi. I have a python script I want to run in Automator (update_puzzles.py). All it does is check, rearrange and update files and there is not supposed to be any input. I can get the script to run outside of Automator, in Terminal, by navigating to the right directory and typing "python update_puzzles.py"
    I must not be setting up Run Shell Script correctly. I have it set to /bin/bash and Pass Input to stdin. The command line simply reads python /pathname/update_puzzles.py (where pathname is the path to the .py file, which I got by dragging the file onto the Run Shell Script command window). There are no actions before this in my workflow and the action after is View Results.
    The log says Run Shell Script failed, and the error is "Traceback (most recent call last):"
    Any suggestions?
    Thanks so much.

    If the script is expecting to do stuff with files in the same directory as the executable, you will probably need to add a statement to change to the appropriate working directory. The shell used in the Automator *Run Shell Script* action is a generic one that does not share any of the environment variables that the Terminal uses.

  • Automator runs shell script differently

    hi
    i build a little shell script that mounts my network-shares when they are available - that's works perfect if run by terminal but if i run it via Automator-Run shell script it does ******** - it doesn't seem to recognize my variables and creates dirs like $“Data“  instead of just Data
    can anyone help me with that?
    #!/bin/bash
    # connects to network shares if server available
    #config - wich server and mountpoints, login
    server=$"192.168.2.1"
    serverName=$"NAS(AFP)"
    dir=$“Data“
    dir2=$“Data1“
    login=$“xxx“
    pw=$“xxx“
    #connect-test and create mountfolders
    ping -q -c3 $server > /dev/null
    if [ $? -eq 0 ];then
      if [ -d "/Volumes/"$dir"" ]; then
      echo "folder $dir exists"
      else
      echo "creating folder $dir"
      mkdir "/Volumes/"$dir""
      fi
      if [ -d "/Volumes/"$dir2"" ]; then
      echo "folder $dir2 exists"
      else
      echo "creating folder $dir2"
      mkdir "/Volumes/"$dir2""
      fi
    #mount
      mount_afp "afp://"$login":"$pw"@"$serverName"._afpovertcp._tcp.local/"$dir"" "/Volumes/"$dir""
      mount_afp "afp://"$login":"$pw"@"$serverName"._afpovertcp._tcp.local/"$dir2"" "/Volumes/"$dir2""
      echo „ping ok“
    else
      echo „failed to connect to $serverName“
    fi

    FYI.  If you create an Alias of a mounted volume, the Alias will record all the connection information, except the password.  If your keychain is not locked, then when double clicking on the Alias, it will get the password from the keychain and mount the networked volumes (assumes you allowed the password to be stored in the keychain when you first mounted the volumes interactively).
    The Aliases can be put into your System Preferences -> Users & Groups -> Startup Items if you like.
    If this is a laptop and you are re-mounting the volumes when you get to a specific location, you might want to look at ControlPlane
    <http://www.macupdate.com/app/mac/39644/controlplane>

  • Run shell script as root on boot

    Hi!
    I have the need to run a shell script on boot up as root.
    It will not run as any other user because the software that the shell script runs requires root permissions, and I don't use my computer as root. I can't run it at login and use sudo because it would ask for a password and hang.
    How can I have the shell script auto-run at boot (or login) as root?
    Thanks
    Ross

    Hi,
    first of all you can store your shell script anywhere on your system, I prefere the location /usr/local/scripts (this doesn't exist by default).
    Second you have to create a LaunchDeamon script in /Library/LaunchDeamons which execute your shell script at boot as root.
    An example:
    -------------------------snip------------------------
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST
    1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>YOURIDENTIFIERNAME</string>
    <key>ProgramArguments</key>
    <array>
    <string>/usr/local/scripts/YOUR_SCRIPT.sh</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>UserName</key>
    <string>ROOT</string>
    <key>GroupName</key>
    <string>WHEEL</string>
    </dict>
    </plist>
    -------------------------snap------------------------
    http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPSystemS tartup/Articles/LaunchOnDemandDaemons.html
    To run a script as root during a user login you can configure a LoginHook. To create a LoginHook login as the relating user and type the following commad:
    sudo defaults write com.apple.loginwindow LoginHook /Path/To/Your/Script
    http://support.apple.com/kb/HT2420
    Hope that helps
    Bye Tom

  • Run Shell Script: Interaction?

    I use a shell script to build and edit blog articles.
    It's quite clever when on the local server where the files end up. A simple routine of building a .php file, then it launches Vim on the file it created, I make some edits to it (add the content), then save and exit Vim.
    That is it. When done on the local server, this is perfect. However, with my new upgrade to Tiger, I wanted to try using Automator to do some of this as well as the image copy and conversions which I typically do beforehand.
    The Workflow I have so far actually works but the SCRIPT part is messing with me.
    I need to have Automator launch the script in a Terminal window so I can interact with the steps it goes thru. Essentially, the launch of Vim in the Terminal opening the file that was made.
    I can't figure out how to do this. Terminal is not an app in the left pane of Automator, and when I call my script using "Run Shell Script", it does not perform the last step, "vi filename.php" - rather it completes and leaves my "Stencil" un-edited.
    How can I get this done?
    Beavis2084

    http://discussions.apple.com/message.jspa?messageID=1791477#1791477

  • Apple Automator - Run Shell Script Application

    Morning, hope somebody can point of my error please.
    I'm attempting to create an Application wrapper for a minecraft server.
    I've done the following
    Automator > Application
    I've dragged in 'Run Shell Script'
    The Shell dropdown is '/bin/bash'
    The Pass input is 'as arguments'
    In the script I have '
    cd /Volumes/3Tb/Bukkit_live
    /usr/bin/java -Xmx2G -jar /Volumes/3Tb/Bukkit_live/minecraft_server.jar nogui
    Now when I run it through the automator app, it works fine, the server starts, however when I try and run it as a standalone application it does nothing ?
    Please help.
    Thanks in advance.
    Darren

    Best guess is that there is an environment variable in your Terminal session that does not exist when you are running an Automator workflow.
    You could try running an Automator workflow that does Run Shell Script with something like
    ( pwd
      id -a
      echo $#
      echo "$@"
      printenv
    ) >/tmp/automator.environment.txt
    Then do 2 things.  Run it within Automator and copy the /tmp/automator.environment.txt file someplace safe.  Next save it as an Automator app and run it that way.  Compare the 2 automator.environment.txt files and see if anything significant is different between the 2.
    This is just a guess (an educated guess, as this sort of thing has happened to others in the past when they see a difference between running a script interactively and running it as an embedded app).

  • Cannot add "Run shell script" to workflow

    Just like the subject says on an iBook G4, OS X 10.4.8. The previous solution of deleting the Automator cache file in ~/Library did not work for me. The console log does show an error when I attempt to drag Run Shell Script to the workflow error:
    2006-11-25 21:15:32.909 Automator[545] * -[NSTextView replaceCharactersInRange:withString:]: nil NSString given.
    I do have an updated bash installed using DarwinPorts, however that is installed to /opt/local/bin, which appears in my path before /usr/bin. This isn't causing problems on my cube, though.
    Any ideas?

    You might have a corrupted file in the action, in which case you could reload it with something like Pacifist. You can't get the digest of a directory, so for comparison, compressing a copy of /System/Library/Automator/Run Shell Script.action on my desktop gives me the following:
    sha1 digest: c209b69777f6a3301d72ddf0eb0ad4e7d4230741
    md5 digest: 09e4ade9056ada3294ffb93bd16de1a7

  • How can i run unix script from my apex page

    how can i run unix script from my apex page and take the output of unix script as a hidden variable and display it on the report region of that page

    I had a requirement to run a Fortran program against some data that woudl be extracted from the database after the user set up their filtering criteria and made some additional input. SInce the program was to complex to conver to PL/SQL, we decided to try and invoke it from Apex. This is how I did it.
    1. I followed the steps in Tim Archer's excellent article "Oracle External Procedure to Run Host Commands" (http://www.timarcher.com/?q=node/9). If the link does nto work, google the article's title.
    Using this steps I created a function which accepts any OS command, including calling my own shell scripts, and runs them. I called my PL/SQL function "shell" instead of "USF_RUN_HOST_CMD " as Tim did in his example (step 9).
    2. In Apex,
    a. I created a button to run my shell command. (I named it P2_RUN_SHELL)
    b. I created a PL/SQL process whose source looks as follows:
    shell('/home/ackness/scripts/cr_xcf_file.sh > /tmp/cr_scfp_file.log');
    and which was conditioned on the the button P2_RUN_SHELL.
    It works like a charm.
    Note: since you can run your own scripts using this method, you can encapsulate a series of commands in a UNIX shell script and invoke that script from Apex. This allows you to be able to test or run you commands from the command line as well as Apex and makes it easier to develop/debug/enhance the scripts in the future.
    Ackness

Maybe you are looking for