rabbitmq-server don't start - unable to connect to epmd / Ubuntu 16.04 - rabbitmq

I followed this guide https://www.rabbitmq.com/install-debian.html and installed rabbitmq-server. However, it won't start with an error message:
Jul 31 20:29:49 76672.local rabbitmqctl[7519]: attempted to contact: [rabbit#76672]
Jul 31 20:29:49 76672.local rabbitmqctl[7519]: rabbit#76672:
Jul 31 20:29:49 76672.local rabbitmqctl[7519]: * unable to connect to epmd (port 4369) on 76672: badarg (unknown POSIX error)
Jul 31 20:29:49 76672.local rabbitmqctl[7519]: current node details:
Jul 31 20:29:49 76672.local rabbitmqctl[7519]: - node name: 'rabbitmq-cli-30#76672'
Jul 31 20:29:49 76672.local rabbitmqctl[7519]: - home dir: /var/lib/rabbitmq
Jul 31 20:29:49 76672.local rabbitmqctl[7519]: - cookie hash: VwJCJ/LkSvmUKaoPOglCcQ==
Jul 31 20:29:49 76672.local systemd[1]: Failed to start RabbitMQ broker.
Jul 31 20:29:49 76672.local systemd[1]: rabbitmq-server.service: Unit entered failed state.
Jul 31 20:29:49 76672.local systemd[1]: rabbitmq-server.service: Failed with result 'exit-code'.
dpkg: error processing package rabbitmq-server (--configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for systemd (229-4ubuntu17) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
rabbitmq-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
altor_work#76672:
I tried to do this installation on a clear instance of Ubuntu and got the same error. I googled the error message and it seems I have some problem with network settings - I guess I should change some settings from their default state.
Any idea what needed to be changed? Or with which setting I should take my first try?
P.S. I'm completely novice in Unix. For me, it's just a cloud environment where I run my Python scripts.

I solved my problem by setting HOSTNAME in the file rabbitmq-env.conf. I don't know what exactly caused the problem in the first place.
My settings:
sudo cat /etc/hostname
76672.localhost
sudo cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 ubuntu16.04 ubuntu16
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
127.0.0.1 76672.local
/etc/rabbitmq/rabbitmq-env.conf
# Empty - if the file is empty rabbitmq doesn't start
HOSTNAME=76672.local # With this rabbitmq doesn't start either
HOSTNAME=localhost # With this all works

If it works with localhost setting only please check out the following:
fgrep BindToDevice /lib/systemd/system/epmd.socket

Related

Cloudstack KVM installation failed

I'm installing cloudstack on ubuntu 20.04 by following this document.
I installed qemu-kvm and cloudstack-agent successfully but I'm not able to start libvirtd.service, on seeing the status I'm getting following errors
● libvirtd.service - Virtualization daemon
Loaded: loaded (/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2021-03-16 18:00:09 IST; 1min 28s ago
TriggeredBy: ● libvirtd-admin.socket
● libvirtd.socket
● libvirtd-ro.socket
Docs: man:libvirtd(8)
https://libvirt.org
Process: 232313 ExecStart=/usr/sbin/libvirtd $libvirtd_opts (code=exited, status=6)
Main PID: 232313 (code=exited, status=6)
Mar 16 18:00:09 host systemd[1]: libvirtd.service: Scheduled restart job, restart counter is at 5.
Mar 16 18:00:09 host systemd[1]: Stopped Virtualization daemon.
Mar 16 18:00:09 host systemd[1]: libvirtd.service: Start request repeated too quickly.
Mar 16 18:00:09 host systemd[1]: libvirtd.service: Failed with result 'exit-code'.
Mar 16 18:00:09 host systemd[1]: Failed to start Virtualization daemon.
on seeing the log of journalctl -xe it is showing cloudstack-usage.service: Failed with result 'exit-code'
can any one suggest what whould be the issue.
Are you trying this on a virtualised VM, or baremetal host, or on a raspberrypi? This means some other service hasn't started which libvirtd may depend on. See if you can run "systemctl daemon-reload" and try to start libvirtd manually "systemctl start libvirtd", and then try rest. The cloudstack-usage service can be started once the mysql server is running. If you've further questions I encourage you to join the CloudStack users mailing list and ask questions there - http://cloudstack.apache.org/mailing-lists.html
I got that same error message when following the official install guide when starting the mysql server. The problem was for me that [mysqld] was missing in the my.conf file before the config snippet. The documentation is misleading in that case (like the secion header is only relevant when editing that alternative mysql config file mentioned later there).

Unable to start httpd service on Centos 7 "GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject"

When trying to (re)start httpd service I get the following error:
** (pkttyagent:2574): WARNING **: 01:33:55.345: Unable to register authentication agent:
GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject Error registering authentication agent:
GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject (polkit-error-quark, 0) Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
Then
systemctl status httpd.service
sheds no light on the problem:
httpd.service - Web server Apache
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2020-07-22 01:33:55 BST; 26min ago
Process: 2578 ExecStart=/usr/local/apache/bin/apachectl start (code=exited, status=1/FAILURE)
Jul 22 01:33:55 server... systemd[1]: Starting Web server Apache...
Jul 22 01:33:55 server... systemd[1]: httpd.service: control process exited, code=exited status=1
Jul 22 01:33:55 server... systemd[1]: Failed to start Web server Apache.
Jul 22 01:33:55 server... systemd[1]: Unit httpd.service entered failed state.
Jul 22 01:33:55 server... systemd[1]: httpd.service failed.
What might be causing this? Where should I look to debug?
[Thu Jul 23 05:40:44.885963 2020] [ssl:emerg] [pid 2877:tid 140514669713280] AH02565: Certificate and private key do not match
Looks like key and certificate do not match. Please check md5 of the key and cert file.
This usually happens when trying to restart a systemd service.
The workaround is as follows:
Run this as root
groupadd -g 23 nohidproc
usermod -a -G nohidproc polkitd
mount -o remount,rw,hidepid=2,gid=nohidproc /proc
systemctl restart polkit

Service running on RHEL7.5 is not running on RHEL8 (httpd service)

I have service which was working fine with RHEL 7.5, now I have upgraded to RHEL 8 and same service is failing with below status:
Service.service - LSB: Web Server
Loaded: loaded (/etc/rc.d/init.d/Service; generated)
Active: failed (Result: protocol) since Mon 2020-04-06 12:02:21 IST; 38min ago
Docs: man:systemd-sysv-generator(8)
Process: 403 ExecStart=/etc/rc.d/init.d/Service start (code=exited, status=0/SUCCESS)
Apr 06 12:02:21 localhost.localdomain systemd[1]: Starting LSB: Web Server...
Apr 06 12:02:21 localhost.localdomain Service[403]: httpd (pid 29434) already running
Apr 06 12:02:21 localhost.localdomain systemd[1]: Service.service: Refusing to accept PID outside of service control group, acquired through unsafe symlink chain:
/usr/local/apache/logs/Service.pid
Apr 06 12:02:21 localhost.localdomain systemd[1]: Service.service: Refusing to accept PID outside of service control group, acquired through unsafe symlink chain:
/usr/local/apache/logs/Service.pid
Apr 06 12:02:21 localhost.localdomain systemd[1]: Service.service: Failed with result 'protocol'.
Apr 06 12:02:21 localhost.localdomain systemd[1]: Failed to start LSB: Web Server
THis is my Service unit placed under /etc/init.d/Service, same is done for RHEL 7.5 but there this service is working and in RHEL 8 it is not. One more thing here to note is web server is working as expected although giving me this error.
#!/bin/sh
#
# chkconfig: 345 97 03
# description:Web Server
# processname: httpd
# config: /usr/local/Test/apache/conf/httpd.conf
# pidfile: /usr/local/Test/apache/logs/httpd.pid
### BEGIN INIT INFO
# Provides: Service
# Required-Start: $remote_fs $network $syslog
# Should-Start:
# Required-Stop:
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6`enter code here`
# Short-Description: Web Server
# Description: Web Server
### END INIT INFO
LANG=en_US.iso88591
export LANG
BASEDIR=/usr/local/Test/apache
PATH=$BASEDIR/bin:/usr/bin:/bin
export PATH
LD_LIBRARY_PATH=$BASEDIR/lib
export LD_LIBRARY_PATH
inst=/usr/local/Test
MIBDIRS=$inst/mibs
export MIBDIRS
case $1 in
start)
apachectl start
;;
stop)
apachectl stop
;;
restart)
apachectl restart
;;
*)
echo "usage: $0 { start | stop | restart }"
;;
esac
Plz help me into this.

Why can't upload files into dropbox at shutdown?

Fix as jayant say.
cat upload.sh
/home/Dropbox-Uploader/dropbox_uploader.sh upload -f /home/Dropbox-Uploader/.dropbox_uploader /home/material/* /
date >> /home/upload.log
All files in directory material can be uploaded into my dropbox with bash upload.sh.
I want to write a autorun service at shutdown to upload files into dropbox.
vim /etc/systemd/system/upload.service
[Unit]
Description=upload files into dropbox
Before=network.target shutdown.target reboot.target
[Service]
ExecStart=/bin/true
ExecStop=/bin/bash /home/upload.sh
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target
Enable it with:
sudo systemctl enable upload.service
To reboot it.
journalctl -u upload
-- Logs begin at Thu 2018-01-18 22:38:54 EST, end at Tue 2018-04-10 06:55:43 EDT. --
Apr 10 06:48:27 localhost systemd[1]: Started upload files into dropbox.
Apr 10 06:48:27 localhost systemd[1]: Starting upload files into dropbox...
Apr 10 06:48:27 localhost bash[111]: which: no shasum in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin)
Apr 10 06:48:27 localhost bash[111]: > Uploading "/home/material/test.txt" to "/test.txt"...
Apr 10 06:48:27 localhost bash[111]: Error: Couldn't resolve host.
ln -s /usr/bin/sha1sum /usr/bin/shasum according to google's result.
Reboot the second time.
journalctl -u dropbox
Apr 10 06:55:04 localhost systemd[1]: Started upload files into dropbox.
Apr 10 06:55:04 localhost systemd[1]: Starting upload files into dropbox...
Apr 10 06:55:04 localhost bash[113]: shasum: invalid option -- 'a'
Apr 10 06:55:04 localhost bash[113]: Try 'shasum --help' for more information.
Apr 10 06:55:04 localhost bash[113]: shasum: invalid option -- 'a'
Apr 10 06:55:04 localhost bash[113]: Try 'shasum --help' for more information.
Apr 10 06:55:04 localhost bash[113]: > Uploading "/home/material/test.txt" to "/test.txt"...
Apr 10 06:55:04 localhost bash[113]: Error: Couldn't resolve host.
Do as Raushan say,new issue arised,
Uploading by 4 chunks *** FAILED dropbox
For the problem Uploading by 4 chunks *** FAILED dropbox ,some material say that if files exceeding 150 mb should be uploaded in chunks.
split -b 10m /home/upload.tar.gz /home/material/dropbox
ls /home/material
dropboxaa dropboxac dropboxae dropboxag ......
Both of them is less than 10m.
journalctl -u upload
Apr 19 01:45:26 localhost systemd[1]: Started upload files into dropbox.
Apr 19 01:45:26 localhost systemd[1]: Starting upload files into dropbox...
Apr 19 01:45:27 localhost bash[401]: > Uploading "/home/material/dropboxaa" to "/dropboxaa"... FAILED
Apr 19 01:45:27 localhost bash[401]: An error occurred requesting /upload
Apr 19 01:45:28 localhost bash[401]: > Uploading "/home/material/dropboxab" to "/dropboxab"... FAILED
Apr 19 01:45:40 localhost bash[401]: Some error occured. Please check the log.
Apr 19 01:45:40 localhost systemd[1]: upload.service: main process exited, code=exited, status=1/FAILURE
Apr 19 01:45:40 localhost systemd[1]: Unit upload.service entered failed state.
Apr 19 01:45:40 localhost systemd[1]: upload.service failed.
Why > Uploading "/home/material/dropboxaa" to "/dropboxaa"... FAILED?
It is not possible that the second instruction of your script executes without executing the first one. Try redirecting the error output of the dropbox_uploader.sh to see what is failing.
Assuming you are using dropbox-uploader, try specifying the exact location of the configuration file. See Running as cron job section in their README.md
/home/Dropbox-Uploader/dropbox_uploader.sh -f /path/to/.dropbox_uploader upload /home/material/* /
For the Couldn't resolve host problem :
Unit configuration should have dependency like
After=network.target instead of Before=network.target as the default shutdown order is inverse of startup
[Unit]
Description=upload files into dropbox
Before=shutdown.target reboot.target
After=network.target
[Service]
ExecStart=/bin/true
ExecStop=/bin/bash /home/upload.sh
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target
Refer: https://serverfault.com/a/785355
For the shasum problem :
I am not sure about your OS distro, I am using Fedora 25.
In my case shasum binary is from perl-Digest-SHA package which can be installed by command yum install perl-Digest-SHA on RedHat based linux distro
Refer: https://superuser.com/a/1180163

Guacamole fails to connect to xRDP server

I have a xrdp server running and would like to connect to it using Guacamole. However, each time I try to make any RDP connection it always fails with "You Have Been Disconnected." I know it is a fault with guacamole because I can log into xRDP using Remmina RDP client using the same credentials.
Here are my Logs:
/var/run/syslog :
Jul 26 10:02:36 ubuntu guacd[1291]: Creating new client for protocol "rdp"
Jul 26 10:02:36 ubuntu guacd[1291]: Connection ID is "$0c72bf59-0ff9-448d-a5a2-dc3229157122"
Jul 26 10:02:36 ubuntu guacd[5737]: Security mode: ANY
Jul 26 10:02:36 ubuntu guacd[5737]: Resize method: none
Jul 26 10:02:36 ubuntu guacd[5737]: User "#cce2ec3d-03c5-4387-be88-054a00927f56" joined connection "$0c72bf59-0ff9-448d-a5a2-dc3229157122" (1 users now present)
Jul 26 10:02:36 ubuntu guacd[5737]: Loading keymap "base"
Jul 26 10:02:36 ubuntu guacd[5737]: Loading keymap "en-us-qwerty"
Jul 26 10:02:36 ubuntu kernel: [ 4736.455320] guacd[5749]: segfault at 8000000000 ip 0000008000000000 sp 00007f3bc9f8bc98 error 14
Jul 26 10:02:36 ubuntu kernel: [ 4736.455323] traps: guacd[5750] general protection ip:7f3bcb074c69 sp:7f3bc978ac98 error:0
Jul 26 10:02:36 ubuntu kernel: [ 4736.455323]
Jul 26 10:02:36 ubuntu kernel: [ 4736.455325] in libguac.so.5.0.0[7f3bcb070000+d000]
Jul 26 10:02:36 ubuntu guacd[1291]: Connection "$0c72bf59-0ff9-448d-a5a2-dc3229157122" removed.
/var/log/tomcat8/Catalina.out :
10:02:33.079 [http-nio-8080-exec-2] WARN o.a.g.r.auth.AuthenticationService - Authentication attempt from 0:0:0:0:0:0:0:1 for user "-------" failed.
10:02:33.943 [http-nio-8080-exec-1] WARN o.a.g.r.auth.AuthenticationService - Authentication attempt from 0:0:0:0:0:0:0:1 for user "jonathan" failed.
10:02:36.100 [http-nio-8080-exec-6] INFO o.a.g.r.auth.AuthenticationService - User "guacadmin" successfully authenticated from 0:0:0:0:0:0:0:1.
10:02:36.241 [http-nio-8080-exec-10] INFO o.a.g.tunnel.TunnelRequestService - User "guacadmin" connected to connection "3".
10:02:38.179 [Thread-7] INFO o.a.g.tunnel.TunnelRequestService - User "guacadmin" disconnected from connection "3". Duration: 1937 milliseconds
Connection settings:
security mode: any
port: 3389
I am on ubuntu server 16.04. Any possible solutions would be much appreciated.
Try:
Removing the [path to libfreerdp*.so]/freerdp/guac*.so files that were copied, assuming this is the case.
Create symbolic links within [path to libfreerdp*.so]/freerdp/ to /usr/local/lib/freerdp/guac*.so, so you do not need to worry about
this going forward.
Source: RDP stopped working v0.9.9 - Apache Guacamole.