/etc/init.d/logstash file not created for RHEL 6.8 - logstash

I downloaded logstash-6.4.0.rpm and Installed with
yum install logstash-6.4.0.rpm
for RHEL 6.8 but etc/init.d/logstash
After installation, I got a message
Successfully created system startup script for Logstash
But the file is not created, it is autogenerated for SysV See here
I tried generating manually by editing /etc/logstash/startup.options added like this
JAVACMD=/opt/java/jdk1.8.0_111/bin/java
JAVA_HOME=/opt/java/jdk1.8.0_111
and then went to /user/share/logstash/bin and ran sudo ./system-install Saw Here
After executing sudo ./system-install again got same message
Successfully created system startup script for Logstash
But still, the file is not created. Any idea, how I can achieve this?

I was able to generate the logstash service I was missing some options in the command.
step 1: check where your logstash is with command whereis logstash > for me :
[root#user ~]# whereis logstash
logstash: /etc/logstash /usr/share/logstash
step 2: edit /etc/logstash/startup.options file and correct path for JAVACMD and JAVA_HOME
JAVACMD=/opt/java/jdk1.8.0_111/bin/java
JAVA_HOME=/opt/java/jdk1.8.0_111
step 3: Go to /usr/share/logstash/bin and run system-install with sudo
sudo ./system-install /etc/logstashstartup.options sysv
Result
[root#user bin]# sudo ./system-install /etc/logstash/startup.options sysv
Using provided startup.options file: /etc/logstash/startup.options
Manually creating startup for specified platform: sysv
Successfully created system startup script for Logstash

Related

How can i resolve a problem with Logstash?

I have installed java: jdk11 and jre11 , also logstash installed via apt-get, but when i call it: systemctl enable logstash
Here is answer:
Failed to enable unit: Unit file logstash.service does not exist.
So when i type apt-get install logstash
system says that it has already installed.
Try the following steps to create the logstash.service file.
Edit the file /etc/logstash/startup.options and put the variables for your java binary and java home, something like that:
JAVACMD=/opt/java/jdk1.8.0_161/bin/java
JAVA_HOME=/opt/java/jdk1.8.0_161
Run the script /usr/share/logstash/bin/system-install
After running the system-install script you should be able to start logstash as a service on your system.

Run Python script at startup in Ubuntu [Failed]

I wanted to run a python script at boot in Ubuntu.
I tried referring to few existing solutions in stackoverflow but somehow I don't get it working.
Could anyone advise me on what piece of info I am missing!
Reference 1
Run Python script at startup in Ubuntu answered by #RickyA
Put this in /etc/init (Use /etc/systemd in Ubuntu 15.x)
mystartupscript.conf
start on runlevel [2345]
stop on runlevel [!2345]
exec /path/to/script.py
By placing this conf file there you hook into ubuntu's upstart service that runs services on startup.
manual starting/ stopping is done with sudo service mystartupscript start and sudo service mystartupscript stop
Results for Reference 1
In my case, the python script that I wanted to run on boot is located in /home/aspma/Dropbox/Linux/c_lynda_program_backup_script.py
When I tried to manually start the service from terminal window, i got an error message: start Job failed to start
Screenshot of mystartupscipt.conf file that i added inside /etc/init and its failed attempt for manual starting the service
Reference 2
How To Start Python Script On Bootup answered by #Germar
You can add it to /etc/rc.local. This can be used to run scripts and programs on system boot which doesn't have their own scripts for runlevels. It will run as root
Run sudo nano /etc/rc.local and add your line before exit 0
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
python /home/my-sickbeard-install/SickBeard.py 2>&1 >/dev/null &
exit 0
Results for Reference 2
In my case, the python script that I wanted to run on boot is located in /home/aspma/Dropbox/Linux/c_lynda_program_backup_script.py
Screeenshot of file that is edited in /etc/rc.local
This doesn't work too
Virtual Machine Details
Ubuntu Version 14.04.5 LTS
Python 2.7.6
I managed to get the python script run automatically at the boot, by adding one more step to the solution given in Reference 2 (see the question).
By adding the directory of the python script to PYTHONPATH, I was able to get it working.
To add the directory permanently to the PYTHON PATH, add this to your ~/.bashrc
export PYTHONPATH=$PYTHONPATH:/my/other/folder_containing_python_script
Thanks to the post: Permanently add a directory to PYTHONPATH

How to know whether Apache is install or not from centos 7

I am new to centos 7. I want to install apache (httpd). so i command yum install httpd it says already installed. but i could find any file in etc directory.
There is folder in etc httpd but no file are there in this directory.
In CentOS there are no files in /etc/httpd since they are all in subdirectories.
/etc/httpd/conf/httpd.conf is main configuration file, and there are additional configuration files in /etc/httpd/conf.d and /etc/httpd/conf.modules.d directories which are included by main file.
To see in browser that Apache is installed, first start Apache using following command and then open http://localhost in browser:
sudo systemctl start httpd
You can also ask Apache status from commandline with command:
sudo systemctl status httpd
I'm not completely sure about what that outputs in all cases, but seems to output at least Loaded: loaded on second line when Apache has been installed.
The unix which command shows the full path of a command.
In order to check if Apache is installed, just check from the console if any of possible apache command exists :
> which apache || which httpd || which apache2
If there is no answer, Apache is not available...

How to detect whether tomcat and ant are installed on linux machine

I am trying to install Tomcat and Ant on my linux machine, but before installing them i just need to check whether they are already installed or not.
Regarding tomcat:
I googled a lot and searched on my machine in the following directories for tomcat
/usr/local/, /opt/, /usr/share/
but i din't find tomcat folder in any of the above path, whether it indicates that tomcat is not installed ? so actually
1. what is the path to `look/find` exactly to know/check whether tomcat is installed or not in
all linux machines
2. what will be the path the tomcat will be installed exactly after installation
3. How to find the version of tomcat on any linux machine (if tomcat already installed)
4. Whether there are any commands to look for both whether `tomcat` installed and `ant`
installed
Regarding Ant:
I googled and got the below command due to which i got the below result after executing
it
sh-4.2$ ant -v
result
sh-4.2$ ant -v
Apache Ant(TM) version 1.8.2 compiled on November 21 2011
Trying the default build file: build.xml
Buildfile: build.xml does not exist!
Build failed
so actually
1. Does the above result mean that `Ant` is installed ? or not ?
2. what is the path to `look/find` exactly to know/check whether ant is installed or not in
all linux machines
3. what will be the path the `ant` will be installed exactly after installation
4. How to find the version of `Ant` on any linux machine (if Ant already installed)
Generally, you can check whether they are on the $PATH, if they are not on the $PATH, install one.
For ant:
ant -v stands for verbose, ant -version prints out its version.
-help, -h
print help on the command line options
-projecthelp, -p
gives information on possible targets for this project
-version
prints the version number and then exits ant
-quiet, -q
be extra quiet
-verbose, -v
be extra verbose
-debug, -d
print debugging information
-emacs, -e
produce logging information without adornments
-logfile <file>, -l <file>
use the given file to output log to
-logger <classname>
the class which is to perform logging
-listener <classname>
add an instance of the given class as a project listener
-noinput
do not allow interactive input
-buildfile <file>, -file <file>, -f <file>
use the given buildfile instead of the default build.xml file.
This is the ant equivalent of Makefile
-D<property>=<value>
use value for the given property
-keep-going, -k
execute all targets that do not depend on failed target(s)
-propertyfile <file>
load all properties from file with -D properties taking prece-
dence
-inputhandler <class>
the class which will handle input requests
-find <file>, -s <file>
(s)earch for buildfile towards the root of the filesystem and
use it
-nice number
A niceness value for the main thread: 1 (lowest) to 10 (high-
est); 5 is the default
-nouserlib
Run ant without using the jar files from ${user.home}/.ant/lib
-noclasspath
Run ant without using CLASSPATH
-autoproxy
Java 1.5+ : use the OS proxies
-main <class>
override ant's normal entry point
For tomcat:
if tomcat/bin is on the $PATH variable, version.sh will print out the version.
For linux ubuntu 18.04:
Go to terminal and command:$ sudo systemctl status tomcat
This command also show is tomcat running or not (if already installed)

Open GTS build failed

Every thing is okay (Opengts dir & tomcat dir have permission 777) but i am getting this error again & again, why--
executing # sudo ant all then i get this error
BUILD FAILED
/usr/local/OpenGTS_2.4.5/build.xml:111: CATALINA_HOME environment variable has not been defined.
(make sure CATALINA_HOME is defined and exported to the list of environment variables)
I got the this msg when starting the tomcat
sudo ./startup.sh
Using CATALINA_BASE: /usr/local/apache-tomcat-6.0.36
Using CATALINA_HOME: /usr/local/apache-tomcat-6.0.36
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-6.0.36/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/local/apache-tomcat-6.0.36/bin/bootstrap.jar
Any one have the solution please tell me how to fix this error.
Try to configure OpenGTS in your home directory (rather than /usr/local/).
And use ant all command (not sudo ant all).
Good Lock.. :)
First run this command:
echo $CATALINA_HOME
It should give you the path to your tomcat directory, which I'm assuming is /usr/local/apache-tomcat-6.0.36, but if you see a different path, or if the response is blank, try running this command:
export CATALINA_HOME=/usr/local/apache-tomcat-6.0.36
If you read the OpenGTS Configuration Manual, it talks about the CATALINA_HOME environment variable for Linux in section 2.4a. There are other environment variables too that you must set to install OpenGTS successfully (All mentioned in the manual).
To solve this problem, ensure the OpenGTS2.6.x has all files and directories to user:group same as logged in user. then run / ant all command
Please note that "sudo ant all" doesn't work.
Use this command to change ownership of OpenGTS files/dir
/usr/local/OpenGTS2.6.2> cd ..
sudo chown -R ranjan:ranjan OpenGTS2.6.2
change ranjan to your username: group name
/usr/local/OpenGTS2.6.2> ant all
It will work.
Try to install tomcat7 rather than tomcat6 via command line
apt-get update
apt-get install tomcat7
Configure CATALINA_HOME by
export CATALINA_HOME=/usr/share/tomcat7

Resources