I've created an upstart conf script called watch_folder.conf that i have used successfully on a few ubuntu installs already but for some reason I'm getting an error from the following code:
#/etc/init/watch_folder.conf
description "watch folder service"
author "Jonathan Topf"
start on startup
stop on shutdown
respawn
respawn limit 99 5
script
chdir /home/jon/Dropbox/Render\ Farm\ 1/appleseed/bin
exec /usr/bin/python ./watchfolder.py ../../data/
echo "watch_folder started"
end script
if I look inside /var/log/upstart/watch_folder.log i see the following
/proc/self/fd/9: line 2: chdir: command not found
/proc/self/fd/9: line 2: chdir: command not found
/proc/self/fd/9: line 2: chdir: command not found
/proc/self/fd/9: line 2: chdir: command not found
/proc/self/fd/9: line 2: chdir: command not found
/proc/self/fd/9: line 2: chdir: command not found
...
Does anybody know what may cause this error, its perplexing me!
I't seems that I misunderstood the structure of upstart conf files, like script, chdir is a stanza so shouldn't appear within one.
More info here
https://askubuntu.com/questions/321867/upstart-service-giving-chdir-command-not-found-error#321871
Related
I wrote a perl script that runs command strings using the system perl command. And under Windows 10, when it comes to running a command like
cd /D R:/some_path…`
it gives the following error message
sh: line 0: cd: /D: No such file or directory
but directly running the same command via Windows 10 cmd is successful. What's odd to me here is that this error message is used to appear on Linux systems. what could be causing this behaviour, and how can I get it to work correctly?
thanks for all the comments. I figured out that the Perl I'm using is inside the cygwin/bin folder. I changed it to regular perl under windows and it works great.
I have installed Perl but every time I run a command it flash and goes away and does nothing, I have added it to Environment path and gave full permission to folder Perl64
edit regeristy in perl command c:\perl\bin\perl.exe %1 %*
when I run Perl -v I do get versions so I know it installed
It sounds like your command ran to completion and exited. Once the program exits, the console is closed.
Perhaps you are getting an error. You should run the program from the command line to see what errors you get.
You could also try associating the file with the following command:
cmd /c c:\perl\bin\perl.exe %1 %* & pause
(Untested)
I am always getting the same error i.e. is a directory when I try to execute the above bash script in the terminal to get pod file.
What can I do?
Thanks
In the first couple lines, you appear to have an errant filepath in your command. Instead of $ /Users/rgf...TestTable.xcodeproj cd, it should have been $ cd. Your shell is complaining because the command–as you've written it–appears to be executing a directory, which isn't possible.
I am having trouble launching an executable that I have created from a shell script. I would like to automate testing by running the program many times with different command line options to verify it is working.
When I type echo $SHELL, /bin/sh is displayed.
The following is my shell script:
#!/bin/sh
clear
echo "Running first test."
./myProgram
exit 0
When I run the script (sh myScript.sh), with myProgram in the same directory, I see the following output:
Running first test.
: not foundsh: line 4:
When executing the program ./myProgram, it runs as expected with no command line options.
I have also tried:
myProgram
./myProgram &
myProgram &
based on answers to somewhat similar questions, but they all result in the above error message.
Your newlines are goofed. Use dos2unix to fix.
why don't you try using the full path?
e.g., if myProgram is in /home/user1/bin, you can try /home/user1/bin/myProgram instead of ./myProgram. This should work.
You can also add the path to path variable, $PATH and directly call myProgram from anywhere.
Run "export PATH=$PATH:/home/user1/bin" on your terminal without the quotes. Note that this affects only your current termial session. If you want to permanently add the path, update your .bashrc file in your home directory with the following line:
I am using mr on Windows and it allows running arbitrary commands before/after any repository action. As far as I can see this is done simply by invoking perl's system function. However something seems very wrong with my setup: when making mr run the following batch file, located in d:
#echo off
copy /Y foo.bat bar.bat
I get errors on the most basic windows commands:
d:/foo.bat: line 1: #echo: command not found
d:/foo.bat: line 2: copy: command not found
To make sure mr isn't the problem, I ran perl -e 'system( "d:/foo.bat" )' but the output is the same.
Using xcopy instead of copy, it seems the xcopy command is found since the output is now
d:/foo.bat: line 1: #echo: command not found
Invalid number of parameters
However I have no idea what could be wrong with the parameters. I figured maybe the problem is the batch file hasn't full access to the standard command environment so I tried running it explicitly via perl -e 'system( "cmd /c d:\foo.bat" )' but that just starts cmd and does not run the command (I have to exit the command line to get back to the one where I was).
What is wrong here? A detailed explanation would be great. Also, how do I solve this? I prefer a solution that leaves the batch file as is.
The echo directive is executed directly by the running command-prompt instance.
But perl is launching a new process with your command. You need to run your script within a cmd instance, for those commands to work.
Your cmd /c must work. Check if you have spaces in the path you are supplying to it.
You can use a parametrized way of passing arguments,
#array = qw("/c", "path/to/xyz.bat");
system("cmd.exe", #array);
The echo directive is not an executable and hence, it errors out.
The same is true of the copy command also. It is not an executable, while xcopy.exe is.