LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   issue with 'service' command (https://www.linuxquestions.org/questions/fedora-35/issue-with-service-command-470188/)

vortmax 08-02-2006 03:19 PM

issue with 'service' command
 
I'm attempting to configure my webserver, and regardless of the issues I'm having with it, I'm running into a strange error with the 'service' command.

When the httpd service is not running, i can use 'service httpd start' and it works. No issues.

when I use 'service httpd stop' It just plain fails without any other indication.

When I try to use 'service httpd restart' I get this:

Code:

Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs

I assume what happens is that restart just issues the stop and start command together, and when the stop command fails, the start command gives that error since the service is still running.

So to stop the service, luckily it prints the PID in a file in the logs directory. So all I have to do is open that file, read the number, then run 'kill ######' to stop the process.

Any idea why the service command would work to start the service, but not stop it? This happens regardless if I'm logged in as root, or if I su - in.

benjithegreat98 08-02-2006 03:54 PM

Does the same thing happen if you issue the command "/etc/init.d/httpd restart" or stop and start ?

If so then the problem lies with apache and not the services command.

Edit: and have you made configuration changes to apache?

vortmax 08-02-2006 04:00 PM

yes, same thing happens with "/etc/init.d/httpd restart"

what sort of configuration changes? I'm running a different version in a different location then what came in the Fedora 5 release.

benjithegreat98 08-02-2006 04:07 PM

Perhaps something will be in either your access_log or error_log .

Mine are in /var/log/httpd/ Since yours is different they may be elsewhere. But try to start it and restart it then do something like a "tail -n 35 error_log" and see if anything pertinent comes up.

vortmax 08-02-2006 04:11 PM

only thing that shows up in the logs is

Code:

[Wed Aug 02 11:49:25 2006] [notice] caught SIGTERM, shutting down
[Wed Aug 02 11:49:44 2006] [notice] Apache/2.2.2 (Unix) configured -- resuming normal operations

when I do the manual kill and restart. When it fails, it doesn't print anything. Although in the error message it gives, it mentions not being able to access the logs. I wonder if there is a config file somewhere that the service command is reading that isn't set correctly.

benjithegreat98 08-08-2006 01:26 PM

You know if you are running a different version and in a different location than the one that came with FC5, maybe it is reading from the config file that came with FC5. Did you have the FC5 version of apache installed when you installed the other one? You can find out by typing "rpm -qa|grep httpd"

The startup file /etc/init.d/httpd assumes that everthing like config files are where the fedora developers put everything.


All times are GMT -5. The time now is 09:35 AM.