Something incorrect in shell path/syntax - shell

I'm trying to instal Extension:Scribuntu, but when I try to run simple command, like #invoke I get the error:
Lua error: Internal error: The interpreter exited with status 127.
This is what I found in error logfile:
sh: /var/lib/php-exec//sh /alt/home/webmaster.plast/html/Wiki/extensions/Scribunto/engines/LuaStandalone/lua_ulimit.sh 7 8 51200 \\/alt/home/webmaster.plast/html/Wiki/extensions/Scribunto/engines/LuaStandalone/binaries/lua5_1_5_linux_64_generic/lua\: No such file or directory
So my question is: can You tell me if the paths are correct? I've checked the files and they are all in place. Paths also are absolute so I have no idea where the problem is. Are those "\" before path correct?
I have never used shell before so i don't even know the correct syntax. Thank You for simple explanation.

There should be no "\" in the path, but it's possible that this is an artifact of the error reporting/logging machanism. Do check though.
Another thing to check is that the user executing the code actually has the permissions needed to read and run the lua executable (and the directory where it resides, and all parent directories). For apache under Debian or Ubuntu, that user would typically be www-data. It should be fine to make the lua executable readable and runnable for all users.

Related

showip: command not found

I am trying to run one of the example from Beej's Guide to Network Programming (https://beej.us/guide/bgnet/), specifically showip.c (The link to the program is here: https://beej.us/guide/bgnet/examples/showip.c). Using gcc, I've typed in
gcc -o showip showip.c
Then ran the program
showip www.example.net
and I get an error showip: command not found on the same directory where the code and the program is compiled at. I'm not sure why this is the case. I've even cloned the code from his GitHub and used makefile to compile the program and yet I'm getting the same error. What exactly am I doing it wrong here?
This is actually problem with how you're running the program.
On Linux systems (unlike Windows systems) an executable in the current directory is not by default searched by the shell for programs to run. If the given program does not contain a path element (i.e. there are no / characters in the name) then only the directories listed in the PATH environment variable are searched.
Since the current directory is not part of your PATH, prefix the command with the directory:
./showip www.example.net
Is the working directory on your path? Likely not.
Try ./showip
Since the program showip is not in your $PATH you have to tell
your shell that it's in the current directory:
./showip
Or add the current directory to your $PATH but it's a less secure
option:
PATH=:$PATH
or
PATH=.:$PATH
and run it as you're trying now:
showip

Unable to use os.Mkdir() on Mac OS

I'd like to start off by saying this was working yesterday and to the best of my knowledge my computer has not performed any updates in the last 48 hours.
The program I am writing executes this code:
createDatabasesFolderError := os.MkdirAll("./.minutesdb/databases", os.ModePerm)
checkErr(createDatabasesFolderError)
Which results in this error when running go run .:
2020/10/28 08:04:58 Error: mkdir /.minutesdb: read-only file system
exit status 1
Running pwd results in this:
/Users/garrettlove/development/goworkspace/src/github.com/garrettlove8/minutesDB
I thought this was an OS issue as opposed to a Go issue, however everything else on my computer works, including other coding stuff...
You code's path - as quoted in the question - I suspect is a typo:
os.MkdirAll("./.minutesdb/databases")
as it does not match the logged error path /.minutesdb (missing the leading dot):
2020/10/28 08:04:58 Error: mkdir /.minutesdb read-only file system exit status 1
The error describes, understandably, a non-root user cannot write to the root / of the filesystem.
Add the missing leading dot to fix the path issue.

install4j: Executing bash file

I am trying to run a bash file from install4j6. install4j does indeed try to run the bash file but it just returns an error at the end of the installation. The error is very generic and has no code reference or anything that will help me determine a solution - just a message that says "Error while executing file."
The only thing I can provide is how I have it setup in install4j6 since I am pretty sure that's my issue.
The bash file is defined in the root of my installation directory distribution tree and is named set_permissions.sh. For the sake of eliminating permissions being a cause, the file permission mode is set to 777 (both in install4j and on the file system).
I believe the issue is related to what I have set as my "working directory". I currently have it set to just ".". Is there a way to debug this further? Maybe get an actual error as to why it's not executing?
Ok, first a few things to check:
make sure that you're running the batch file after the install files step (you mention it being at the root of your install)
best to have the wait for termination checked and a variable for the return code.
redirect stderr to the log file (just in case)
As for working directory, . should work, but you can change it to ${installer:sys.installationDir} to make sure that it references the installation directory chosen by the user. You can also set the executable in the form of ${installer:sys.installationDir}\set_permissions.sh
Also, try and run just your shell script to make sure that it works :)

Job not running: 'No such file or directory' but the script exists

I'm a bioinformatician, new in the community and quite new about working with bash-commands.
I recently encountered a very trivial error message but for me the issue is a bit complex to fix.
Briefly, when I launch a script with the qsub command (from the master node ) the job does not work and I find the following error message in the 'log' file:
Fatal error: cannot open file
'/data/users/genethongandolfi/scripts/multi454.mse/multi454fasta.manip.r':
No such file or directory
This sounds quite strange for me since the path to the script file called 'multi454fasta.manip.r' is correct (I already checked with the 'find' command).
I also tried to move the script into the home directory /home/genethongandolfi/scripts and the error message changes: the job runs because the system finds the script, but not the input file in the usual path /data/users/genethongandolfi/analysis/etc... . It seems to be something for which the /data/users/... path is not recognized when I launch a job.
There are a couple of reasons why this could be the case:
The file location on the slave node is different from the master
The file permissions on the slave do not permit access to the file
If you can, try logging into the slave node, change to the user running the job, and check the file location and permissions.
Had the same error for a simple c program in form of an .exe
Removing the .exe from the shell script did eventually fix it.
So instead of ./program.exe write ./program

Add directory to system path in OS X Lion

I can't figure out how to add a directory to the system path. I found out that the command is something like this:
export PATH=$PATH:/my_path/to/my_dir
Example
I run the terminal in the path where my installation directory is located. In this case I'm talking about Play Framework. And I type:
export PATH=$PATH:/to/play20
It looks like nothing happens. In fact, when I type the command "play" (to execute the framework) I get:
-bash: play: command not found
Can someone please give me a decent step-by-step guide?
Execute the command “/to/play20/play help”. If this gives the expected output (help for the play command), then the executable is available, and the problem is in the shell path. If it does not give the expected output, then the executable is not working.
In the former case, ensure you are running the bash shell. (This is the default for recent versions of Mac OS X, but it may be changed for specific accounts.) To do this temporarily, execute the command “bash”. (When you want to exit the temporary shell, execute the command “exit”.) Then execute the export command again. (When the export command works, it changes the variable without displaying any output, so this is normal.) Check the spelling in the export command carefully.
In the latter case, execute “ls -ld /to/play20/play”. If you get a message that the file does not exist, then the executable is not installed correctly, and I cannot help you further. If the file is present, then it is not executable for some reason. This might be because you do not have permission to access it (especially permission to execute it, marked by “x” in certain places in the initial field of the ls output that may contain hyphens, “r”, “w”, and a few other letters) or that it is a symbolic link to a file that does not exist (indicated by an “l” in the first character of the ls output for the file). Lack of permission can be fixed by the chmod command, assuming you have appropriate permissions for changing permissions on the system. If the file is a symbolic link to another file, you may have a bad installation, or the target file may have permission issues (or be another symbolic link, and so on).

Resources