Re: Run Control for Apache in Fedora 25

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Brilliant, so glad you got it sorted :)

Cheers
Mitch



From: John Iliffe <john.iliffe@xxxxxxxxx>
Reply: users@xxxxxxxxxxxxxxxx <users@xxxxxxxxxxxxxxxx>
Date: 28 March 2017 at 6:08:33 PM
To: users@xxxxxxxxxxxxxxxx <users@xxxxxxxxxxxxxxxx>
Subject:  Re: [users@httpd] Run Control for Apache in Fedora 25

First, my sincere thanks to all the folks who responded so fast to my
problem. I have it fixed, I think. Testing so far seems to work as
expected.

The problem is that when "systemctl enable" generates the new unit file
(httpd.service) it didn't get it quite right. For one thing, it dropped
apachectl from the start up and used httpd directly. For another, the pid
file was being written to a directory that was transient, as noted in the
post by Mikael. In this case I had the reason in my initial post but
didn't understand it.

So.....

the solution is to generate a new unit file (read man page systemd.service)
and force the parameters you need. Delete the one generated by systemctl.
be sure that all of the related configuration files (httpd.service,
httpd.conf, init.d/httpd) match as far as where the files are going.

I used the sample in Stack Overflow suggested by Mitchell, modified a bit to
match my installation. This works one for me.

-------------------------------------------
[Unit]
Description=The Apache HTTP Server

[Service]
Type=forking
EnvironmentFile=/usr/apache-2.4.25/bin/envvars
PIDFile=/var/run/httpd.pid
ExecStart=/usr/apache-2.4.25/bin/apachectl -k start
ExecReload=/usr/apache-2.4.25/bin/apachectl -k graceful
ExecStop=/usr/apache-2.4.25/bin/apachectl -k stop
KillSignal=SIGCONT
PrivateTmp=true

[Install]
WantedBy=multi-user.target
---------------------------------------------

Regards,

John
========================================
On Tuesday 28 March 2017 10:35:44 Kartik Vashishta wrote:
> Maybe this will help:
> http://stackoverflow.com/questions/32977557/how-do-i-compile-apache-http
> d-2-4-16-with-systemd-support
>
> On Tue, Mar 28, 2017 at 9:35 AM, John Iliffe <john.iliffe@xxxxxxxxx> wrote:
> > Thank you Mickey.
> >
> > That is exactly what the problem is; all /var/run subdirectories get
> > deleted on reboot.
> >
> > I tried to move the pid file to another location, for a start its
> > default location under the apache install directory, but even
> > directly on /var/run/, with the result that systemctl could not find
> > it. The pid file was written correctly, under the correct name, and
> > was readable by root, but was reported as missing by systemctl and as
> > a result the "systemctl stop httpd" command didn't work. It just
> > issued an error message and httpd kept right on running.
> >
> > One trhing that I have been careful to do is keep the start up script
> > at init.d/httpd pointed at the same location as httpd.conf.
> >
> > I'm not sure why but systemctl seems to insist that that the httpd pid
> > file be exactly /var/run/httpd/httpd.pid .
> >
> > I think there must be a configuration parameter somewhere for
> > systemctl but I have not been able to find it; can't believe it would
> > be hard coded in the
> > programme!
> >
> > That said, thank you for the reply. It does give me the idea that I
> > am on the right track.
> >
> > John
> > ===========================================
> > ==============snip========================

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux