Can't start ceph service - systemd

I working on CentOS7 and I install ceph by manual build
./autogen.sh
./configure
make
make install
and manual deploy by follow this link http://ceph.com/docs/master/install/manual-deployment/
but ceph doesn't exist in directory /etc/rc.d/init.d/
Failed to issue method call: Unit ceph.service failed to load: No such
file or directory
So, I can't start service.
In document of manual deploy it's said I have to use command
sudo /etc/rc.d/init.d/ceph start mon.node1

In CentOS7 use systemd
So, use command sudo systemctl start ceph-osd#0 will work!!!

You can run systemctl status ceph* as a quick way to show any services on the box or systemctl list-units --type=service | grep ceph the service name syntax is ceph-mon#<hostname>.service or ceph-osd#<osd_num>.service

Please run systemctl list-unit-files and you can list all ceph services and you must find OSD number with ceph osd tree and put in this command systemctl status ceph-osd#{OSD_NUM}.target

Related

How to start Memgraph database on Ubuntu?

I know that there are two ways to run Memgraph on Ubuntu:
sudo systemctl start memgraph
sudo service memgraph start
Is there a preferred way to run Memgraph?
I've seen that if Ubuntu is run as WSL that the command for running it is sudo runuser -l memgraph -c '/usr/lib/memgraph/memgraph'. Can I use this command also on standalone Ubuntu installation, or is this one only for WSL?
systemctl interacts with systemd which is an init(and manager) system. When the Linux kernel is booted, there are some services that must start, etc. These are managed by systemd which is controlled by systemctl. service is the same as systemctl but for older systems which do not use systemd as their init system.
This command is simply running the executable placed in /usr/lib/memgraph/memgraph with the user memgraph.
The difference between these two is that the latter one won't start on the startup while the first one will.

Failed to restart supervisor.service: Unit not found CentOS 7

I am trying to use laravel queue:work on live server and keep alive the work using Supervisor. After configuration it shows as follows:
[root#vmi485931 supervisord.d]# sudo supervisorctl reload
Restarted supervisord
[root#vmi485931 supervisord.d]# sudo service supervisor restart
Redirecting to /bin/systemctl restart supervisor.service
Failed to restart supervisor.service: Unit not found.
Any clue?
there are some package missing in Centos 7. i had some issue on centos 7 and i fixed issue with this commands :
1- need python-meld3 package
sudo rpm -ivh https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/p/python-meld3-0.6.10-1.el7.x86_64.rpm
2-needs supervisor lib.
sudo rpm -ivh https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/s/supervisor-3.4.0-1.el7.noarch.rpm
If you are trying to restart the processes that are run by supervisor, run
sudo supervisorctl restart all
You can use supervisor process name instead of 'all' to restart a specific process.
If you are trying to restart supervisor itself,sudo systemctl restart supervisor should work.

Failed to start ansibled.service: Unit not found

I couldn't start my ansible server installed in Centos/7 yet the installation works properly, any help plz
[vagrant#ansible-server ~]$ sudo systemctl status ansibled
Unit ansibled.service could not be found.
[vagrant#ansible-server ~]$ sudo systemctl start ansibled
Failed to start ansibled.service: Unit not found.
Ansible is not a Linux system Service. The command you are using is use for any service which is install on the linux. Just use Ansible command to run your playbook or adhoc command.

Supervisor no such file socket.py

I am trying to setup a queue listener for laravel and cannot seem to get supervisor working correctly. I get the following error when I run supervisorctl reload:
error: <class 'socket.error'>, [Errno 2] No such file or directory: file: /usr/lib/python2.7/socket.py line: 228
The file DOES exist. If try to run sudo supervisorctl I get this
unix:///var/run/supervisor.sock no such file.
I've tried reinstall supervisor and that did not work either. Not sure what to do here.
I'm running Laravel Homestead (Ubuntu 16.04).
Result of service supervisor status:
vagrant#homestead:~/Code$ sudo service supervisor status
● supervisor.service - Supervisor process control system for UNIX
Loaded: loaded (/lib/systemd/system/supervisor.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Thu 2016-12-22 11:06:21 EST; 41s ago
Docs: http://supervisord.org
Process: 23154 ExecStop=/usr/bin/supervisorctl $OPTIONS shutdown (code=exited, status=0/SUCCESS)
Process: 23149 ExecStart=/usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf (code=exited, status=2)
Main PID: 23149 (code=exited, status=2)
You should run sudo service supervisor start when you are in the supervisor dir.
Worked for me.
2020 UPDATE
Try running sudo service supervisor start in your terminal before using the below solution. I found out that the issue sometimes occurs when supervisor is not running, nothing complicated.
I am using Ubuntu 18.04. I had the same problem and re-installing supervisor did not solve my problem.
I ended up completely removing the conf.d directory and recreating it with new configs. Make sure you back up your configurations before trying this:
sudo rm -rf /etc/supervisor/conf.d/
sudo mkdir /etc/supervisor/conf.d
sudo nano /etc/supervisor/conf.d/my-file.conf
Copy+Paste your configuration into your new file.
sudo supervisorctl reread started working again.
In Ubuntu 18.04 with distribution's package
You probably did the same mistake as me an created the config file /etc/supervisord.conf while my service manager (systemd) was using the config file /etc/supervisor/supervisord.conf
Solutions
Remove the config file created
sudo rm /etc/supervisord.conf
Move it to the correct location
sudo mv /etc/supervisord.conf /etc/supervisor/supervisord.conf
Now you can run sudo supervisorctl
Why?
when you run supervisorctl it first searches for the config file located at /etc/supervisord.conf, if it's not present, it will search for the package's default file /etc/supervisor/supervisord.conf this is the one systemd actually runs.
Systemd always use the file /etc/supervisor/supervisord.conf regardless of the other file's existence.
You can check which file is using systemd by running sudo systemctl status supervisor
You can see in the last line the command where the config file is hardcoded
I had a very similar problem (Ubuntu 18.04) and searched similar threads to no avail so answering here with some more comprehensive answers.
Lack of a sock file or socket error is only an indicator that supervisor is not running. If a simple restart doesn't work its either 1. not installed, or 2. failing to start. In my case nothing was being logged to the supervisor.log file for me to know why it was failing until I ran the following command (-n to run in foreground) only to find out that there was a leftover configuration file for a project that had been deleted that I missed.
/usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf
Once I deleted the bad/leftover file in the conf.d folder and started it back up with sudo service supervisor start everything worked.
Here are some comprehensive steps you can take.
Is supervisor installed? dpkg -l | grep supervisor If not reinstall sudo apt install supervisor
Are all instances of supervisor stopped? systemctl stop supervisor Lingering supervisor processes can be found ps aux | grep supervisor then kill -9 PID.
Is supervisor.conf in the right location /etc/supervisor/supervisor.conf and there are no syntax errors? Reinstall from package would correct this.
Move your specific files in conf.d/ temporarily out of the folder to try and start with no additional config files. If it starts right up sudo service supervisor start the likelihood of an error in your project .conf file exists.
Check status with sudo service supervisor status.
Move your .conf files one by one back into conf.d/ and restart sudo service supervisor restart. Be sure to check with sudo service supervisor status between. If it fails you know which .conf file has an issue and can ask for specific help.
check everything is running with supervisorctl status and if not start with supervisorctl start all.
None of about answers helped me.
the problem was i didn't follow supervisor documentation.
and a step i didn't do was run echo_supervisord_conf command that makes the configuration file.
Steps i did for Ubuntu 18.04:
Installing supervisor (without pip):
sudo apt-get install supervisor
echo_supervisord_conf > /etc/supervisord.conf (with root access: first run sudo -i then echo_supervisord_conf > /etc/supervisord.conf)
change python dependency to python2
(Depends: python-pkg-resources, init-system-helpers (>= 1.18~), python-meld3, python:any (<< 2.8), python:any (>= 2.7.5-5~)
in these files: /usr/bin/supervisord | /usr/bin/supervisorctl | /usr/bin/echo_supervisord_conf.
Just change the first line from #!/usr/bin/python to #!/usr/bin/python2
run supervisord
Finish
hope help !
Facing the python file not found an error, code=exited, status=2 once I try with the official document but still same.
I have tried so many solutions for my laravel application.
But at last, I have tried with my solution.
Here is an example for the code :
[program:dev-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/example.com/artisan queue:work --sleep=3 --tries=3
autostart=true
autorestart=true
user=ubuntu
numprocs=8
redirect_stderr=true
stdout_logfile=/var/www/html/example.com/storage/logs/laravel.log
stopwaitsecs=3600
Ref: https://laravel.com/docs/7.x/queues#supervisor-configuration
I ended up just removing supervisor entirely, reinstalling and rewriting my config files. I must have just done something wrong in the process and wasn't able to catch it.
You can try by removing all of the related folder of supervisor & uninstall supervisor completely.
sudo rm -rf /var/log/supervisor/supervisord.log
sudo rm -rf /etc/supervisor/conf.d/
After doing this, reinstall supervisor by
sudo apt install supervisor
Now, you can run correctly. Check with
sudo systemctl status supervisor
If by running sudo service supervisor status you get the following:
ExecStart=/usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf (code=exited, status=2)
Try running /usr/bin/supervisord, it will give you clear message to tell you where the error is.
On Centos 7 I use the following...
supervisord -c /path/to/supervisord.conf
followed by...
supervisorctl -c /path/to/supervisord.conf
This gets rid of the ".sock file not found" error. Now you have to kill old processes using...
ps aux|grep gunicorn
Kill the offending processes using...
kill <pid>
Then again...
supervisorctl -c /path/to/supervisord.conf
Supervisor should now be running properly if your config is good.
Check the supervisord.conf file.
Look for the following:
[unix_http_server]
file=/path/to/supervisor.sock/file ; (the path to the socket file)
chmod=0700 ; sockef file mode(default 0700)
Go to the path mentioned above and check if the file is present.
If it is present then try re-installing supervisor.
If not then search for supervisor.sock file either using the command line or file explorer GUI.
Copy the file found in the above step to the location specified in the [unix_http_server] by using the cp command or GUI.
For me, the supervisor.sock was present in the /run folder.
you can try
sudo touch /var/run/supervisor.sock
sudo chmod 777 /var/run/supervisor.sock
I ran into this issue because we were using supervisorctl to manage gunicorn. The root of my problem had nothing to do with supervisor (it was handling other processes just fine) or the python sock.py file (file was there, permissions were correct), but rather the gunicorn config file /etc/supervisor/conf.d/gunicorn.conf. This configuration file was managed by a source-controlled template with environment variables and when we updated the template on the server, the template variables were never replaced with the actual data. So for example something in the gunicorn.conf file read user={{ user }} instead of user=gunicorn. When supervisor tried to parse this config when running supervisorctl start gunicorn it would crash with this socket error. Repairing the gunicorn.conf file resolved the supervisor issue.
Source of answer : http://supervisord.org/installing.html
Run command : echo_supervisord_conf
Once you see the file echoed to your terminal, reinvoke the command as echo_supervisord_conf > /etc/supervisord.conf. This won’t work if you do not have root access.
If you don’t have root access, or you’d rather not put the supervisord.conf file in /etc/supervisord.conf, you can place it in the current directory (echo_supervisord_conf > supervisord.conf) and start supervisord with the -c flag in order to specify the configuration file location.
The error should've been resolved by now.
I did the following to solve the issue on CentOS Linux 7
sudo systemctl status supervisord.service
With the above command, I realise that the program was in active
sudo systemctl start supervisord.service
Now I use the command above to start the service and everything works well now

apache mesos is not recognized as a service in a ubuntu linux environment

Hi I am trying to install apache mesos in my ubuntu based system. I have installed zookeeper and marathon along with this setup.
apt-get install mesos marathon
it says its success but when i try to see available services systems does not show mesos-master or slaves as available services. also
service mesos-master/slave start
says unrecognized service. any idea?
I had the same issue, so after trying multiple tricks .. I found that you can start the mesos-master using the following command:
mkdir ~/workdir; sudo mesos master --work_dir=/home/azureuser/wokdir&
Some documentation has not matched actual installations for me - Mesos may installed to be managed by upstart/systemd kinds of commands rather than service. Most recently for me, a CentOS 6.6 install of Mesos has landed in upstart-managed territory, e.g.:
start mesos-master
stop mesos-master
status mesos-master
YMMV, but that's what I've recently seen.
I faced same issue, I was not able to start mesos-master on UBUNTU-14.04 although I double checked installation and zookeeper service started successfully and tested well.
I found work around to start mesos-master service.
$ cd /usr/sbin/
$ sudo ./mesos-master --work_dir=/var/lib/mesos --log_dir=/home/rajeev/logs/mesos/
above command run mesos-master service successfully [But sudo service mesos-master start command failed to start mesos master node]

Resources