How can start Linux init script service of Geoserver - linux

I downloaded Linux init script from geoserver web site. And I moved it to /etc/init.d
geoserver color is different from other services. But when I run start service command it does not work. How can I start this service. How can I show linux this is a service.

I think you should make it executable.
chmod +x geoserver

First thing you have to change the permission of script.
chmod 755 geoserver
then you can start your service by either of these commands
/etc/init.d/geoserver start
Or if your system have initctl then you can also use
sudo initctl start geoserver
Or if your system having systemctl
sudo systemctl start geoserver

I had to run this two commands:
sudo chmod +x /etc/init.d/geoserver
sudo update-rc.d geoserver defaults
After that sudo service geoserver start worked just fine

Related

Web access to tableau server installed on google cloud instance with centos 7 as OS

I created VM (virtual machine) instance on Google Cloud with CentOS 7 as OS to install Tableau Server and http access to it using set of commands from online free video. After successful installation I try to use web browser to get an access to Tableau Configuration and I see nothing but an error message "Connection took too long".
Pretty much I didn't do anything else yet because on video everything is right and smooth. Already asked owner of video but who knows how busy he is and if consider it his responsibility to answer the questions.
sudo -i
yum update -y
sudo yum install wget -y
wget https://downloads.tableau.com/tssoftware/tableau-server-2018-2-0.x86_64.rpm
chmod 777 tableau-server-2018-2-0.x86_64.rpm
sudo yum install tableau-server-2018-2-0.x86_64.rpm
adduser admin
passwd admin
usermod -aG wheel admin
systemctl status firewalld.service
systemctl disable firewalld.service
systemctl stop firewalld.service
su - admin
cd /opt/tableau/tableau_server/packages/scripts.20182.18.0627.2230/
sudo ./initialize-tsm --accepteula
sudo usermod -G tsmadmin -a admin
source /etc/profile.d/tableau_server.sh
After many starts and stops and checking the Tableau Server application status I still not able to have web access to configuration page.
Any suggestions please?
I would follow the Linux install docs. You are missing a few steps like registration and configuring the initial node.
Also, you shouldn't install as su - admin. You want to install in the user space using sudo.
When you do get the server up and running you should be able to run tsm status and see that Tableau Server is running. If you still cannot reach the server after that then there is probably something going on with the networking with the GCP settings.

Teamviewer linux without permanently running daemon

Teamviewer Linux has the annoying property of installing a permanently running daemon. This not only consumes resources but also presents a security risk. You can disable the daemon startup, however then the teamviewer client does not work anymore.
The best way is to enable the daemon before running the teamviewer script and disable it again after the teamviewer client has closed.
The following shell script handles things automatically:
#!/bin/sh
echo starting teamviewer daemon
sudo teamviewer --daemon enable
teamviewer &
wait $!
echo teamviewer finished
sudo teamviewer --daemon disable
echo stopped and disabled teamviewer daemon
On ubuntu 18.04, here how I solve this
Stop autostart demon
$sudo systemctl disabled teamviewerd.service
create script /opt/tm.sh
#!/bin/bash
pkexec --user root systemctl start teamviewerd.service;
/opt/teamviewer/tv_bin/script/teamviewer;
pkexec --user root systemctl stop teamviewerd.service;
Set bash script executable
chmod u+x /top/tm.sh
Update de /usr/share/applications/com.teamviewer.TeamViewer.desktop
Exec=/opt/tm.sh
It work perfecly for my needs. I only need to connect to other computer never to mine, so root deamon always running is not needed.
Let's see how it live with update from ppa of Teamviewer
The solution Fedora 30+ is:
# systemctl disable teamviewerd.service
# systemctl stop teamviewerd.service
But don't forget to start the service again in order to get a TeamViewer ID.
# systemctl start teamviewerd.service
The tar package allows to run the TV client without installation and without root privileges.

How to auto start elasticsearch in Centos 6.5?

I have installed elasticsearh on a server based on Cent OS 6.5. To start it:
# cd /usr/share/elasticsearch/elasticsearch-1.5.2]
# ./bin/elasticsearch &
But when I close the terminal, the process is killed. How can I set it to automatically start as a service?
Try using the "nohup" command with elastic search.
$ nohup ./bin/elasticsearch
Now what the nohup does? In the following example, it starts the program abcd in the background in such a way that the subsequent logout does not stop it.
$ nohup abcd &
$ exit
Hope that helped.
As #DerStoffel said, you have to start elasticsearch as a service (sudo service elasticsearch start). This is highly recommended in production settings. Also add the service to start in case of reboot (sudo /sbin/chkconfig --add elasticsearch)
It depends the distribution of linux you use:
Debian/Ubuntu
sudo update-rc.d elasticsearch defaults 95 10
sudo /etc/init.d/elasticsearch start
https://www.elastic.co/guide/en/elasticsearch/reference/1.6/setup-service.html#_debian_ubuntu
RPM based distributions like Centos
sudo /sbin/chkconfig --add elasticsearch
sudo service elasticsearch start
https://www.elastic.co/guide/en/elasticsearch/reference/1.6/setup-service.html#_rpm_based_distributions
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
sudo /bin/systemctl start elasticsearch.service

Tips on getting docker to work without having to run `sudo docker -d` on Ubuntu 15.04

After upgrading my system from 14.10 to 15.04 I can't seem to use docker like I used to. I already have a docker group that my user is part of and I used to be able to use docker without sudo just fine. Now I can't use it unless I have sudo docker -d running in another terminal. Simply running docker ps gives me this error:
FATA[0000] Get http:///var/run/docker.sock/v1.18/containers/json: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?
I've tried reinstalling, rebooting, restarting services, and blowing out configurations to no avail. Any tips would be appreciated. As a side note, I installing 15.04 in a vm to see if I could get docker working there and I was able to set it up no problem. seems like an issue specific to those who have upgraded from 14.10.
Did u checked this http://docs.docker.com/articles/systemd/? This helped me to start docker under Ubunu 15.04.
What to do if this fails...
$ sudo usermod -aG docker $USER
..and you have added user to docker group and Ubuntu still requires sudo:
If you initially ran Docker CLI commands using sudo before adding your user to the docker group, you may see the following error, which indicates that your ~/.docker/ directory was created with incorrect permissions due to the sudo commands.
To fix this problem, either remove the ~/.docker/ directory (it is recreated automatically, but any custom settings are lost), or change its ownership and permissions using the following commands:
$ sudo chown "$USER":"$USER" /home/"$USER"/.docker -R
$ sudo chmod g+rwx "$HOME/.docker" -R
What the link mafahand provided tells is how to use docker on a systemd based host. Ubuntu 15.04 uses systemd now while older version used upstart. That might explain why upgraded systems show erratic behavior. Check out the Ubuntu wiki for some help on that regard.
After installing docker via
sudo apt install docker.io
you might have to reboot your system or start the docker.socket unit manually. For some reason that did not happen on my machine after installing it.
Type
systemctl status docker
to check whether docker is up and running. If it is not enabled use
sudo systemctl enable docker
to enable it permanently and/or
sudo systemctl start docker
to run the service.

How do I install chkconfig on Ubuntu?

I am running Ubuntu 13.10, and I'm pretty new to Linux. I tried:
$ sudo apt-get install chkconfig
Package chkconfig is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'chkconfig' has no installation candidate
I manually downloaded the package and unzipped it. The resulting folder has a file called:
chkconfig.install
But how do I run this? I tried this, but it didn't work.
$ sudo chkconfig.install
The command chkconfig is no longer available in Ubuntu.The equivalent command to chkconfig is update-rc.d.This command nearly supports all the new versions of ubuntu.
The similar commands are
update-rc.d <service> defaults
update-rc.d <service> start 20 3 4 5
update-rc.d -f <service> remove
In Ubuntu /etc/init.d has been replaced by /usr/lib/systemd. Scripts can still be started and stoped by 'service'. But the primary command is now 'systemctl'.
The chkconfig command was left behind, and now you do this with systemctl.
So instead of:
chkconfig enable apache2
You should look for the service name, and then enable it
systemctl status apache2
systemctl enable apache2.service
Systemd has become more friendly about figuring out if you have a systemd script, or an /etc/init.d script, and doing the right thing.
sysv-rc-conf is an alternate option for Ubuntu.
sudo apt-get install sysv-rc-conf
sysv-rc-conf --list xxxx
alias chkconfig=sysv-rc-conf
chkconfig --list
syntax
sysv-rc-conf command line usage:
sysv-rc-conf --list [service name]
sysv-rc-conf [--level <runlevels>] <service name> <on|off>
Chkconfig is no longer available in Ubuntu.
Chkconfig is a script. You can download it from here.
Install this package in Ubuntu:
apt install sysv-rc-conf
its a substitute for chkconfig cmd.
After install run this cmd:
sysv-rc-conf --list
It'll show all services in all the runlevels. You can also run this:
sysv-rc-conf --level (runlevel number ex:1 2 3 4 5 6 )
Now you can choose which service should be active in boot time.
The following command do the same on Ubuntu:
systemctl list-dependencies
But how do I run this? I tried typing: sudo chkconfig.install which doesn't work.
I'm not sure where you got this package or what it contains; A url of download would be helpful.
Without being able to look at the contents of chkconfig.install; I'm surprised to find a unix tool like chkconfig to be bundled in a zip archive, maybe it is still yet to be uncompressed, a tar.gz? but maybe it is a shell script?
I should suggest editing it and seeing what you are executing.
sh chkconfig.install or ./chkconfig.install ; which might work....but my suggestion would be to learn to use update-rc.d as the other answers have suggested but do not speak directly to the question...which is pretty hard to answer without being able to look at the data yourself.
As mentioned by #jerry you can add services with the below command.
update-rc.d <service> defaults
update-rc.d <service> start 20 3 4 5
update-rc.d -f <service> remove
To validate them check the above commands you can check /etc/rc*.d/ directory where service start with "k" means it will not execute during the boot and service start with "S" will start during the boot.
# for runlevel symlinks:
ls /etc/rc*.d/
In the below screenshot you can see apache2 starting in runlevel2(S02apache2) and stopping in runlevel1(K01apache2)
You can also check the service status with the below command where "+" means service is in running state "-" is in stopped.
service --status-all
OR
install sysv-rc-conf utility.
apt-get install sysv-rc-conf
example
sysv-rc-conf --level 2345 apach22 on
man sysv-rc-conf

Resources