Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 3 commits
  • 4 files changed
  • 0 comments
  • 1 contributor
Sep 28, 2012
- Fixed bug #63085 (Systemd integration and daemonize) 64a0e7c
- Fixed bug #62947 (Unneccesary warnings on FPM) 72f3457
Merge branch 'fuckgit' into PHP-5.4
* fuckgit:
  - Fixed bug #62947 (Unneccesary warnings on FPM)
  - Fixed bug #63085 (Systemd integration and daemonize)

Conflicts:
	sapi/fpm/config.m4
be043ab
2  NEWS
@@ -33,6 +33,8 @@ PHP                                                                        NEWS
33 33
 - FPM:
34 34
   . Fixed bug #62954 (startup problems fpm / php-fpm). (fat)
35 35
   . Fixed bug #62886 (PHP-FPM may segfault/hang on startup). (fat)
  36
+  . Fixed bug #63085 (Systemd integration and daemonize). (remi, fat)
  37
+  . Fixed bug #62947 (Unneccesary warnings on FPM). (fat)
36 38
 
37 39
 - OpenSSL:
38 40
   . Implemented FR #61421 (OpenSSL signature verification missing RMD160, 
657  sapi/fpm/config.m4
... ...
@@ -0,0 +1,657 @@
  1
+dnl
  2
+dnl $Id$
  3
+dnl
  4
+
  5
+PHP_ARG_ENABLE(fpm,,
  6
+[  --enable-fpm              Enable building of the fpm SAPI executable], no, no)
  7
+
  8
+dnl configure checks {{{
  9
+AC_DEFUN([AC_FPM_STDLIBS],
  10
+[
  11
+  AC_CHECK_FUNCS(setenv clearenv setproctitle)
  12
+
  13
+  AC_SEARCH_LIBS(socket, socket)
  14
+  AC_SEARCH_LIBS(inet_addr, nsl)
  15
+
  16
+  AC_CHECK_HEADERS([errno.h fcntl.h stdio.h stdlib.h unistd.h sys/uio.h])
  17
+  AC_CHECK_HEADERS([sys/select.h sys/socket.h sys/time.h])
  18
+  AC_CHECK_HEADERS([arpa/inet.h netinet/in.h])
  19
+  AC_CHECK_HEADERS([sysexits.h])
  20
+])
  21
+
  22
+AC_DEFUN([AC_FPM_PRCTL],
  23
+[
  24
+  AC_MSG_CHECKING([for prctl])
  25
+
  26
+  AC_TRY_COMPILE([ #include <sys/prctl.h> ], [prctl(0, 0, 0, 0, 0);], [
  27
+    AC_DEFINE([HAVE_PRCTL], 1, [do we have prctl?])
  28
+    AC_MSG_RESULT([yes])
  29
+  ], [
  30
+    AC_MSG_RESULT([no])
  31
+  ])
  32
+])
  33
+
  34
+AC_DEFUN([AC_FPM_CLOCK],
  35
+[
  36
+  have_clock_gettime=no
  37
+
  38
+  AC_MSG_CHECKING([for clock_gettime])
  39
+
  40
+  AC_TRY_LINK([ #include <time.h> ], [struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts);], [
  41
+    have_clock_gettime=yes
  42
+    AC_MSG_RESULT([yes])
  43
+  ], [
  44
+    AC_MSG_RESULT([no])
  45
+  ])
  46
+
  47
+  if test "$have_clock_gettime" = "no"; then
  48
+    AC_MSG_CHECKING([for clock_gettime in -lrt])
  49
+
  50
+    SAVED_LIBS="$LIBS"
  51
+    LIBS="$LIBS -lrt"
  52
+
  53
+    AC_TRY_LINK([ #include <time.h> ], [struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts);], [
  54
+      have_clock_gettime=yes
  55
+      AC_MSG_RESULT([yes])
  56
+    ], [
  57
+      LIBS="$SAVED_LIBS"
  58
+      AC_MSG_RESULT([no])
  59
+    ])
  60
+  fi
  61
+
  62
+  if test "$have_clock_gettime" = "yes"; then
  63
+    AC_DEFINE([HAVE_CLOCK_GETTIME], 1, [do we have clock_gettime?])
  64
+  fi
  65
+
  66
+  have_clock_get_time=no
  67
+
  68
+  if test "$have_clock_gettime" = "no"; then
  69
+    AC_MSG_CHECKING([for clock_get_time])
  70
+
  71
+    AC_TRY_RUN([ #include <mach/mach.h>
  72
+      #include <mach/clock.h>
  73
+      #include <mach/mach_error.h>
  74
+
  75
+      int main()
  76
+      {
  77
+        kern_return_t ret; clock_serv_t aClock; mach_timespec_t aTime;
  78
+        ret = host_get_clock_service(mach_host_self(), REALTIME_CLOCK, &aClock);
  79
+
  80
+        if (ret != KERN_SUCCESS) {
  81
+          return 1;
  82
+        }
  83
+
  84
+        ret = clock_get_time(aClock, &aTime);
  85
+        if (ret != KERN_SUCCESS) {
  86
+          return 2;
  87
+        }
  88
+
  89
+        return 0;
  90
+      }
  91
+    ], [
  92
+      have_clock_get_time=yes
  93
+      AC_MSG_RESULT([yes])
  94
+    ], [
  95
+      AC_MSG_RESULT([no])
  96
+    ])
  97
+  fi
  98
+
  99
+  if test "$have_clock_get_time" = "yes"; then
  100
+    AC_DEFINE([HAVE_CLOCK_GET_TIME], 1, [do we have clock_get_time?])
  101
+  fi
  102
+])
  103
+
  104
+AC_DEFUN([AC_FPM_TRACE],
  105
+[
  106
+  have_ptrace=no
  107
+  have_broken_ptrace=no
  108
+
  109
+  AC_MSG_CHECKING([for ptrace])
  110
+
  111
+  AC_TRY_COMPILE([
  112
+    #include <sys/types.h>
  113
+    #include <sys/ptrace.h> ], [ptrace(0, 0, (void *) 0, 0);], [
  114
+    have_ptrace=yes
  115
+    AC_MSG_RESULT([yes])
  116
+  ], [
  117
+    AC_MSG_RESULT([no])
  118
+  ])
  119
+
  120
+  if test "$have_ptrace" = "yes"; then
  121
+    AC_MSG_CHECKING([whether ptrace works])
  122
+
  123
+    AC_TRY_RUN([
  124
+      #include <unistd.h>
  125
+      #include <signal.h>
  126
+      #include <sys/wait.h>
  127
+      #include <sys/types.h>
  128
+      #include <sys/ptrace.h>
  129
+      #include <errno.h>
  130
+
  131
+      #if !defined(PTRACE_ATTACH) && defined(PT_ATTACH)
  132
+      #define PTRACE_ATTACH PT_ATTACH
  133
+      #endif
  134
+
  135
+      #if !defined(PTRACE_DETACH) && defined(PT_DETACH)
  136
+      #define PTRACE_DETACH PT_DETACH
  137
+      #endif
  138
+
  139
+      #if !defined(PTRACE_PEEKDATA) && defined(PT_READ_D)
  140
+      #define PTRACE_PEEKDATA PT_READ_D
  141
+      #endif
  142
+
  143
+      int main()
  144
+      {
  145
+        long v1 = (unsigned int) -1; /* copy will fail if sizeof(long) == 8 and we've got "int ptrace()" */
  146
+        long v2;
  147
+        pid_t child;
  148
+        int status;
  149
+
  150
+        if ( (child = fork()) ) { /* parent */
  151
+          int ret = 0;
  152
+
  153
+          if (0 > ptrace(PTRACE_ATTACH, child, 0, 0)) {
  154
+            return 2;
  155
+          }
  156
+
  157
+          waitpid(child, &status, 0);
  158
+
  159
+      #ifdef PT_IO
  160
+          struct ptrace_io_desc ptio = {
  161
+            .piod_op = PIOD_READ_D,
  162
+            .piod_offs = &v1,
  163
+            .piod_addr = &v2,
  164
+            .piod_len = sizeof(v1)
  165
+          };
  166
+
  167
+          if (0 > ptrace(PT_IO, child, (void *) &ptio, 0)) {
  168
+            ret = 3;
  169
+          }
  170
+      #else
  171
+          errno = 0;
  172
+
  173
+          v2 = ptrace(PTRACE_PEEKDATA, child, (void *) &v1, 0);
  174
+
  175
+          if (errno) {
  176
+            ret = 4;
  177
+          }
  178
+      #endif
  179
+          ptrace(PTRACE_DETACH, child, (void *) 1, 0);
  180
+
  181
+          kill(child, SIGKILL);
  182
+
  183
+          return ret ? ret : (v1 != v2);
  184
+        }
  185
+        else { /* child */
  186
+          sleep(10);
  187
+          return 0;
  188
+        }
  189
+      }
  190
+    ], [
  191
+      AC_MSG_RESULT([yes])
  192
+    ], [
  193
+      have_ptrace=no
  194
+      have_broken_ptrace=yes
  195
+      AC_MSG_RESULT([no])
  196
+    ], [
  197
+      AC_MSG_RESULT([skipped (cross compiling)])
  198
+    ])
  199
+  fi
  200
+
  201
+  if test "$have_ptrace" = "yes"; then
  202
+    AC_DEFINE([HAVE_PTRACE], 1, [do we have ptrace?])
  203
+  fi
  204
+
  205
+  have_mach_vm_read=no
  206
+
  207
+  if test "$have_broken_ptrace" = "yes"; then
  208
+    AC_MSG_CHECKING([for mach_vm_read])
  209
+
  210
+    AC_TRY_COMPILE([ #include <mach/mach.h>
  211
+      #include <mach/mach_vm.h>
  212
+    ], [
  213
+      mach_vm_read((vm_map_t)0, (mach_vm_address_t)0, (mach_vm_size_t)0, (vm_offset_t *)0, (mach_msg_type_number_t*)0);
  214
+    ], [
  215
+      have_mach_vm_read=yes
  216
+      AC_MSG_RESULT([yes])
  217
+    ], [
  218
+      AC_MSG_RESULT([no])
  219
+    ])
  220
+  fi
  221
+
  222
+  if test "$have_mach_vm_read" = "yes"; then
  223
+    AC_DEFINE([HAVE_MACH_VM_READ], 1, [do we have mach_vm_read?])
  224
+  fi
  225
+
  226
+  proc_mem_file=""
  227
+
  228
+  if test -r /proc/$$/mem ; then
  229
+    proc_mem_file="mem"
  230
+  else
  231
+    if test -r /proc/$$/as ; then
  232
+      proc_mem_file="as"
  233
+    fi
  234
+  fi
  235
+
  236
+  if test -n "$proc_mem_file" ; then
  237
+    AC_MSG_CHECKING([for proc mem file])
  238
+  
  239
+    AC_TRY_RUN([
  240
+      #define _GNU_SOURCE
  241
+      #define _FILE_OFFSET_BITS 64
  242
+      #include <stdint.h>
  243
+      #include <unistd.h>
  244
+      #include <sys/types.h>
  245
+      #include <sys/stat.h>
  246
+      #include <fcntl.h>
  247
+      #include <stdio.h>
  248
+      int main()
  249
+      {
  250
+        long v1 = (unsigned int) -1, v2 = 0;
  251
+        char buf[128];
  252
+        int fd;
  253
+        sprintf(buf, "/proc/%d/$proc_mem_file", getpid());
  254
+        fd = open(buf, O_RDONLY);
  255
+        if (0 > fd) {
  256
+          return 1;
  257
+        }
  258
+        if (sizeof(long) != pread(fd, &v2, sizeof(long), (uintptr_t) &v1)) {
  259
+          close(fd);
  260
+          return 1;
  261
+        }
  262
+        close(fd);
  263
+        return v1 != v2;
  264
+      }
  265
+    ], [
  266
+      AC_MSG_RESULT([$proc_mem_file])
  267
+    ], [
  268
+      proc_mem_file=""
  269
+      AC_MSG_RESULT([no])
  270
+    ], [
  271
+      AC_MSG_RESULT([skipped (cross compiling)])
  272
+    ])
  273
+  fi
  274
+  
  275
+  if test -n "$proc_mem_file"; then
  276
+    AC_DEFINE_UNQUOTED([PROC_MEM_FILE], "$proc_mem_file", [/proc/pid/mem interface])
  277
+  fi
  278
+  
  279
+  fpm_trace_type=""
  280
+
  281
+  if test "$have_ptrace" = "yes"; then
  282
+    fpm_trace_type=ptrace
  283
+    
  284
+  elif test -n "$proc_mem_file"; then
  285
+    fpm_trace_type=pread
  286
+    
  287
+  elif test "$have_mach_vm_read" = "yes" ; then
  288
+    fpm_trace_type=mach
  289
+    
  290
+  else
  291
+    AC_MSG_WARN([FPM Trace - ptrace, pread, or mach: could not be found])    
  292
+  fi
  293
+  
  294
+])
  295
+
  296
+AC_DEFUN([AC_FPM_BUILTIN_ATOMIC],
  297
+[
  298
+  AC_MSG_CHECKING([if gcc supports __sync_bool_compare_and_swap])
  299
+  AC_TRY_LINK(,
  300
+  [
  301
+    int variable = 1;
  302
+    return (__sync_bool_compare_and_swap(&variable, 1, 2)
  303
+           && __sync_add_and_fetch(&variable, 1)) ? 1 : 0;
  304
+  ],
  305
+  [
  306
+    AC_MSG_RESULT([yes])
  307
+    AC_DEFINE(HAVE_BUILTIN_ATOMIC, 1, [Define to 1 if gcc supports __sync_bool_compare_and_swap() a.o.])
  308
+  ],
  309
+  [
  310
+    AC_MSG_RESULT([no])
  311
+  ])
  312
+])
  313
+
  314
+AC_DEFUN([AC_FPM_LQ],
  315
+[
  316
+  have_lq=no
  317
+
  318
+  AC_MSG_CHECKING([for TCP_INFO])
  319
+
  320
+  AC_TRY_COMPILE([ #include <netinet/tcp.h> ], [struct tcp_info ti; int x = TCP_INFO;], [
  321
+    have_lq=tcp_info
  322
+    AC_MSG_RESULT([yes])
  323
+  ], [
  324
+    AC_MSG_RESULT([no])
  325
+  ])
  326
+
  327
+  if test "$have_lq" = "tcp_info"; then
  328
+    AC_DEFINE([HAVE_LQ_TCP_INFO], 1, [do we have TCP_INFO?])
  329
+  fi
  330
+
  331
+  if test "$have_lq" = "no" ; then
  332
+    AC_MSG_CHECKING([for SO_LISTENQLEN])
  333
+
  334
+    AC_TRY_COMPILE([ #include <sys/socket.h> ], [int x = SO_LISTENQLIMIT; int y = SO_LISTENQLEN;], [
  335
+      have_lq=so_listenq
  336
+      AC_MSG_RESULT([yes])
  337
+    ], [
  338
+      AC_MSG_RESULT([no])
  339
+    ])
  340
+
  341
+    if test "$have_lq" = "tcp_info"; then
  342
+      AC_DEFINE([HAVE_LQ_SO_LISTENQ], 1, [do we have SO_LISTENQxxx?])
  343
+    fi
  344
+  fi
  345
+])
  346
+dnl }}}
  347
+
  348
+AC_DEFUN([AC_FPM_SYSCONF],
  349
+[
  350
+	AC_MSG_CHECKING([for sysconf])
  351
+
  352
+	AC_TRY_COMPILE([ #include <unistd.h> ], [sysconf(_SC_CLK_TCK);], [
  353
+		AC_DEFINE([HAVE_SYSCONF], 1, [do we have sysconf?])
  354
+		AC_MSG_RESULT([yes])
  355
+	], [
  356
+		AC_MSG_RESULT([no])
  357
+	])
  358
+])
  359
+dnl }}}
  360
+
  361
+AC_DEFUN([AC_FPM_TIMES],
  362
+[
  363
+	AC_MSG_CHECKING([for times])
  364
+
  365
+	AC_TRY_COMPILE([ #include <sys/times.h> ], [struct tms t; times(&t);], [
  366
+		AC_DEFINE([HAVE_TIMES], 1, [do we have times?])
  367
+		AC_MSG_RESULT([yes])
  368
+	], [
  369
+		AC_MSG_RESULT([no])
  370
+	])
  371
+])
  372
+dnl }}}
  373
+
  374
+AC_DEFUN([AC_FPM_KQUEUE],
  375
+[
  376
+	AC_MSG_CHECKING([for kqueue])
  377
+
  378
+	AC_TRY_COMPILE(
  379
+	[ 
  380
+		#include <sys/types.h>
  381
+		#include <sys/event.h>
  382
+		#include <sys/time.h>
  383
+	], [
  384
+		int kfd;
  385
+		struct kevent k;
  386
+		kfd = kqueue();
  387
+		/* 0 -> STDIN_FILENO */
  388
+		EV_SET(&k, 0, EVFILT_READ , EV_ADD | EV_CLEAR, 0, 0, NULL);
  389
+	], [
  390
+		AC_DEFINE([HAVE_KQUEUE], 1, [do we have kqueue?])
  391
+		AC_MSG_RESULT([yes])
  392
+	], [
  393
+		AC_MSG_RESULT([no])
  394
+	])
  395
+])
  396
+dnl }}}
  397
+
  398
+AC_DEFUN([AC_FPM_PORT],
  399
+[
  400
+	AC_MSG_CHECKING([for port framework])
  401
+
  402
+	AC_TRY_COMPILE(
  403
+	[ 
  404
+		#include <port.h>
  405
+	], [
  406
+		int port;
  407
+
  408
+		port = port_create();
  409
+		if (port < 0) {
  410
+			return 1;
  411
+		}
  412
+	], [
  413
+		AC_DEFINE([HAVE_PORT], 1, [do we have port framework?])
  414
+		AC_MSG_RESULT([yes])
  415
+	], [
  416
+		AC_MSG_RESULT([no])
  417
+	])
  418
+])
  419
+dnl }}}
  420
+
  421
+AC_DEFUN([AC_FPM_DEVPOLL],
  422
+[
  423
+	AC_MSG_CHECKING([for /dev/poll])
  424
+
  425
+	AC_TRY_COMPILE(
  426
+	[ 
  427
+		#include <stdio.h>
  428
+		#include <sys/devpoll.h>
  429
+	], [
  430
+		int n, dp;
  431
+		struct dvpoll dvp;
  432
+		dp = 0;
  433
+		dvp.dp_fds = NULL;
  434
+		dvp.dp_nfds = 0;
  435
+		dvp.dp_timeout = 0;
  436
+		n = ioctl(dp, DP_POLL, &dvp)
  437
+	], [
  438
+		AC_DEFINE([HAVE_DEVPOLL], 1, [do we have /dev/poll?])
  439
+		AC_MSG_RESULT([yes])
  440
+	], [
  441
+		AC_MSG_RESULT([no])
  442
+	])
  443
+])
  444
+dnl }}}
  445
+
  446
+AC_DEFUN([AC_FPM_EPOLL],
  447
+[
  448
+	AC_MSG_CHECKING([for epoll])
  449
+
  450
+	AC_TRY_COMPILE(
  451
+	[ 
  452
+		#include <sys/epoll.h>
  453
+	], [
  454
+		int epollfd;
  455
+		struct epoll_event e;
  456
+
  457
+		epollfd = epoll_create(1);
  458
+		if (epollfd < 0) {
  459
+			return 1;
  460
+		}
  461
+
  462
+		e.events = EPOLLIN | EPOLLET;
  463
+		e.data.fd = 0;
  464
+
  465
+		if (epoll_ctl(epollfd, EPOLL_CTL_ADD, 0, &e) == -1) {
  466
+			return 1;
  467
+		}
  468
+
  469
+		e.events = 0;
  470
+		if (epoll_wait(epollfd, &e, 1, 1) < 0) {
  471
+			return 1;
  472
+		}
  473
+	], [
  474
+		AC_DEFINE([HAVE_EPOLL], 1, [do we have epoll?])
  475
+		AC_MSG_RESULT([yes])
  476
+	], [
  477
+		AC_MSG_RESULT([no])
  478
+	])
  479
+])
  480
+dnl }}}
  481
+
  482
+AC_DEFUN([AC_FPM_POLL],
  483
+[
  484
+	AC_MSG_CHECKING([for poll])
  485
+
  486
+	AC_TRY_COMPILE(
  487
+	[ 
  488
+		#include <poll.h>
  489
+	], [
  490
+		struct pollfd fds[2];
  491
+
  492
+		fds[0].fd = 0;
  493
+		fds[0].events = POLLIN;
  494
+
  495
+		fds[1].fd = 0;
  496
+		fds[1].events = POLLIN;
  497
+
  498
+		 poll(fds, 2, 1);
  499
+	], [
  500
+		AC_DEFINE([HAVE_POLL], 1, [do we have poll?])
  501
+		AC_MSG_RESULT([yes])
  502
+	], [
  503
+		AC_MSG_RESULT([no])
  504
+	])
  505
+])
  506
+dnl }}}
  507
+
  508
+AC_DEFUN([AC_FPM_SELECT],
  509
+[
  510
+	AC_MSG_CHECKING([for select])
  511
+
  512
+	AC_TRY_COMPILE(
  513
+	[ 
  514
+		/* According to POSIX.1-2001 */
  515
+		#include <sys/select.h>
  516
+
  517
+		/* According to earlier standards */
  518
+		#include <sys/time.h>
  519
+		#include <sys/types.h>
  520
+		#include <unistd.h>
  521
+	], [
  522
+		fd_set fds;
  523
+		struct timeval t;
  524
+		t.tv_sec = 0;
  525
+		t.tv_usec = 42;
  526
+		FD_ZERO(&fds);
  527
+		/* 0 -> STDIN_FILENO */
  528
+		FD_SET(0, &fds);
  529
+		select(FD_SETSIZE, &fds, NULL, NULL, &t);
  530
+	], [
  531
+		AC_DEFINE([HAVE_SELECT], 1, [do we have select?])
  532
+		AC_MSG_RESULT([yes])
  533
+	], [
  534
+		AC_MSG_RESULT([no])
  535
+	])
  536
+])
  537
+dnl }}}
  538
+
  539
+
  540
+AC_MSG_CHECKING(for FPM build)
  541
+if test "$PHP_FPM" != "no"; then
  542
+  AC_MSG_RESULT($PHP_FPM)
  543
+
  544
+  AC_FPM_STDLIBS
  545
+  AC_FPM_PRCTL
  546
+  AC_FPM_CLOCK
  547
+  AC_FPM_TRACE
  548
+  AC_FPM_BUILTIN_ATOMIC
  549
+  AC_FPM_LQ
  550
+	AC_FPM_SYSCONF
  551
+	AC_FPM_TIMES
  552
+	AC_FPM_KQUEUE
  553
+	AC_FPM_PORT
  554
+	AC_FPM_DEVPOLL
  555
+	AC_FPM_EPOLL
  556
+	AC_FPM_POLL
  557
+	AC_FPM_SELECT
  558
+
  559
+  PHP_ARG_WITH(fpm-user,,
  560
+  [  --with-fpm-user[=USER]  Set the user for php-fpm to run as. (default: nobody)], nobody, no)
  561
+
  562
+  PHP_ARG_WITH(fpm-group,,
  563
+  [  --with-fpm-group[=GRP]  Set the group for php-fpm to run as. For a system user, this 
  564
+                  should usually be set to match the fpm username (default: nobody)], nobody, no)
  565
+
  566
+  if test -z "$PHP_FPM_USER" -o "$PHP_FPM_USER" = "yes" -o "$PHP_FPM_USER" = "no"; then
  567
+    php_fpm_user="nobody"
  568
+  else
  569
+    php_fpm_user="$PHP_FPM_USER"
  570
+  fi
  571
+
  572
+  if test -z "$PHP_FPM_GROUP" -o "$PHP_FPM_GROUP" = "yes" -o "$PHP_FPM_GROUP" = "no"; then
  573
+    php_fpm_group="nobody"
  574
+  else
  575
+    php_fpm_group="$PHP_FPM_GROUP"
  576
+  fi
  577
+
  578
+  PHP_SUBST_OLD(php_fpm_user)
  579
+  PHP_SUBST_OLD(php_fpm_group)
  580
+  php_fpm_sysconfdir=`eval echo $sysconfdir`
  581
+  PHP_SUBST_OLD(php_fpm_sysconfdir)
  582
+  php_fpm_localstatedir=`eval echo $localstatedir`
  583
+  PHP_SUBST_OLD(php_fpm_localstatedir)
  584
+  php_fpm_prefix=`eval echo $prefix`
  585
+  PHP_SUBST_OLD(php_fpm_prefix)
  586
+
  587
+  AC_DEFINE_UNQUOTED(PHP_FPM_USER, "$php_fpm_user", [fpm user name])
  588
+  AC_DEFINE_UNQUOTED(PHP_FPM_GROUP, "$php_fpm_group", [fpm group name])
  589
+
  590
+  AC_DEFINE_UNQUOTED(PHP_FPM_USER, "$php_fpm_user", [fpm user name])
  591
+  AC_DEFINE_UNQUOTED(PHP_FPM_GROUP, "$php_fpm_group", [fpm group name])
  592
+
  593
+  PHP_ADD_BUILD_DIR(sapi/fpm/fpm)
  594
+  PHP_ADD_BUILD_DIR(sapi/fpm/fpm/events)
  595
+  PHP_OUTPUT(sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.service sapi/fpm/php-fpm.8 sapi/fpm/status.html)
  596
+  PHP_ADD_MAKEFILE_FRAGMENT([$abs_srcdir/sapi/fpm/Makefile.frag])
  597
+
  598
+  SAPI_FPM_PATH=sapi/fpm/php-fpm
  599
+
  600
+  
  601
+  if test "$fpm_trace_type" && test -f "$abs_srcdir/sapi/fpm/fpm/fpm_trace_$fpm_trace_type.c"; then
  602
+    PHP_FPM_TRACE_FILES="fpm/fpm_trace.c fpm/fpm_trace_$fpm_trace_type.c"
  603
+  fi
  604
+  
  605
+  PHP_FPM_CFLAGS="-I$abs_srcdir/sapi/fpm"
  606
+ 
  607
+  PHP_FPM_FILES="fpm/fastcgi.c \
  608
+    fpm/fpm.c \
  609
+    fpm/fpm_children.c \
  610
+    fpm/fpm_cleanup.c \
  611
+    fpm/fpm_clock.c \
  612
+    fpm/fpm_conf.c \
  613
+    fpm/fpm_env.c \
  614
+    fpm/fpm_events.c \
  615
+		fpm/fpm_log.c \
  616
+    fpm/fpm_main.c \
  617
+    fpm/fpm_php.c \
  618
+    fpm/fpm_php_trace.c \
  619
+    fpm/fpm_process_ctl.c \
  620
+    fpm/fpm_request.c \
  621
+    fpm/fpm_shm.c \
  622
+    fpm/fpm_scoreboard.c \
  623
+    fpm/fpm_signals.c \
  624
+    fpm/fpm_sockets.c \
  625
+    fpm/fpm_status.c \
  626
+    fpm/fpm_stdio.c \
  627
+    fpm/fpm_unix.c \
  628
+    fpm/fpm_worker_pool.c \
  629
+    fpm/zlog.c \
  630
+		fpm/events/select.c \
  631
+		fpm/events/poll.c \
  632
+		fpm/events/epoll.c \
  633
+		fpm/events/kqueue.c \
  634
+		fpm/events/devpoll.c \
  635
+		fpm/events/port.c \
  636
+  "
  637
+
  638
+  PHP_SELECT_SAPI(fpm, program, $PHP_FPM_FILES $PHP_FPM_TRACE_FILES, $PHP_FPM_CFLAGS, '$(SAPI_FPM_PATH)')
  639
+
  640
+  case $host_alias in
  641
+      *aix*)
  642
+        BUILD_FPM="echo '\#! .' > php.sym && echo >>php.sym && nm -BCpg \`echo \$(PHP_GLOBAL_OBJS) \$(PHP_BINARY_OBJS) \$(PHP_FPM_OBJS) | sed 's/\([A-Za-z0-9_]*\)\.lo/\1.o/g'\` | \$(AWK) '{ if (((\$\$2 == \"T\") || (\$\$2 == \"D\") || (\$\$2 == \"B\")) && (substr(\$\$3,1,1) != \".\")) { print \$\$3 } }' | sort -u >> php.sym && \$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) -Wl,-brtl -Wl,-bE:php.sym \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_FPM_OBJS) \$(EXTRA_LIBS) \$(FPM_EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_FPM_PATH)"
  643
+        ;;
  644
+      *darwin*)
  645
+        BUILD_FPM="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_BINARY_OBJS:.lo=.o) \$(PHP_FPM_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(FPM_EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_FPM_PATH)"
  646
+      ;;
  647
+      *)
  648
+        BUILD_FPM="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_BINARY_OBJS) \$(PHP_FPM_OBJS) \$(EXTRA_LIBS) \$(FPM_EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_FPM_PATH)"
  649
+      ;;
  650
+  esac
  651
+
  652
+  PHP_SUBST(SAPI_FPM_PATH)
  653
+  PHP_SUBST(BUILD_FPM)
  654
+
  655
+else
  656
+  AC_MSG_RESULT(no)
  657
+fi
10  sapi/fpm/fpm/fpm_unix.c
@@ -121,16 +121,16 @@ static int fpm_unix_conf_wp(struct fpm_worker_pool_s *wp) /* {{{ */
121 121
 		}
122 122
 	} else { /* not root */
123 123
 		if (wp->config->user && *wp->config->user) {
124  
-			zlog(ZLOG_WARNING, "[pool %s] 'user' directive is ignored when FPM is not running as root", wp->config->name);
  124
+			zlog(ZLOG_NOTICE, "[pool %s] 'user' directive is ignored when FPM is not running as root", wp->config->name);
125 125
 		}
126 126
 		if (wp->config->group && *wp->config->group) {
127  
-			zlog(ZLOG_WARNING, "[pool %s] 'group' directive is ignored when FPM is not running as root", wp->config->name);
  127
+			zlog(ZLOG_NOTICE, "[pool %s] 'group' directive is ignored when FPM is not running as root", wp->config->name);
128 128
 		}
129 129
 		if (wp->config->chroot && *wp->config->chroot) {
130  
-			zlog(ZLOG_WARNING, "[pool %s] 'chroot' directive is ignored when FPM is not running as root", wp->config->name);
  130
+			zlog(ZLOG_NOTICE, "[pool %s] 'chroot' directive is ignored when FPM is not running as root", wp->config->name);
131 131
 		}
132 132
 		if (wp->config->process_priority != 64) {
133  
-			zlog(ZLOG_WARNING, "[pool %s] 'process.priority' directive is ignored when FPM is not running as root", wp->config->name);
  133
+			zlog(ZLOG_NOTICE, "[pool %s] 'process.priority' directive is ignored when FPM is not running as root", wp->config->name);
134 134
 		}
135 135
 
136 136
 		/* set up HOME and USER anyway */
@@ -350,7 +350,7 @@ int fpm_unix_init_main() /* {{{ */
350 350
 				return -1;
351 351
 			}
352 352
 		} else {
353  
-			zlog(ZLOG_WARNING, "'process.priority' directive is ignored when FPM is not running as root");
  353
+			zlog(ZLOG_NOTICE, "'process.priority' directive is ignored when FPM is not running as root");
354 354
 		}
355 355
 	}
356 356
 
12  sapi/fpm/php-fpm.service.in
... ...
@@ -0,0 +1,12 @@
  1
+[Unit]
  2
+Description=The PHP FastCGI Process Manager
  3
+After=syslog.target network.target
  4
+
  5
+[Service]
  6
+PIDFile=@localstatedir@/run/php-fpm.pid
  7
+ExecStart=@sbindir@/php-fpm --nodaemonize --fpm-config @sysconfdir@/php-fpm.conf
  8
+ExecReload=/bin/kill -USR2 $MAINPID
  9
+
  10
+[Install]
  11
+WantedBy=multi-user.target
  12
+

No commit comments for this range

Something went wrong with that request. Please try again.