Systemctl error

Support for security such as Firewalls and securing linux
Post Reply
sadue
Posts: 55
Joined: 2016/01/08 19:08:26

Systemctl error

Post by sadue » 2016/01/09 15:53:45

Hey

I cannot start a service on my server. any time I tried it, one error or the other will emerge. When I contacted my host provider, they told me that #selinux was enabled on my server but they have disabled it now. When I tried again to start a service, the issue continued. Bellow is a sample error and the command I typed in.
[root@server2 ~]# chkconfig --levels 3 httpd on
Note: Forwarding request to 'systemctl enable httpd.service'.
[root@server2 ~]# service httpd start
Redirecting to /bin/systemctl start httpd.service
Please what should I do to by pass this. How will I check my server for known issues that might hinder my work. Am quite new to this issue of vps.
Attachments
server error.PNG
server error.PNG (12.7 KiB) Viewed 7037 times

User avatar
TrevorH
Forum Moderator
Posts: 26582
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Systemctl error

Post by TrevorH » 2016/01/09 17:39:02

The screenshots you included show no indication of any errors. You have CentOS 7 which no longer uses chkconfig and service commands: they have both been replaced by the systemd command systemctl but there are backwards compatibility scripts in place that convert chkconfig and service into systemctl commands for you: hence the "Forwarding request to..." lines you see. These are not errors, they are information - you are expected to look at those and see the relevant systemctl commands you should use instead of the chkconfig/service ones you issued and use those in future.

When you start the service, how are you determining that it is not starting? I see no systemctl status httpd.service commands for example.
When I contacted my host provider, they told me that #selinux was enabled on my server but they have disabled it now.
Time to find a smarter hoster then. You should _never_ disable selinux. Now you'll have to turn it back on again. To do that, first check in /etc/sysconfig/selinux and see if they did disable it or just set it to permissive. If it says disabled then change that to permissive first, then touch /.autorelabel && reboot and wait while it relabels the filesystem and once your server comes back up again (which may take a little longer than usual because of the relabel), then edit the /etc/sysconfig/selinux file again and change permissive to enabled and touch /.autorelabel && reboot again. Then tell your hoster to never disable selinux again.

As to the problem of httpd not starting: are you sure it's not running but inaccessible due to the firewall? On CentOS 7, it uses firewalld by default and you manipulate its firewall rules using the firewall-cmd command. For example, firewall-cmd --enable-service=httpd would allow http requests through. That needs to be run again with the --permanent switch to make the change persistent over a reboot.
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

sadue
Posts: 55
Joined: 2016/01/08 19:08:26

Re: Systemctl error

Post by sadue » 2016/01/09 18:22:29

Thank you very much for your inept analysis of this issue.

Can you help me with the backward compatibility script you mention about with details of how to go about it, and also the service command for the centOS 7.

User avatar
TrevorH
Forum Moderator
Posts: 26582
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Systemctl error

Post by TrevorH » 2016/01/09 18:40:35

I did. Read my reply again. I told you everything you need to know about systemctl and every time you run chkconfig or service then _it_ tells you too.
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

sadue
Posts: 55
Joined: 2016/01/08 19:08:26

Re: Systemctl error

Post by sadue » 2016/01/10 21:04:44

Thanks very much @Trevorh

Your directive worked well as expected. My installations are now flowing well. Am very glad.

Post Reply

Return to “CentOS 7 - Security Support”