This is the error I'm getting when I check the HAProxy status:
[root#localhost haproxy]# systemctl status haproxy.service
● haproxy.service - HAProxy Load Balancer
Loaded: loaded (/usr/lib/systemd/system/haproxy.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code)
Process: 4947 ExecStart=/usr/sbin/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid $OPTIONS (code=exited, status=1/FAILURE)
Main PID: 4947 (code=exited, status=1/FAILURE)
These are the steps I followed to configure HAProxy
yum install haproxy
cd /etc/haproxy
mv haproxy.cfg haproxy.cfg.bak
created a haproxy.cfg file in /etc/haproxy/
systemctl restart haproxy.service
systemctl enable haproxy.service
Pointed browser to http://{IPADDRESS}/SubManagerWeb/#/main/home
Please share the config file that you created. This error is particularly not showing any related error so issue cannot be identified.
Related
I've created code server service on Ubuntu 18.04 nginx.
But gives error when run command :
systemctl status code-server
Error :
Warning: The unit file, source configuration file or drop-ins of code-server.service changed on disk. Run 'systemctl daemon-reload' to reload units.
● code-server.service - code-server
Loaded: loaded (/lib/systemd/system/code-server.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2022-09-02 17:45:29 CEST; 4min 53s ago
Process: 4749 ExecStart=/usr/bin/code-server --bind-addr 127.0.0.1:8080 --user-data-dir /var/lib/code-server --auth password (code=exited, status=203/EXEC)
Main PID: 4749 (code=exited, status=203/EXEC)
My /lib/systemd/system/code-server.service file as below
[Unit]
Description=code-server
After=nginx.service
[Service]
Type=simple
Environment=PASSWORD=xxxxxx
ExecStart=/usr/bin/code-server --bind-addr 127.0.0.1:8080 --user-data-dir /var/lib/code-server --auth password
Restart=always
[Install]
WantedBy=multi-user.target
I checked all topics, they say it's a missing path problem but I checked all paths and exists
root#xx:~# sudo mkdir /usr/lib/code-server
mkdir: cannot create directory ‘/usr/lib/code-server’: File exists
root#xx:~# sudo mkdir /var/lib/code-server
mkdir: cannot create directory ‘/var/lib/code-server’: File exists
root#xx:~#
I'm not a pro ubuntu user. What should I check ?
root#HangoutRoot:/Bot# sudo systemctl status mongod
● mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2020-06-08 08:57:25 PDT; 5s ago
Docs: https://docs.mongodb.org/manual
Process: 2241 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=48)
Main PID: 2241 (code=exited, status=48)
Jun 08 08:57:25 HangoutRoot systemd[1]: Started MongoDB Database Server.
That's what I get when I check the status of the mongodb server using sudo systemctl status mongod
Try this command : sudo systemctl enable mongod
After this:
run this command
sudo service mongod restart
If this still do not work I think reinstalling mongo would be a better solution.
To re-install mongo follow the the process of accepted answer from this link:
https://askubuntu.com/questions/884541/cant-start-mongodb-service
I have tried too many times,but I failed.
I run order in shell ,it works,but I write it to supervisor or /etc/rc.d/init.d/functions ,both failed!
/usr/sbin/rabbitmq-server start (shell works)
supervisor or /etc/rc.d/init.d/functions ,both failed!
RabbitMQ on Centos7 uses the systemd.
You have to enable the service:
sudo systemctl enable rabbitmq-server
Then try to reboot:
Last login: Tue Sep 5 07:51:49 2017 from 10.0.2.2
[vagrant#localhost ~]$ sudo systemctl status rabbitmq-server
● rabbitmq-server.service - RabbitMQ broker
Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2017-09-05 07:57:05 UTC; 20s ago
Main PID: 930 (beam.smp)
Status: "Initialized"
CGroup: /system.slice/rabbitmq-server.service
├─ 930 /usr/lib64/erlang/erts-9.0.4/bin/beam.smp -W w -A 64 -P 1048576 -t 5000000 -stbt db -zdbbl 128000 -K true -- -root /usr/lib64/erlang -progname erl -- -home /var/lib/rabbitmq -- -pa /usr/lib/rabbitmq/lib/rabbitmq_server-3.6.11.902/ebin -noshell -n...
├─1317 /usr/lib64/erlang/erts-9.0.4/bin/epmd -daemon
├─2354 erl_child_setup 1024
├─2437 inet_gethost 4
└─2438 inet_gethost 4
EDIT
It is the same for 3.3.5, see here:
[vagrant#localhost ~]$ sudo systemctl status rabbitmq-server
● rabbitmq-server.service - LSB: Enable AMQP service provided by RabbitMQ broker
Loaded: loaded (/etc/rc.d/init.d/rabbitmq-server; bad; vendor preset: disabled)
Active: inactive (dead)
Docs: man:systemd-sysv-generator(8)
[vagrant#localhost ~]$ sudo systemctl enable rabbitmq-server
rabbitmq-server.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig rabbitmq-server on
[vagrant#localhost ~]$ sudo reboot
➜ centos7 vagrant ssh
Last login: Tue Sep 5 08:04:37 2017 from 10.0.2.2
[vagrant#localhost ~]$ sudo systemctl status rabbitmq-server
● rabbitmq-server.service - LSB: Enable AMQP service provided by RabbitMQ broker
Loaded: loaded (/etc/rc.d/init.d/rabbitmq-server; bad; vendor preset: disabled)
Active: active (running) since Tue 2017-09-05 08:48:23 UTC; 9s ago
Docs: man:systemd-sysv-generator(8)
Process: 972 ExecStart=/etc/rc.d/init.d/rabbitmq-server start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/rabbitmq-server.service
├─1325 /bin/sh /etc/rc.d/init.d/rabbitmq-server start
├─1335 /bin/bash -c ulimit -S -c 0 >/dev/null 2>&1 ; /usr/sbin/rabbitmq-server
└─1339 /bin/sh /usr/sbin/rabbitmq-server
RabbitMQ version:
sudo rabbitmqctl status
Status of node rabbit#localhost ...
[{pid,1379},
{running_applications,[{rabbit,"RabbitMQ","3.3.5"},
Note:
You are using a very old RabbitMQ version, please consider to update it to the last one
I'm trying to start NFS in Fedora25
[root#localhost tftpboot]# systemctl start nfs-server.service
Failed to start nfs-server.service: Unit proc-fs-nfsd.mount is masked.
Which gave error as above and also status also shown inactive
[root#localhost tftpboot]# systemctl status nfs-server.service
nfs-server.service - NFS server and services
Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; enabled; vendor preset: disabled)
Drop-In: /run/systemd/generator/nfs-server.service.d
└─order-with-mounts.conf
Active: inactive (dead) since Thu 2017-03-30 19:02:10 IST; 2min 45s ago
Process: 4886 ExecStopPost=/usr/sbin/exportfs -f (code=exited, status=0/SUCCESS)
Process: 4883 ExecStopPost=/usr/sbin/exportfs -au (code=exited, status=0/SUCCESS)
Process: 4880 ExecStop=/usr/sbin/rpc.nfsd 0 (code=exited, status=0/SUCCESS)
Main PID: 981 (code=exited, status=0/SUCCESS)
Tried below command for unmask "sudo systemctl unmask proc-fs-nfsd.mount" then " sudo service nfs restart". it worked
How can I restart mongodb that I just killed in Linux?
Before killing:
$ service mongodb status
● mongodb.service - An object/document-oriented database
Loaded: loaded (/lib/systemd/system/mongodb.service; disabled; vendor preset: enabled)
Active: active (running) since Tue 2017-01-03 08:41:16 GMT; 4h 5min ago
Docs: man:mongod(1)
Main PID: 1036 (mongod)
Tasks: 10
Memory: 61.0M
CPU: 1min 1.636s
CGroup: /system.slice/mongodb.service
└─1036 /usr/bin/mongod --config /etc/mongodb.conf
So I wanted to stop/ kill it for a while for other programs:
$ sudo kill 1036
$ service mongodb status
● mongodb.service - An object/document-oriented database
Loaded: loaded (/lib/systemd/system/mongodb.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:mongod(1)
But how can I start it again?
I'm on Ubuntu 16.04.
EDIT:
$ systemctl start mongod
Failed to start mongod.service: Unit mongod.service not found.
EDIT 2:
Get this error below when I have the other program running on mondodb. so I killed that program and it works as before.
$ sudo systemctl start mongodb
$ service mongodb status
● mongodb.service - An object/document-oriented database
Loaded: loaded (/lib/systemd/system/mongodb.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2017-01-03 13:05:19 GMT; 9s ago
Docs: man:mongod(1)
Process: 21732 ExecStart=/usr/bin/mongod --config /etc/mongodb.conf (code=exited, status=48)
Main PID: 21732 (code=exited, status=48)
Ubuntu 16.04 LTS
sudo systemctl start mongodb
Not only for MongoDB, but for any application installed, you can use
sudo systemctl start <app_name>
sudo systemctl restart <app_name>
Seems like you are using systemd
Try:
systemctl start mongod -> Start the service
systemctl status mongod -> Status of service
systemctl restart mongod -> restart the service
systemctl reload mongod -> reload the service
You checked status with :
service mongod status
so this should start mongod:
service mongod start
so this should stop mongod:
sudo service mongod stop
It works at my end.
for missing permissions:
sudo service mongod start