I would disable Ctrl-Alt-Delete in my CentOS server so I tried:
systemctl mask ctrl-alt-delete.target
but I got:
Failed to execute operation: Access Denied
What can I do ?
PS: I'm root on the server
This can happen when you try to enable a service that does not exist, but is not specific to 'systemctl mask ctrl-alt-delete.target':
> systemctl enable blabla
Failed to execute operation: Access denied
Looks like this is a Centos / Fedora etc. issue.
If you run 'setenforce 0' you will get a better error:
> setenforce 0
> systemctl enable blabla
Failed to execute operation: No such file or directory
Don't forget to re-enable:
> setenforce 1
> getenforce
Enforcing
In Ubuntu you will get the above error without running setenforce 0
Please execute the following commands in order:
sudo systemctl daemon-reexec
sudo systemctl daemon-reload
Worked for me.
During the upgrade of Debian or Ubuntu server you may encounter strange failing of scripts which are restarting services.
For some reason it’s not possible to call systemcl and any operation fails with Access denied even for root.
Here is example:
systemctl list-units
Failed to list units: Access denied
The fix to this problem it is sufficient to send TERM signal to process with PID #1:
kill -TERM 1
Credits: https://georgik.rocks/systemctl-failed-to-list-units-access-denied/
i have meet it in arch linux, when i use common user to run systemctl enable, it's like Access denied, when i use a root user to run it's, i resolve it, place.
Run below command and try again. We will be found a new way if this not worked
su -
Use systemctl daemon-reexec
It's safer than setenforce 0
Related
I am trying to install OpenStack on CentOS 7 using PackStack. The commands I am using for installation are:
sudo systemctl disable NetworkManager
sudo systemctl stop NetworkManager
sudo systemctl disable firewalld
sudo systemctl stop firewalld
sudo systemctl enable network
sudo systemctl start network
sudo yum update -y
sudo yum install centos-release-openstack-train
sudo yum install -y openstack-packstack
After this I am editing Neutron Db Sync timeout form 300 to 900, by using the command:
sudo nano /usr/share/openstack-puppet/modules/neutron/manifests/db/sync.pp
The last command I am using for installation is
sudo packstack --allinone
All installation goes well, but in the end getting the following error:
ERROR : Error appeared during Puppet run: 10.0.2.15_controller.pp
Error: /Stage[main]/Cinder::Db::Sync/Exec[cinder-manage db_sync]: Failed to call refresh: Command exceeded timeout
You will find full trace in log /var/tmp/packstack/20210527-145513-WSj_DO/manifests/10.0.2.15_controller.pp.log
Please check log file /var/tmp/packstack/20210527-145513-WSj_DO/openstack-setup.log for more information
Additional information:
* Parameter CONFIG_NEUTRON_L2_AGENT: You have chosen OVN Neutron backend. Note that this backend does not support the VPNaaS or FWaaS services. Geneve will be used as the encapsulation method for tenant networks
* A new answerfile was created in: /root/packstack-answers-20210527-145514.txt
* Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components.
The content of /var/tmp/packstack/20210527-145513-WSj_DO/manifests/10.0.2.15_controller.pp.log is uploaded here:
The content of /var/tmp/packstack/20210527-145513-WSj_DO/openstack-setup is uploaded here
Can someone help me out to resolve this error? Thanks in advance.
I made this service:
#!/bin/bash
node ../../home/NodeServer/server.js
All it should do is start the server on bootup, so i wanted to do
sudo systemctl enable startServer.service
But I got this error:
startServer.sh.service is not a native service, redirecting to systemd-sysv-insall.
Executing: /lib/systemd/systemd-sysv-install enable startServer.sh
update-rc.d: error: startServer.sh Default-Start contains no runlevels, aborting.
When i try to do
sudo systemctl start startServer.service
it works like intended.
I had the same problem. I solve it typing again the file because it seems that there was a strange character that was broken the parser. Hope this helps!
You want to execute a script, which is not the same as a service.
You can make a file called startServer.service and write the following into it:
[Unit]
Description=Start server that does a thing
[Service]
ExecStart=node /home/NodeServer/server.js
If you want to enable the service, do the following:
sudo ln -s /home/NodeServer/startServer.service /etc/systemd/system/
and now you should be able to start the service.
I have been racking my brain on this issue, and probably have tried every possible solution ( fix, purge, reinstall), but postgresql doesn't start
rupin#linuxbox:~$ sudo /etc/init.d/postgresql restart
[sudo] password for rupin:
Restarting PostgreSQL 10 database server
Failed to issue method call: Unit postgresql#10-main.service failed to load: No such file or directory. See system logs and 'systemctl status postgresql#10-main.service' for details.
The Log file is empty. There is no postmaster.pid file that could be to blame.
My Ubuntu Laptop crashed and the DB was active when the system crashed.
Can someone advise what I can do to fix this issue and start the server again?
**Update **
rupin#linuxbox:~$ systemctl status postgresql#10-main.service
Failed to issue method call: No such interface 'org.freedesktop.DBus.Properties' on object at path /org/freedesktop/systemd1/unit/postgresql_4010_2dmain_2eservice
Become OS user postgres.
Try to start PostgreSQL with
pg_ctl start -D /etc/postgres/10/main
(Use the path where postgresql.conf resides.)
Then you will see the error and you will know what to do about it.
I followed the instructions of the answer from https://askubuntu.com/questions/873091/postgresql-fails-to-reinstall-after-upgrading-ubuntu-12-04-to-14-04
I ended up removing systemd
sudo apt-get purge systemd && sudo apt-get autoremove
And I was able to reinstall postgres. Unfortunately, I lost my data/cant trace it. It is okay for me, because it is my local DB
mongo connection failed in terminal every time after ubuntu startup then after running the command sudo service mongod start it is working fine. I am using ubuntu 18.04. How to fix it that it may run always without the above command?
Try below:
sudo systemctl enable mongod
Reboot your machine and check if the service is up.
sudo systemctl status mongod
Checking out the manpage will give you a lot of information.
See systemctl manpage
http://manpages.ubuntu.com/manpages/cosmic/en/man1/systemctl.1.html
I am trying to integrate flocker with docker, for that I found plugin flocker-docker-plugin. I installed it by using the commands on my flocker agents.-
$ yum install -y clusterhq-flocker-docker-plugin
$ systemctl enable flocker-docker-plugin
$ systemctl restart flocker-docker-plugin
It shows flocker-docker-plugin is running. However after few seconds when I checked status by using $ systemctl status flocker-docker-plugin, I got error saying
flocker-docker-plugin.service: main process exited, code=killed, status=11/SEGV
Based on the information you have given there could be multiple reasons for this error:
Check if you can reach the flocker control service and more so if your node-agents can reach the control-service.
Check if the flocker-dataset-agent and the flocker-container-agent are running on your nodes.
Check if you have provided certificates for the flocker-docker-plugin as mentioned on their site (https://docs.clusterhq.com/en/latest/docker-integration/generate-api-plugin.html).
While installing flocker i also got the same error as we have just installed the docker plugin and by default it does't start's up.
First use the command systemctl start flocker-docker-plugin and then check the running status of flocker using systemctl status flocker-docker-plugin
Make sure the control service and dataset agent are running correctly first, you can find logs by looking in /var/log/flocker/, journalctl -u flocker-dataset-agent or running flocker-diagnostics.
Read through any error in these logs such as communication with control service issues, certificates issues, agent.yml config issues etc, or feel free to post them for more help.
You can also find flocker-docker-plugin logs the same way to see specific errors that may be occurring.
Here is more information about how to debug flocker.