Welcome! Log In Create A New Profile

Advanced

"make install" of php-fpm-0.6 overwrites "/etc/php-fpm.conf" and "/etc/init.d/php-fpm"

Posted by Martin 
All files from this thread

File Name File Size   Posted by Date  
fpm-rev-93-make-install.patch 16.1 KB open | download dreamcat4 10/09/2009 Read message
fpm-rev-93-make-install-2.patch 18.3 KB open | download dreamcat4 10/10/2009 Read message
patch-update-1-2.diff 7.6 KB open | download dreamcat4 10/10/2009 Read message
"make install" of php-fpm-0.6
overwrites:
"/etc/php-fpm.conf"
and
"/etc/init.d/php-fpm"

i think that overwriting existing files isn't a good behavior in this
case...

thank you in advice
Re: "make install" of php-fpm-0.6 overwrites "/etc/php-fpm.conf" and "/etc/init.d/php-fpm"
October 08, 2009 04:44PM
should have a conditional check if php-fpm.conf exists... if not, then
put it there.

ideally something to check the syntax if one exists and look for any
deprecated options would be cool :)

the init script though - that -should- be safe to overwrite. or at
least prompt. ther eshouldn't really be a need to change the init
script..



On Thu, Oct 8, 2009 at 1:30 PM, Martin <gpointorama@gmail.com> wrote:
>
> "make install" of php-fpm-0.6
> overwrites:
> "/etc/php-fpm.conf"
> and
> "/etc/init.d/php-fpm"
>
> i think that overwriting existing files isn't a good behavior in this
> case...
>
> thank you in advice
>
i've modified the init script because it doesn't handle USR1 (reopen
log files) :)

On Oct 8, 10:43 pm, Michael Shadle <mike...@gmail.com> wrote:
> should have a conditional check if php-fpm.conf exists... if not, then
> put it there.
>
> ideally something to check the syntax if one exists and look for any
> deprecated options would be cool :)
>
> the init script though - that -should- be safe to overwrite. or at
> least prompt. ther eshouldn't really be a need to change the init
> script..
>
> On Thu, Oct 8, 2009 at 1:30 PM, Martin <gpointor...@gmail.com> wrote:
>
> > "make install" of php-fpm-0.6
> > overwrites:
> > "/etc/php-fpm.conf"
> > and
> > "/etc/init.d/php-fpm"
>
> > i think that overwriting existing files isn't a good behavior in this
> > case...
>
> > thank you in advice
>
>
Re: "make install" of php-fpm-0.6 overwrites "/etc/php-fpm.conf" and "/etc/init.d/php-fpm"
October 08, 2009 04:56PM
you should submit a patch :)

On Thu, Oct 8, 2009 at 1:53 PM, Martin <gpointorama@gmail.com> wrote:
>
> i've modified the init script because it doesn't handle USR1 (reopen
> log files) :)
>
> On Oct 8, 10:43 pm, Michael Shadle <mike...@gmail.com> wrote:
>> should have a conditional check if php-fpm.conf exists... if not, then
>> put it there.
>>
>> ideally something to check the syntax if one exists and look for any
>> deprecated options would be cool :)
>>
>> the init script though - that -should- be safe to overwrite. or at
>> least prompt. ther eshouldn't really be a need to change the init
>> script..
>>
>> On Thu, Oct 8, 2009 at 1:30 PM, Martin <gpointor...@gmail.com> wrote:
>>
>> > "make install" of php-fpm-0.6
>> > overwrites:
>> > "/etc/php-fpm.conf"
>> > and
>> > "/etc/init.d/php-fpm"
>>
>> > i think that overwriting existing files isn't a good behavior in this
>> > case...
>>
>> > thank you in advice
>>
>>
You can also use the INSTALL_ROOT= option to avoid overwriting files.

On Thu, Oct 8, 2009 at 9:55 PM, Michael Shadle <mike503@gmail.com> wrote:
>
> you should submit a patch :)
>
> On Thu, Oct 8, 2009 at 1:53 PM, Martin <gpointorama@gmail.com> wrote:
>>
>> i've modified the init script because it doesn't handle USR1 (reopen
>> log files) :)
>>
>> On Oct 8, 10:43 pm, Michael Shadle <mike...@gmail.com> wrote:
>>> should have a conditional check if php-fpm.conf exists... if not, then
>>> put it there.
>>>
>>> ideally something to check the syntax if one exists and look for any
>>> deprecated options would be cool :)
>>>
>>> the init script though - that -should- be safe to overwrite. or at
>>> least prompt. ther eshouldn't really be a need to change the init
>>> script..
>>>
>>> On Thu, Oct 8, 2009 at 1:30 PM, Martin <gpointor...@gmail.com> wrote:
>>>
>>> > "make install" of php-fpm-0.6
>>> > overwrites:
>>> > "/etc/php-fpm.conf"
>>> > and
>>> > "/etc/init.d/php-fpm"
>>>
>>> > i think that overwriting existing files isn't a good behavior in this
>>> > case...
>>>
>>> > thank you in advice
>>>
>>>
>
Re: "make install" of php-fpm-0.6 overwrites "/etc/php-fpm.conf" and "/etc/init.d/php-fpm"
October 08, 2009 06:54PM
but typically you -want- it to install on top of the previous install :)


On Thu, Oct 8, 2009 at 3:38 PM, dreamcat four <dreamcat4@gmail.com> wrote:
>
> You can also use the INSTALL_ROOT= option to avoid overwriting files.
>
> On Thu, Oct 8, 2009 at 9:55 PM, Michael Shadle <mike503@gmail.com> wrote:
>>
>> you should submit a patch :)
>>
>> On Thu, Oct 8, 2009 at 1:53 PM, Martin <gpointorama@gmail.com> wrote:
>>>
>>> i've modified the init script because it doesn't handle USR1 (reopen
>>> log files) :)
>>>
>>> On Oct 8, 10:43 pm, Michael Shadle <mike...@gmail.com> wrote:
>>>> should have a conditional check if php-fpm.conf exists... if not, then
>>>> put it there.
>>>>
>>>> ideally something to check the syntax if one exists and look for any
>>>> deprecated options would be cool :)
>>>>
>>>> the init script though - that -should- be safe to overwrite. or at
>>>> least prompt. ther eshouldn't really be a need to change the init
>>>> script..
>>>>
>>>> On Thu, Oct 8, 2009 at 1:30 PM, Martin <gpointor...@gmail.com> wrote:
>>>>
>>>> > "make install" of php-fpm-0.6
>>>> > overwrites:
>>>> > "/etc/php-fpm.conf"
>>>> > and
>>>> > "/etc/init.d/php-fpm"
>>>>
>>>> > i think that overwriting existing files isn't a good behavior in this
>>>> > case...
>>>>
>>>> > thank you in advice
>>>>
>>>>
>>
>
On Thu, Oct 8, 2009 at 11:52 PM, Michael Shadle <mike503@gmail.com> wrote:
>
> but typically you -want- it to install on top of the previous install :)

Yes. This is true when a newer release of FPM has added new
configuration options, which won't exist in the old / existing config
file. It would be right however to ensure that the --with-fpm-conf=
option respond to ="no" / --without-fpm-conf. Currently it does not,
unlike the init.d argument --with[out]-fpm-init. So you could probably
satisfy most people with just that.

I should point out that specifically the commands provided by make for
installing files aren't very sophisticated. Hence why we don't have
this business about detecting existing files, etc. Thats something
handled much better by debian packaging commands, or an equivalent
package management system.

For example making the --without-fpm-init installation option has
proven to be somewhat challenging. For example the @ENDIF@ not getting
replaced on FreeBSD, and i've been told it still doesn't work.
Whatever you do, make sure it works on these architectures, too.


dreamcat4
dreamcat4@gmail.com
dreamcat four wrote:
> Yes. This is true when a newer release of FPM has added new
> configuration options, which won't exist in the old / existing config
> file. It would be right however to ensure that the --with-fpm-conf=
> option respond to ="no" / --without-fpm-conf. Currently it does not,
> unlike the init.d argument --with[out]-fpm-init. So you could probably
> satisfy most people with just that.
>
> I should point out that specifically the commands provided by make for
> installing files aren't very sophisticated. Hence why we don't have
> this business about detecting existing files, etc. Thats something
> handled much better by debian packaging commands, or an equivalent
> package management system.
>
> For example making the --without-fpm-init installation option has
> proven to be somewhat challenging. For example the @ENDIF@ not getting
> replaced on FreeBSD, and i've been told it still doesn't work.
> Whatever you do, make sure it works on these architectures, too.

What about /etc/php-fpm/default/*?

So anyone can always have a back-to-basis version of the configuration
files to start modifying their setups and look for differences.

The layout would be:
/etc/php-fpm/php-fpm.conf (only added on first install)
/etc/php-fpm/default/php-fpm.conf
On Fri, Oct 9, 2009 at 6:46 AM, Juan Fco. Giordana
<juangiordana@gmail.com> wrote:
>
> dreamcat four wrote:
>>
>> Yes. This is true when a newer release of FPM has added new
>> configuration options, which won't exist in the old / existing config
>> file. It would be right however to ensure that the --with-fpm-conf=
>> option respond to ="no" / --without-fpm-conf. Currently it does not,
>> unlike the init.d argument --with[out]-fpm-init. So you could probably
>> satisfy most people with just that.
>>
>> I should point out that specifically the commands provided by make for
>> installing files aren't very sophisticated. Hence why we don't have
>> this business about detecting existing files, etc. Thats something
>> handled much better by debian packaging commands, or an equivalent
>> package management system.
>>
>> For example making the --without-fpm-init installation option has
>> proven to be somewhat challenging. For example the @ENDIF@ not getting
>> replaced on FreeBSD, and i've been told it still doesn't work.
>> Whatever you do, make sure it works on these architectures, too.
>
> What about /etc/php-fpm/default/*?
>
> So anyone can always have a back-to-basis version of the configuration files
> to start modifying their setups and look for differences.
>
> The layout would be:
> /etc/php-fpm/php-fpm.conf (only added on first install)
> /etc/php-fpm/default/php-fpm.conf
>
>

why don't just

/etc/php-fpm.conf (for first install)
/etc/php-fpm.conf.default (for next installs)

--
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
use RPM, guys.

On Fri, Oct 9, 2009 at 6:55 AM, Edho P Arief <edhoprima@gmail.com> wrote:

>
> On Fri, Oct 9, 2009 at 6:46 AM, Juan Fco. Giordana
> <juangiordana@gmail.com> wrote:
> >
> > dreamcat four wrote:
> >>
> >> Yes. This is true when a newer release of FPM has added new
> >> configuration options, which won't exist in the old / existing config
> >> file. It would be right however to ensure that the --with-fpm-conf=
> >> option respond to ="no" / --without-fpm-conf. Currently it does not,
> >> unlike the init.d argument --with[out]-fpm-init. So you could probably
> >> satisfy most people with just that.
> >>
> >> I should point out that specifically the commands provided by make for
> >> installing files aren't very sophisticated. Hence why we don't have
> >> this business about detecting existing files, etc. Thats something
> >> handled much better by debian packaging commands, or an equivalent
> >> package management system.
> >>
> >> For example making the --without-fpm-init installation option has
> >> proven to be somewhat challenging. For example the @ENDIF@ not getting
> >> replaced on FreeBSD, and i've been told it still doesn't work.
> >> Whatever you do, make sure it works on these architectures, too.
> >
> > What about /etc/php-fpm/default/*?
> >
> > So anyone can always have a back-to-basis version of the configuration
> files
> > to start modifying their setups and look for differences.
> >
> > The layout would be:
> > /etc/php-fpm/php-fpm.conf (only added on first install)
> > /etc/php-fpm/default/php-fpm.conf
> >
> >
>
> why don't just
>
> /etc/php-fpm.conf (for first install)
> /etc/php-fpm.conf.default (for next installs)
>
> --
> O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
>



--
Ilyas R. Khasyanov
Unix/Linux System Administrator
GPG Key ID: 6EC5EB27 (Changed since 2009-05-12)
On Fri, Oct 9, 2009 at 12:46 AM, Juan Fco. Giordana
<juangiordana@gmail.com> wrote:
> What about /etc/php-fpm/default/*?
>
> So anyone can always have a back-to-basis version of the configuration files
> to start modifying their setups and look for differences.
>
> The layout would be:
> /etc/php-fpm/php-fpm.conf (only added on first install)
> /etc/php-fpm/default/php-fpm.conf

Then tell us 3 other well known software packages which do this from
'make install' command. What you are proposing is a more difficult
challenge to correctly implement and test for all architectures. But
don't let me stop you from doing it! Like Mike, I would like for more
people submit patches with their suggestions. The best way to do this
is on launchpad. Just raise a bug, call it "[Patch] <patch
description>". Easy!

Anyway, to answer the question we can achieve this behaviour with a
packaging system by copying each the files from the package's own
install script. Debian even have a special command for just exactly
this: alerting / prompting the user and backing up the original
configuration file with a different name.

Its also one of the reasons why we hope FPM package can be integrated
into PHP upstream. When FPM is officially part of PHP its more likely
to be approved and supported for packaging by the major linux
distributions (Redhat, Suse, debian, ubuntu, etc). We have already
started this process by filing the appropriate requests and such.


Best regards,

dreamcat4
dreamcat4@gmail.com
dreamcat four wrote:
> Then tell us 3 other well known software packages which do this from
> 'make install' command. What you are proposing is a more difficult
> challenge to correctly implement and test for all architectures. But
> don't let me stop you from doing it! Like Mike, I would like for more
> people submit patches with their suggestions. The best way to do this
> is on launchpad. Just raise a bug, call it "[Patch] <patch
> description>". Easy!

I'm not sure about the remaining two, but nginx does it this way in
~/nginx-0.7.61/objs/Makefile:

install: objs/nginx
[...]
test -f '$(DESTDIR)/usr/local/conf/nginx.conf' || \
cp conf/nginx.conf '$(DESTDIR)/usr/local/conf'
cp conf/nginx.conf '$(DESTDIR)/usr/local/conf/nginx.conf.default'
[...]

However my knowledge about autoconf/automake is null.
On Fri, Oct 9, 2009 at 11:14 AM, Juan Fco. Giordana
<juangiordana@gmail.com> wrote:
> I'm not sure about the remaining two, but nginx does it this way in
> ~/nginx-0.7.61/objs/Makefile:
>
> install:        objs/nginx
>    [...]
>    test -f '$(DESTDIR)/usr/local/conf/nginx.conf' || \
> cp conf/nginx.conf '$(DESTDIR)/usr/local/conf'
>    cp conf/nginx.conf '$(DESTDIR)/usr/local/conf/nginx.conf.default'
>    [...]
>

Allright,
Perhaps we can take the best from each suggestions and make into
something suitable enough for the fpm XML configuration file.
I'll provide a patch file for my suggestion.

dreamcat4
dreamcat4@gmail.com
Heres a patch. It needs testing (Centos, FreeBSD), and a little
translation (Russian).

* Install nginx sample config file
* --without-fpm-conf (no install) option
* Rename php-fpm.conf to php-fpm.conf.old
* Symlink php-fpm.conf -> php-fpm.conf.default
* Default /usr/local/etc/rc.d/php-fpm for *bsd (thanks kheechin)
* Installation notes, tips (readme.markdown)
* Regenerated with ./buildconf

Try:
wget "http://launchpad.net/php-fpm/master/0.6/+download/php-fpm-0.6-$PHP_VER.tar.gz"
tar -zxvf "php-fpm-0.6-$PHP_VER.tar.gz"
cd "php-fpm-0.6-$PHP_VER"
patch -p1 < ../fpm-rev-93-make-install.patch
....


Please raise an appropriate bug in Launchpad, (ie call it "[PATCH]
make install" / siimilar), should you require this.
Although like i said, also needs testing on Centos and FreeBSD however.


Best regards,

dreamcat4
dreamcat4@gmail.com
Attachments:
open | download - fpm-rev-93-make-install.patch (16.1 KB)
On Sat, Oct 10, 2009 at 4:22 AM, dreamcat four <dreamcat4@gmail.com> wrote:
> Heres a patch. It needs testing (Centos, FreeBSD), and a little
> translation (Russian).
>
> * Install nginx sample config file
> * --without-fpm-conf (no install) option
> * Rename php-fpm.conf to php-fpm.conf.old
> * Symlink php-fpm.conf -> php-fpm.conf.default
> * Default /usr/local/etc/rc.d/php-fpm for *bsd (thanks kheechin)
> * Installation notes, tips (readme.markdown)
> * Regenerated with ./buildconf
>
> Try:
> wget "http://launchpad.net/php-fpm/master/0.6/+download/php-fpm-0.6-$PHP_VER.tar.gz"
> tar -zxvf "php-fpm-0.6-$PHP_VER.tar.gz"
> cd "php-fpm-0.6-$PHP_VER"
> patch -p1 < ../fpm-rev-93-make-install.patch
> ...
>
>
> Please raise an appropriate bug in Launchpad, (ie call it "[PATCH]
> make install" / siimilar), should you require this.
> Although like i said, also needs testing on Centos and FreeBSD however.
>
>
> Best regards,
>
> dreamcat4
> dreamcat4@gmail.com
>

Just for information, OpenBSD does not have rc.d/init.d system.
And on netbsd, the path is /usr/pkg/share/examples/rc.d/ (which then
the user should manually copy/symlink to /etc/rc.d)

Also the path is /etc/rc.d for Arch Linux.

--
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
On Oct 10, 9:42 am, Edho P Arief <edhopr...@gmail.com> wrote:
> On Sat, Oct 10, 2009 at 4:22 AM, dreamcat four <dreamc...@gmail.com> wrote:
> > Heres a patch. It needs testing (Centos, FreeBSD), and a little
> > translation (Russian).
> Just for information, OpenBSD does not have rc.d/init.d system.
> And on netbsd, the path is /usr/pkg/share/examples/rc.d/ (which then
> the user should manually copy/symlink to /etc/rc.d)
>
> Also the path is /etc/rc.d for Arch Linux.

....and on some other systems, smth is different too...

I do not think that `make install` should even attempt to install the
init file. Moreover, different systems and distributions have
different "good styles" of writing init files; say, handling pidfiles
manually is a bad style often.

Usually it is done on the OS/distribution-specific package level (rpm/
deb/bsd ports/gentoo portage...).
On Sat, Oct 10, 2009 at 6:42 AM, Edho P Arief <edhoprima@gmail.com> wrote:
> Just for information, OpenBSD does not have rc.d/init.d system.
> And on netbsd, the path is /usr/pkg/share/examples/rc.d/ (which then
> the user should manually copy/symlink to /etc/rc.d)

That doesn't seem right because /usr/pkg is a ports directory. If not
installing PHP-FPM as a port, you'd normally just want it in /etc/rc.d
to save the hassle. After all, they would be bypassing netbsd ports
and we aren't recommending our users to use php-fpm withoug an init
script (as documented in the php-fpm man page).

If you were installing php-fpm as a netbsd port, then the port file
could easily set the appropriate directories / have their own init
script. This override
"--with-fpm-init=/usr/pkg/share/examples/rc.d/php-fpm" is the best
thing we can offer.

If you were an overly security-concious sysadmin who didn't want the
init script, then we would recommend you would use
"INSTALL_ROOT=/staging/area make install", and the
"--without-fpm-init" and to check which files you were installing.

>
> Also the path is /etc/rc.d for Arch Linux.
>
> --
> O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
>

We expect over 90%+ of php-fpm users to be happy enough with our
provisions for linux* and FreeBSD.
But theres no harm in adding these netbsd, openbsd and arch linux cases too.


dreamcat4
dreamcat4@gmail.com
On Sat, Oct 10, 2009 at 6:54 AM, fixxxer <fixxxerrr@gmail.com> wrote:
> I do not think that `make install` should even attempt to install the
> init file. Moreover, different systems and distributions have
> different "good styles" of writing init files; say, handling pidfiles
> manually is a bad style often.
>
> Usually it is done on the OS/distribution-specific package level (rpm/
> deb/bsd ports/gentoo portage...).

Yes, in an ideal world. But the major OS/distributions won't
officially package php-fpm for a while yet. Since we have a vanilla
and very generic init script which works on both linux and FreeBsd, we
believe it works for the majority of people. As FreeBSD and linux
don't have paranoid security around their init scripts, its
acceptable.

There always will be a few remaining minority (openbsd, etc) who are
security concious and don't want to install the init script, at all.
These people are recommended should read the ./conifgure --help more
thoroughly and are welcome to use the --without-fpm-init configure
flag or INSTALL_ROOT=/tmp prefix to see beforehand which files exactly
that they are installing.

That's not perfect, but it won't deprive 90%+ of the other people a
working init script either ? Our init script is sh (bourne shell)
generic, and should work with the widest range of distribution / os
types. You should submit patches / improvement to this default init
script if its didn't work (broken) for your flavour of unix. This
would be for example small pid issue, etc.

Its a bigger challenge to comply with a distribution's official init
script coding standards and / or security standards. So we expect for
the whole init script should be re-written in that situation.
(official FreeBSD port, etc).


Best regards,

dreamcat4
dreamcat4@gmail.com
On Sat, Oct 10, 2009 at 10:14 AM, dreamcat four <dreamcat4@gmail.com> wrote:
> On Sat, Oct 10, 2009 at 6:42 AM, Edho P Arief <edhoprima@gmail.com> wrote:
>> Just for information, OpenBSD does not have rc.d/init.d system.
>> And on netbsd, the path is /usr/pkg/share/examples/rc.d/ (which then
>> the user should manually copy/symlink to /etc/rc.d)

Okay, here's an revised patch file including those changes.

dreamcat4
dreamcat4@gmail.com
Attachments:
open | download - fpm-rev-93-make-install-2.patch (18.3 KB)
open | download - patch-update-1-2.diff (7.6 KB)
dreamcat four wrote:
> Yes, in an ideal world. But the major OS/distributions won't
> officially package php-fpm for a while yet. Since we have a vanilla
> and very generic init script which works on both linux and FreeBsd, we
> believe it works for the majority of people. As FreeBSD and linux
> don't have paranoid security around their init scripts, its
> acceptable.

What about using something like /usr/share/php-fpm/php-fpm.{sh,init} and
explain in the installation docs that the init file, if the user decides
to go with it, should be copied to the appropriate distribution
directory. I think mysql does it this way.

../configure --datadir=/usr/share/php-fpm
make
make install
cp /usr/share/php-fpm/php-fpm.{sh,init} /etc/init.d/php-fpm

The same thing could be done with the configuration files.

This way the package would be distribution agnostic and, on the other
hand, it allows distribution maintainers to have a starting point to
write their own distro-friendly scripts.

Although, even better (IMO), just leave those files in the source code
directory and provide instruction in the docs to proceed in a way
similar to [1]:

[...]
make install
install -v -m644 php-fpm.conf /etc/php-fpm.conf
install -v -m755 php-fpm.init /etc/init.d/php-fpm

Probably having this as part of the installation docs gives more
flexibility to the person that is trying to install the package or
prepare the package for use on a distribution and on the other hand it
makes the package maintainer less things to worry about.


[1] http://www.linuxfromscratch.org/blfs/view/stable/general/php.html
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 259
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready