My firewall is currently inactive.
# systemctl status firewalld
firewalld.service
Loaded: masked (/dev/null)
Active: inactive (dead)
I used the following command to enable the firewall
$systemctl unmask firewalld
but I got this error
# systemctl unmask firewalld
Failed to issue method call: Access denied
Please advise.
Thanks in advance!
Try this:
systemctl unmask firewalld
return: Removed symlink /etc/systemd/system/firewalld.service.
After that, you can:
systemctl restart firewalld
Try this:
sudo systemctl restart firewalld
sudo systemctl enable firewalld
But before you should install firewalld. You can use yum for that:
sudo yum install firewalld
Related
When I want to start the firewalld service, I got this error
[root#servera ~]# systemctl start firewalld
Failed to start firewalld.service: Unit firewalld.service is masked.
and I searched in the web and got a solution that run systemctl unmask firewalld, but it is not working, others get a message Removed symlink /etc/systemd/system/firewalld.service. but I got nothing.
When I want to enable this service, I got an error
[root#servera ~]# systemctl enable firewalld
Failed to enable unit: Unit file /usr/lib/systemd/system/firewalld.service is masked.
It's abnormal, because it's /usr/lib/systemd/system/firewalld.service, not /etc/systemd/system/firewalld.service
Any hints? Thanks!
I have tried
systemctl unmask firewalld
but it's no response and not working
I'm getting this error kibana server is not ready yet can anyone help.
Just stop and start your kibana service.
sudo systemctl stop kibana.service
sudo systemctl start kibana.service
Restart the Kibana By using following cmnds
sudo service kibana stop
sudo service kibana start
I have an application for which I've written a myapp.service file and created a symlink for it in /etc/systemd/system/.
The myapp.service file is like this:
[Unit]
Description=My Application
After=network.target
[Service]
Type=simple
Restart=always
RestartSec=1
StartLimitInterval=0
User=myuser
ExecStart=/var/opt/myapp/myapp
[Install]
WantedBy=multi-user.target
I can use systemctl start myapp, systemctl stop myapp, systemctl status myapp to start, stop, and view the status of the service, and it works very well. I was hoping I could also use systemctl enable myapp, systemctl disable myapp, and systemctl is-enabled myapp to control whether myapp is automatically launched when the system is booted up. When I ran systemctl is-enabled myapp, it showed linked as the output. So I tried systemctl disable myapp and it deleted the symlink to /etc/systemd/system/myapp.service (the output was: Removed symlink /etc/systemd/system/myapp.service.). After that I couldn't run systemctl enable myapp, it just gave this output: Unit myapp.service could not be found.
What is the correct way to create a service such that it can be enabled and disabled with systemctl? I even tried doing it with sshd and was not able to enable after disabling it.
$ systemctl is-enabled sshd
enabled
$ systemctl disable sshd
Removed /etc/systemd/system/multi-user.target.wants/ssh.service.
Removed /etc/systemd/system/sshd.service.
$ systemctl is-enabled sshd
Failed to get unit file state for sshd.service: No such file or directory
$ systemctl enable sshd
Failed to enable unit: Unit file sshd.service does not exist.
Ultimately I just need to ensure that the application does not start at bootup, but can still be controlled with systemctl start myapp, systemctl stop myapp, systemctl status myapp. Does the linked status from systemctl is-enabled myapp mean it will not start at bootup? I tried checking the man page of systemctl, but couldn't find that state.
I can't reproduce on debian (version 244.3-1)
I created /etc/systemd/system/test.service:
me ~ $ sudo systemctl cat test.service
# /etc/systemd/system/test.service
[Unit]
Description=Test
[Service]
Type=oneshot
ExecStart=/bin/true
[Install]
WantedBy=multi-user.target
me ~ $ sudo systemctl enable test.service
Created symlink /etc/systemd/system/multi-user.target.wants/test.service → /etc/systemd/system/test.service.
me ~ $ sudo systemctl disable test.service
Removed /etc/systemd/system/multi-user.target.wants/test.service
As expected, enable/disable creates/deletes a symbolic link to your service in /etc/systemd/system/multi-user.target.wants/. It does not touch /etc/systemd/system/*.service.
I also see that my console messages are slightly different. Which distro/version are you using?
Ubuntu 16.04.1 LTS
I have tried:
sudo update-rc.d -f postgresql remove
and
sudo vim /etc/postgresql/9.5/main/start.conf
then i change the word "auto" to "disabled"
Then i reboot the computer, and when it starts, i login and do:
sudo service --status-all | grep postgresql
Which returns:
[ + ] postgresql
So it is still starting when the server starts.
What is left for me to do? I don't want this service running when the computer starts, only when i manually start it with:
sudo service postgresql start
Use systemctl command to manage postgresql service:
stop service:
systemctl stop postgresql
start service:
systemctl start postgresql
show status of service:
systemctl status postgresql
disable service(not auto-start any more)
systemctl disable postgresql
enable service postgresql(auto-start)
systemctl enable postgresql
Ok. it's fixed thanks to Koen De Groote.
I did:
echo manual | sudo tee /etc/init/postgresql.override
and
sudo systemctl disable postgresql.service
and
sudo systemctl disable postgresql
....I don't know which one of them did it, but its not starting any more... Thank you...
I am trying to add Docker’s public key for CS packages using the following command( which is taken from the link https://docs.docker.com/docker-trusted-registry/install/install-csengine/):
sudo rpm --import "https://sks-keyservers.net/pks/lookup?op=get&search=0xee6d536cf7dc86e2d7d56f59a178ac6c6238f52e"
However, I am getting the following error on running the above command:
curl: (6) Could not resolve host: sks-keyservers.net; Name or service not known
error: https://sks-keyservers.net/pks/lookup?op=get&search=0xee6d536cf7dc86e2d7d56f59a178ac6c6238f52e: import read failed(2).
Is it a firewall issue??
Please let me know if I need to add a host entry in /etc/hosts?
This problem is caused by your firewall, enable / disable it and try again
systemctl disable firewalld
systemctl stop firewalld
or
systemctl enable firewalld
systemctl start firewalld