[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

Similar Messages

  • Can't run shell script to save my life

    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>();
                    for (String string : processCommands)
                        System.out.print(string + " ");
                    ProcessBuilder processor = new ProcessBuilder();
                    Process ProcessPdf = null;
                    ProcessPdf = processor.start();
                    int exitValue = ProcessPdf.exitValue();
                    System.out.println("Exit Value: " + String.valueOf(exitValue));The input I am working with is:
    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.

  • 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.
    case "$1" in
    /bin/orbd -ORBInitialPort 2600 &
    sleep 5
    /bin/java NamdServer -ORBInitialPort 2600& --------This can not run.
    echo "Server is up."
    echo "Usage: $0 { start | stop }"
    exit 1
    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.

    When you try to execute the NamdServer do you get any output as it tries to start ? or does it fail
    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.

  • 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

  • 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 to run shell script using External Process in Process Flow?

    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.

    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
    /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
    SQL*Plus: Release - Production on Fri Sep 29 22:57:39 2006
    Copyright (c) 1982, 2004, Oracle. All rights reserved.
    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
    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.

  • Can't enter shell scripts in Automator?

    When adding the "Run Shell Script" action to a workflow in Automator, I can't actually type anything in the text box -- when I try to type something, I just get a bunch of seemingly random characters. Does anyone else see the same behaviour or is there just something funky going on with my two Macs?
    I'm certain I'd be able to create a couple of services for encrypting/decrypting messages in Mail with GPG, if only I could actually type the shell script into Automator

    Redemption Code http://helpx.adobe.com/x-productkb/global/redemption-code-help.html

  • 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.

  • Running Shell Script

    Hi all,
    I need to run shell script on one of linux servers while executing some IdM workflow.
    There is no need to manage that server/ provision accounts / reset passwords etc but just to run the script and to process the result.
    I have IdM 8.04 installed on Windows Machine.
    What are my options to achieve that mission?
    Thank You,

    I was considering a situation similar to AD after actions where sometimes we execute a dos batch file for any specific purpose like creating home folder using mkdir. I was thinking on similar lines if your shell script is also for a specifc function similar to the one I mentioned above and if it is applicable in windows environment, you might covert that into a dos batch and do similar to an after action.
    Since you need your shell script to be run in UNIX / LINUX machine, I do not see any other way other than writing a java class and invoke within a wf as it was mentioned by etech or if you are planning on using any of the out of the box resource adapters, the AIX resource adapter reference might help, but I have not worked with that

  • Automator runs shell script differently

    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?
    # connects to network shares if server available
    #config - wich server and mountpoints, login
    #connect-test and create mountfolders
    ping -q -c3 $server > /dev/null
    if [ $? -eq 0 ];then
      if [ -d "/Volumes/"$dir"" ]; then
      echo "folder $dir exists"
      echo "creating folder $dir"
      mkdir "/Volumes/"$dir""
      if [ -d "/Volumes/"$dir2"" ]; then
      echo "folder $dir2 exists"
      echo "creating folder $dir2"
      mkdir "/Volumes/"$dir2""
      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“
      echo „failed to connect to $serverName“

    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

  • 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

  • Run shell script as root on boot

    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?

    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:
    <?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">
    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
    Hope that helps
    Bye Tom

  • Running shell scripts on iPad/iPhone

    I want to know if one can execute a shell script in an iPad/iPhone app.
    I have tried searching but I haven't got an exact answer yet. The general response is negative.
    The simplest example of this would be a script execution on a button click event which will echo "Hello World!".
    I also need to know if there is a way to add a set of commands to the existing set of scripts.
    This can be done on the mac by simply downloading the folder to the hard drive.

    You can do this, but you have to jump through some hoops. The App Store guidelines explicity say that apps that install or launch other executable code will be rejected. Your app can include an embedded interpreter that executes scripts included as resources in your app. You cannot download new scripts because that is explicitly forbidden too. But if you include the scripts in the app, and include an embedded interpreter in the app, you should be fine.

  • 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?


  • Can we call shell script from oracle 9i?

    Hi experts,
    I wanted to know can we call shell script from oracle 9i procedures? If yes,how

    No. I can't think of a way to do this...
    If you want you can use DBMS_SCHEDULER to call OS SHELL scripts within.
    For e.g.
    program_name => 'CHECK_TIME',
    program_type => 'EXECUTABLE',
    program_action => '/opt/oracle/chk_date.sh',
    enabled => TRUE,
    comments => 'Check the Time'
    opt/oracle> cat chk_date.sh
    echo "The date is :`date`"
    schedule_name => 'EVERY_30_MINS',
    repeat_interval => 'FREQ=MINUTELY; INTERVAL=30',
    comments => 'Every 30-mins'
    job_name => 'RUN_CHECK_TIME',
    program_name => 'CHECK_TIME',
    schedule_name => 'EVERY_30_MINS',
    comments => 'Run the program CHECK_TIME every 30 minutes',
    enabled => TRUE
    exec dbms_scheduler.run_job('RUN_CHECK_TIME');

Maybe you are looking for