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.
Related
I have a SLES11 SP4 machine available with me. I have installed xrdp using zypper.
The command I used to install was zypper in xrdp and followed on-console messages.
xrdp installed successfully. But when I tried to connect from Windows 7 machine it said the machine is not up. I tried to start xrdp by typing command xrdp, it started and said xrdp started and gave a pid. Now connecting through windows was leading to login. I entered the credentials and it went into forever connecting mode.
Tried stopping xrdp by xrdp -kill and restarting again. But doesn't work.
I did a fair amount of research regarding this issue. I could find that just executing command xrdp doesn't work. The xrdp should be started with the system's own service startup mechanism.
For ex.
in SLES11 machines, use command /etc/init.d/xrdp start
in SLES12 machines, use command systemctl start xrdp
Similarly use the native system service management to startup and shutdown xrdp. Since my machine is SLES11 I used the above command and it worked.
Before executing that, we have to kill all the xrdp processes, restart the machine and start the xrdp using above commands.
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
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.
I need to run external program from systemd service outside current cgroup.
I have found a systemd-run tool which would probably solve this but i'm stuck with systemd version 204 where it is not yet available.
Is there some other solution?
My problem in more detail:
Application is bundled in debian package and will install and run itself as systemd service.
This service later downloads newer version of application and runs dpkg -i myapplication.deb.
Service must be stopped during installation of upgrade - but it will not stop until all processes in cgroup ends. Now we have deadlock because dpkg is itself running in this cgroup. After service stopping timeout, dpkg is killed and upgrade is not installed.
You can create your service dynamically in /run/systemd/system path. This path is the runtime service directory.
Later on you tell systemd to reload its state. Once the reload is done, now systemd knows about your service. Starting your service will happen in service's own cgroup.
I think you could do something like this:
#!/bin/sh
printf "[Service]\nType=oneshot\nExecStart=dpkg -i myapplication.deb" \
> /run/systemd/system/my-dpkg.service
if [ -f "/run/systemd/system/my-dpkg.service" ]; then
systemctl daemon-reload && \
systemctl start dpkg.service
fi
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