Score:0

systemctl restart command fails

se flag

The server is a VPS running CentOS 7 64bit.

I'm trying to get the server to execute Perl scripts called by a browser (CGI). To this end I have a thread on the webmasters forum. But while trying to perform the recommended tasks to accomplish this I ran into some errors generated by the operating system. Specifically, the systemctl restart command fails.

[root@WANNABEsports /]# sudo systemctl restart httpd.service
Job for httpd.service failed because the control process exited with error code. 
See "systemctl status httpd.service" and "journalctl -xe" for details.

Ran the commands in the error and received the following:

[root@WANNABEsports /]# systemctl status httpd.service -l
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2023-03-23 06:21:48 UTC; 3min 23s ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 14999 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 14999 (code=exited, status=1/FAILURE)

Mar 23 06:21:48 WANNABEsports.name systemd[1]: Starting The Apache HTTP Server...
Mar 23 06:21:48 WANNABEsports.name httpd[14999]: (98)Address already in use: AH00073: make_sock: unable to listen for connections on address [::]:80
Mar 23 06:21:48 WANNABEsports.name httpd[14999]: (98)Address already in use: AH00073: make_sock: unable to listen for connections on address 0.0.0.0:80
Mar 23 06:21:48 WANNABEsports.name httpd[14999]: no listening sockets available, shutting down
Mar 23 06:21:48 WANNABEsports.name httpd[14999]: AH00015: Unable to open logs
Mar 23 06:21:48 WANNABEsports.name systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Mar 23 06:21:48 WANNABEsports.name systemd[1]: Failed to start The Apache HTTP Server.
Mar 23 06:21:48 WANNABEsports.name systemd[1]: Unit httpd.service entered failed state.
Mar 23 06:21:48 WANNABEsports.name systemd[1]: httpd.service failed.

and . . .

[root@WANNABEsports /]# journalctl -xe
--
-- Unit httpd.service has begun starting up.
Mar 23 06:21:48 WANNABEsports.name httpd[14999]: (98)Address already in use: AH00073: make_sock: unable to listen for connections on address [::]:80
Mar 23 06:21:48 WANNABEsports.name httpd[14999]: (98)Address already in use: AH00073: make_sock: unable to listen for connections on address 0.0.0.0:80
Mar 23 06:21:48 WANNABEsports.name httpd[14999]: no listening sockets available, shutting down
Mar 23 06:21:48 WANNABEsports.name httpd[14999]: AH00015: Unable to open logs
Mar 23 06:21:48 WANNABEsports.name systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Mar 23 06:21:48 WANNABEsports.name systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit httpd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit httpd.service has failed.
--
-- The result is failed.
Mar 23 06:21:48 WANNABEsports.name systemd[1]: Unit httpd.service entered failed state.
Mar 23 06:21:48 WANNABEsports.name systemd[1]: httpd.service failed.
Mar 23 06:21:48 WANNABEsports.name sudo[14995]: pam_unix(sudo:session): session closed for user root

I can see both contain reference to failure but don't understand what's needed to correct the situation.

HBruijn avatar
in flag
The relevant error is `Address already in use: AH00073: make_sock: unable to listen for connections on address 0.0.0.0:80` - apache can't use port 80, the default port for http, because it is already in use. That typically has one of two reasons: another web server is already using that port (and you can't have two different servers using the same port concurrently) or another apache instance is (still/already) using that port. The latter typically happens when apache httpd doesn't shut down properly. Use https://serverfault.com/q/488486/37681 to determine what is blocking port 80
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.