Bug 9844 - php-fpm service cannot be started
Summary: php-fpm service cannot be started
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Oden Eriksson
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-24 05:41 CEST by Funda Wang
Modified: 2013-04-27 14:21 CEST (History)
1 user (show)

See Also:
Source RPM: php-5.4.13-2.mga3
CVE:
Status comment:


Attachments

Description Funda Wang 2013-04-24 05:41:52 CEST
# service php-fpm start
Job for php-fpm.service failed. See 'systemctl status php-fpm.service' and 'journalctl -n' for details.

# systemctl status php-fpm.service
php-fpm.service - The PHP FastCGI Process Manager
          Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled)
          Active: failed (Result: exit-code) since Wed, 2013-04-24 11:40:37 CST; 10s ago
         Process: 1302 ExecStart=/usr/sbin/php-fpm ${PHP_FPM_OPTIONS} (code=exited, status=64)
          CGroup: name=systemd:/system/php-fpm.service

Apr 24 11:40:37 localhost php-fpm[1302]: -y, --fpm-config <file>
Apr 24 11:40:37 localhost php-fpm[1302]: Specify alternative path to FastCGI process manager config file.
Apr 24 11:40:37 localhost php-fpm[1302]: -t, --test       Test FPM configuration and exit
Apr 24 11:40:37 localhost php-fpm[1302]: -D, --daemonize  force to run in background, and ignore daemonize option from config file
Apr 24 11:40:37 localhost php-fpm[1302]: -F, --nodaemonize
Apr 24 11:40:37 localhost php-fpm[1302]: force to stay in foreground, and ignore daemonize option from config file
Apr 24 11:40:37 localhost php-fpm[1302]: -R, --allow-to-run-as-root
Apr 24 11:40:37 localhost php-fpm[1302]: Allow pool to run as root (disabled by default)
Apr 24 11:40:37 localhost systemd[1]: Failed to start The PHP FastCGI Process Manager.
Apr 24 11:40:37 localhost systemd[1]: Unit php-fpm.service entered failed state


I guess the problem comes from unexpaned ${PHP_FPM_OPTIONS}.

Reproducible: 

Steps to Reproduce:
Funda Wang 2013-04-24 05:45:19 CEST

Assignee: bugsquad => oe

Comment 1 Funda Wang 2013-04-25 04:54:57 CEST
I'm for following changes, it works without futher changes.

$ svn diff
Index: SOURCES/php-fpm.sysconf
===================================================================
--- SOURCES/php-fpm.sysconf     (revision 411137)
+++ SOURCES/php-fpm.sysconf     (working copy)
@@ -1,3 +1,3 @@
 # pass additional options here
-PHP_FPM_OPTIONS=""
+PHP_FPM_OPTIONS="-D"

CC: (none) => mageia

Comment 2 Colin Guthrie 2013-04-25 21:16:07 CEST
Personally I think it's better to fix the systemd unit in this case. After all the options in the unit and the config have to match up if it's to work. If you have Type=forking in the unit, then you *have* to have -D in the config... if you have Type=simple in the unit, then you *have* to have -F in the config...

So the two are lock stepped and it doesn't make sense IMO to split it up.

So for minimal change, I'd just put -D con the command line in the unit and leave the config alone.

If it were not release freeze I'd suggest experimenting with Type=simple and -F but it's likely a bit too late to go fiddling!
Comment 3 Funda Wang 2013-04-26 18:16:56 CEST
Of course, I still have another patch against unit:

$ svn diff
Index: SOURCES/php-fpm.service
===================================================================
--- SOURCES/php-fpm.service     (revision 411137)
+++ SOURCES/php-fpm.service     (working copy)
@@ -6,8 +6,8 @@
 Type=forking
 PIDFile=/var/run/php-fpm/php-fpm.pid
 EnvironmentFile=/etc/sysconfig/php-fpm
-ExecStart=/usr/sbin/php-fpm ${PHP_FPM_OPTIONS}
-ExecReload=/bin/kill -USR2 $MAINPID
+ExecStart=/usr/sbin/php-fpm $PHP_FPM_OPTIONS
+ExecReload=/usr/bin/kill -USR2 $MAINPID

 [Install]
 WantedBy=multi-user.target


This patch make it work, also, without change config. Maybe there is something wrong with variable expanding.
Comment 4 Colin Guthrie 2013-04-26 18:21:09 CEST
Ahh yes that's probably fine then. The ${FOO} syntax is not supported AFAIK, so this makes sense. ${FOO} is a shell things and this is not shell even if it looks a little bit like it! Same with putting shell stuff in the actual EnvironmentFile... 

Cheers for this!
Comment 5 Funda Wang 2013-04-26 18:25:41 CEST
(In reply to Colin Guthrie from comment #4)
> Ahh yes that's probably fine then. The ${FOO} syntax is not supported AFAIK,
> so this makes sense. ${FOO} is a shell things and this is not shell even if
> it looks a little bit like it! Same with putting shell stuff in the actual
> EnvironmentFile... 
Well, it should be supported according to:
http://fedoraproject.org/wiki/Packaging:Systemd#EnvironmentFiles_and_support_for_.2Fetc.2Fsysconfig_files
Comment 6 Colin Guthrie 2013-04-26 20:27:34 CEST
Ahh I stand corrected :)

I guess then it expands to an empty "" on the command line? Either way, thanks for fixing :)
Comment 7 Funda Wang 2013-04-27 14:21:37 CEST
fixed by pushing new build.

Status: NEW => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.