Jenkins - /usr/bin/env: perl: No such file or directory - perl

I have strange problem - I wanted to use xvnc jenkins plugin because of karma tests for browsers like Chrome, Firefox etc...
But there is problem with running vncserver while building. Console output:
Starting xvnc
[workspace] $ vncserver :51 -localhost -nolisten tcp
/usr/bin/env: perl: No such file or directory
this is repeated several times and last output is
FATAL: Failed to run 'vncserver :61 -localhost -nolisten tcp' (exit code 127), blacklisting display #61; consider checking the "Clean up before start" option
I can understand the problem is that jenkins cannot find Perl but it is really weird because when I run env perl it works (even as a jenkins user).
What am I doing wrong?
Thanks

For me this occurs when the NodeJS and Xvnc plugins are enabled during the same build.
I've reported this in JENKINS-28578.

Related

Diagnose watch utility

I have a script that runs in the background which uses watch to monitor a directory for changes. This works just fine. However, I had a need for the script which runs the monitoring script to be run as daemon. The daemon is running as the same user, but now watch is returning "1 Various failures."
I suspect that there is some environment variable that is not set right, but there are too many to use trial and error to diagnose the issue. And unfortunately, "Various failures" is not very helpful. Any ideas how I might diagnose this?
The command is
watch -d -t -g ls -l
I think something like the following can be used as a work-around.
diff <(ls -l) <(sleep 1; ls -l)
I finally discovered the following on stderr.
Error opening terminal: unknown.
It was easily resolved by the answer to error opening terminal. So it did turn out to be an environment variable. I don't see this error message in the code. Perhaps it occurs when making a system call that needs the terminal.

Rundeck: see what is actually executed on the commandline

I'm just getting started with rundeck and trying to find out how it works.
I created a simple Job that should install some packages on the remote note from a pre-selected list (Option).
When I select more than one option the command fails. I want to find out why it fails but (even with debug-mode enabled) see nowhere which command is actally being executed on the remote node.
My command looks like yum install -y "${option.package}" and the unexpected response is eg: no package [selected options] available ... I have selected (space) as delimitter.
How can I see what is executed on the remote host?
Update:
I meanwhile found out why my options did not work as expected; I had to use the unqouted variant for the command-line. But the main question still stays the same ...
Right now the only way to see the exact executed command is to run the job on debug mode. Just select "Run with Debug output" and you can see the command dispatched in the middle of the execution output.

SFTP from web service through Cygwin fails

I have a web page running on Apache which uses a matured set of Perl files for monitoring our workplace servers and applications. One of those tests goes through Cygwin´s SFTP, list files there and assess them.
The problem I have is with SFTP itself - when I run part of test either manually from cmd as D:\cygwin\bin\bash.exe -c "/usr/bin/sftp -oIdentityFile=[privateKeyPath] -oStrictHostKeyChecking=no -b /cygdrive/d/WD/temp/list_SFTP.sh [user]#[hostname]" or invoke the very same set of Perl files as web it works OK (returns list of files as it should). When exactly same code is run through web page it fails quick and does not tell anything. Only thing I have is error code 255 and "Connection closed". No error stream, no verbose output, nothing, no matter what way to capture any error I have used.
To cut long story short, the culprit was HOME path.
When run manually either directly from cmd or through Perl, the D:\cygwin\bin\bash.exe -c "env" would report HOME as HOME=/cygdrive/c/Users/[username]/ BUT this same command when run through web page reports HOME=/ i.e. root, apparently loosing the home somewhere along the path.
With this knowledge the solution is simple: prepend SFTP command with proper home path (e.g. D:\cygwin\bin\bash.exe -c "export HOME=/cygdrive/c/Users/%USERNAME%/ ; /usr/bin/sftp -oIdentityFile=[privateKeyPath] -oStrictHostKeyChecking=no -b /cygdrive/d/WD/temp/list_SFTP.sh [user]#[hostname]") and you are good to go.

gearmand: Could not open log file "/usr/local/var/log/gearmand.log"

I'm trying to install gearman in my Ubuntu 12.04.
Actually installation is successful. But when I start the daemon, I'm getting this error.
gearmand: Could not open log file "/usr/local/var/log/gearmand.log" from xxxx switching to stderr. (No such file or directory)
Am I missing anything here? I tried installing various versions of gearman, still the result is same.
Any help please...
/usr/local/var/log/gearmand.log is default value of --log-file option.
See gearmand --help
-l [ --log-file ] arg (=/usr/local/var/log/gearmand.log)
Log file to write errors and
information to. If the log-file
parameter is specified as 'stderr',
then output will go to stderr. If
'none', then no logfile will be
generated.

Snort Errors: ERROR: /etc/snort/snort.conf(0) Unable to open rules file "/etc/snort/snort.conf": No such file or directory

First time Snort user and running into two issues. After installation on a Windows 10 machine, I am able to initialize snort via an elevated command prompt: snort -A console. While snort it running however I noticed "Warning: No Preprocessors configured for policy 0." mixed into the console output.
A quick Stackoverflow search pointed me to run the following command to solve this, they said: This message indicates that no snort preprocessor is loaded. In order to get rid of this warning, please use the command: snort -v -c /etc/snort/snort.conf
But when I run this command I am greeted with another error:
Running in IDS mode
--== Initializing Snort ==--
Initializing Output Plugins!
Initializing Preprocessors!
Initializing Plug-ins!
Parsing Rules file "/etc/snort/snort.conf"
ERROR: /etc/snort/snort.conf(0) Unable to open rules file "/etc/snort/snort.conf": No such file or directory.
Fatal Error, Quitting..
This is where I get lost since that's where I have the config file (initally it was just /etc/snort.conf, but created a snort folder so the directory / file exists).
If anyone has any insight into this I would be more than grateful!
Make sure the file snort.conf has necessary permission and ownership. The directory /etc/snort should contain "chmod -R 5775" level permission. If you are installing it from source, you would be always able to copy the snort.conf to /etc/snort.