View previous topic :: View next topic |
Author |
Message |
kilburna Tux's lil' helper
Joined: 20 Sep 2004 Posts: 107
|
Posted: Fri Jun 22, 2018 2:24 am Post subject: Socket not created due disappearing folder on reboot |
|
|
Hi
Just a strange one. I run apache in event mpm and use php-fpm. When I reboot the computer the /var/run/php-fpm folder I manually created gets removed. So during bootup, the /etc/init.d/php-fpm cannot start because the /var/run/php-fpm folder is not present. If I manually create the folder, start it and all is fine. So what is causing the /var/run/php-fpm folder to be deleted.
www.conf Code: |
[www]
user = apache
group = apache
listen = /var/run/php-fpm/www.sock
listen.owner = apache
listen.group = apache
listen.mode = 0660
php_admin_value[error_log] = /var/log/fpm-php.www.log |
[Moderator edit: changed [quote] tags to [code] tags to preserve output layout. -Hu] |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21607
|
Posted: Fri Jun 22, 2018 3:10 am Post subject: |
|
|
For several years now, /var/run has been a symlink to /run. Around the same time, /run was made a tmpfs, which means it discards all contents on reboot.
The init script should create the directory as part of startup. |
|
Back to top |
|
|
kilburna Tux's lil' helper
Joined: 20 Sep 2004 Posts: 107
|
Posted: Fri Jun 22, 2018 3:44 am Post subject: |
|
|
That is also what I thought but the init script does not create the folder. I just hard coded mkdir in the init script and all is good, but I will file a bug. |
|
Back to top |
|
|
sabel n00b
Joined: 27 Nov 2003 Posts: 13
|
Posted: Tue Aug 07, 2018 5:37 pm Post subject: |
|
|
Did you already file a bug?
This hit me today, too. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Tue Aug 07, 2018 6:10 pm Post subject: |
|
|
sabel wrote: | Did you already file a bug? This hit me today, too. |
sabel, kilburna, et al ... it won't be classed as a bug, app-eselect/eselect-php[fpm] installs /usr/lib/tmpfiles.d/php-fpm.conf containing the following:
cat ~portdir/app-eselect/eselect-php/files/php-fpm.conf: | d /run/php-fpm 755 root root |
So, if tempfiles.dev is in the runlevel this directory should be created on each reboot. If tmpfiles.dev is set to run and yet this isn't created prior to apache starting then /etc/init.d/apache should have 'after tmpfiles.dev'.
best ... khay |
|
Back to top |
|
|
sabel n00b
Joined: 27 Nov 2003 Posts: 13
|
Posted: Tue Aug 07, 2018 6:59 pm Post subject: |
|
|
Thanks a lot!
Adding opentmpfiles-setup and opentmpfiles-dev to the default runlevel fixes the issue. |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21607
|
Posted: Wed Aug 08, 2018 12:23 am Post subject: |
|
|
In my opinion, if php relies on a directory created by opentmpfiles, then the php init script should need opentmpfiles.dev or similar, so that openrc is forced to run these in the right order. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Wed Aug 08, 2018 8:55 am Post subject: |
|
|
Hu wrote: | In my opinion, if php relies on a directory created by opentmpfiles, then the php init script should need opentmpfiles.dev or similar, so that openrc is forced to run these in the right order. |
Hu ... you're right, but if the initscript had 'mkdir -p -m 0755 /run/php-fpm || return $?' then issues like this simply wouldn't occur (and that's the problem I have with tmpfilesd).
best ... khay |
|
Back to top |
|
|
|