Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 514872 - dev-lang/php - /etc/init.d/php-fpm should drop "need net"
Summary: dev-lang/php - /etc/init.d/php-fpm should drop "need net"
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PHP Bugs
Depends on:
Blocks: need-net
  Show dependency tree
Reported: 2014-06-24 08:38 UTC by Thomas Deutschmann (RETIRED)
Modified: 2015-11-19 23:38 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Deutschmann (RETIRED) gentoo-dev 2014-06-24 08:38:44 UTC
Per default configuration, php-fpm will bind to "", but the php-fpm runscript from dev-lang/php-5.5.13 has set "need net". This is wrong:

net.lo doesn't set up the loopback device. You should depend on the "loopback" service instead.

Also the current setting (need net) is causing php-fpm to restart every time an interface is restarting. So it seems like the php-fpm runscript is misusing "need net".

See for more information.

Reproducible: Always
Comment 1 Michael Orlitzky gentoo-dev 2015-11-01 21:32:50 UTC
You are correct. If no one else comments for a while, I'll remove that line from the init script.
Comment 2 Brian Evans (RETIRED) gentoo-dev 2015-11-01 23:03:54 UTC
I think it could be changed to "use net" for ordering sake and/or possibly add a commented conf.d/php-fpm if you need a specific interface.
Comment 3 Michael Orlitzky gentoo-dev 2015-11-01 23:35:34 UTC
(In reply to Brian Evans from comment #2)
> I think it could be changed to "use net" for ordering sake and/or possibly
> add a commented conf.d/php-fpm if you need a specific interface.

A "use net" will still attempt to bring up unrelated interfaces. The php-fpm configuration that we ship has "listen =", so we probably don't want to bring up e.g. eth4 to start php-fpm on

But yeah, if the user changes that "listen" line, then he'll need to create /etc/conf.d/php-fpm. I guess the best place to mention that is in the conf file right next to the "listen" line? Something like,

  ; If you change this to listen on another interface, then you'll need to
  ; inform your init system to wait for that interface to come up before 
  ; starting php-fpm. With OpenRC, this can be accomplished by adding the
  ; line (for example),
  ;   rc_need="net.eth0"
  ; to the file /etc/conf.d/php-fpm. If that files does not exist, you may
  ; create it. The service name "net.eth0" should be replaced by the interface
  ; associated with the address in your "listen" directive above.
Comment 4 Michael Orlitzky gentoo-dev 2015-11-19 23:38:19 UTC
Well, the "need net" thing is fixed:

I'm planning on getting rid of that php-fpm.conf file that we're keeping in $FILESDIR, so I'm not sure how we should document this. Maybe we can put an example in a conf.d file, commented out, showing how to do it. That could be done at the same time as bug #549172 which would also need a conf.d file.