These are chat archives for phpbrew/phpbrew

13th
Jun 2016
William Notowidagdo
@williamn
Jun 13 2016 03:27
Hi all
I tried to setup FPM autostart on Ubuntu
with phpbrew fpm setup --initd
but phpbrew always get back with
Usage: phpbrew fpm [start|stop|restart|module|test|help|config]
am I missing something?
Yo-An Lin
@c9s
Jun 13 2016 03:29
Run phpbrew init
And reload the shell
William Notowidagdo
@williamn
Jun 13 2016 03:29
ok I will try @c9s
Yo-An Lin
@c9s
Jun 13 2016 03:29
Or php path/to/phpbrew fpm setup will do the same thing
I havent tried initd script
:p
It was derived from php7.0 fpm init script
If it doesnt work for you, we might need a patch
William Notowidagdo
@williamn
Jun 13 2016 03:34
I did sudo phpbrew fpm setup --initd and got Exception: PHPBREW_PHP is not set
maybe because root doesnt identify phpbrew
so I need to set PHPBREW_PHP to my phpbrew install dir right?
Yo-An Lin
@c9s
Jun 13 2016 03:36
you shouldnt run it with sudo
phpbrew depends on env vars
but you can specify the version name
William Notowidagdo
@williamn
Jun 13 2016 03:37
I run with sudo because of this
Yo-An Lin
@c9s
Jun 13 2016 03:37
At the end of the command
William Notowidagdo
@williamn
Jun 13 2016 03:37
/etc/init.d/phpbrew-fpm is not writable.
Yo-An Lin
@c9s
Jun 13 2016 03:37
I do this:
sudo phpbrew fpm setup --initd 5.6
William Notowidagdo
@williamn
Jun 13 2016 03:38
yes I did this now phpbrew fpm setup --initd php-7.0.6
Yo-An Lin
@c9s
Jun 13 2016 03:38
Ok
Did it work?
William Notowidagdo
@williamn
Jun 13 2016 03:38
nope, even with sudo I got
/etc/init.d/phpbrew-fpm is not writable
Yo-An Lin
@c9s
Jun 13 2016 03:39
Use --stdout Option and move the file?
William Notowidagdo
@williamn
Jun 13 2016 03:39
ok I will try
ok I moved the file
now trying to restart the machine to see if the initd script works as expected
Yo-An Lin
@c9s
Jun 13 2016 03:45
Maybe just /etc/init.d/phpbrew-fpm restart ?
You need to run update-rc.d script to setup rc level for the init script
William Notowidagdo
@williamn
Jun 13 2016 03:46
ah ok
@c9s /etc/init.d/phpbrew start doesnt not running the FPM
/etc/init.d/phpbrew status giv me
  • phpbrew-fpm is not running
Yo-An Lin
@c9s
Jun 13 2016 03:55
Which linux dist are you running on?
William Notowidagdo
@williamn
Jun 13 2016 03:57
Ubuntu 14.04
Yo-An Lin
@c9s
Jun 13 2016 03:58
Can you gist your init.d file?
William Notowidagdo
@williamn
Jun 13 2016 03:58
ok wait
Yo-An Lin
@c9s
Jun 13 2016 04:02
what if you move up the pidFile=....
and add --pid=$pidFile to the DAEMON_ARGS ?
William Notowidagdo
@williamn
Jun 13 2016 04:10
ok
sudo /etc/init.d/phpbrew-fpm start still doesnt run the FPM
Yo-An Lin
@c9s
Jun 13 2016 04:15
I guess the lsb or start-stop-daemon is too old
the init.d was derived from Ubuntu 16.04
William Notowidagdo
@williamn
Jun 13 2016 04:15
oh ok
Yo-An Lin
@c9s
Jun 13 2016 04:16
not sure what happend,
does phpbrew fpm start work for you?
William Notowidagdo
@williamn
Jun 13 2016 04:16
are you going to add suport for 14.04?
phpbrew fpm start works for me
Yo-An Lin
@c9s
Jun 13 2016 04:16
ok then I think it's related to the lsb or start-stop-daemon
not sure for 14.04, because I don't have time to work on it right now....
and I've upgraded all machine to 16.04 XD
William Notowidagdo
@williamn
Jun 13 2016 04:17
@c9s ok, let's what I can do
Yo-An Lin
@c9s
Jun 13 2016 04:17
do you have /etc/init.d/php5-fpm ?
maybe gist it and then apply the variables in SetupCommand.php
@williamn what if you run start-stop-daemon --start --pidfile /home/deploy/.phpbrew/php/php-7.0.6/var/run/php-fpm.pid --exec /home/deploy/.phpbrew/php/php-7.0.6/sbin/php-fpm -- --daemonize --fpm-config /home/deploy/.phpbrew/php/php-7.0.6/etc/php-fpm.conf --pid /home/deploy/.phpbrew/php/php-7.0.6/var/run/php-fpm.pid ?
be sure to run phpbrew fpm stop to stop all current php-fpm processes
William Notowidagdo
@williamn
Jun 13 2016 04:22
I dont have /etc/init.d/php5-fpm
Yo-An Lin
@c9s
Jun 13 2016 04:22
remove the --quiet option
William Notowidagdo
@williamn
Jun 13 2016 04:22
ok I will try
Yo-An Lin
@c9s
Jun 13 2016 04:22
then the error message should output in the console
William Notowidagdo
@williamn
Jun 13 2016 04:25
@c9s it works
no error messages
Yo-An Lin
@c9s
Jun 13 2016 04:25
ps aux | grep php-fpm ?
ok great
William Notowidagdo
@williamn
Jun 13 2016 04:26
deploy    4135  0.0  0.5 136640  9592 ?        Ss   04:25   0:00 php-fpm: master process (/home/deploy/.phpbrew/php/php-7.0.6/etc/php-fpm.conf)                                                                                                              
deploy    4136  0.0  0.4 136640  7692 ?        S    04:25   0:00 php-fpm: pool www                                                                                                                                                                           
deploy    4137  0.4  0.9 141428 16892 ?        S    04:25   0:00 php-fpm: pool www                                                                                                                                                                           
deploy    4138  0.0  0.4 136640  7692 ?        S    04:25   0:00 php-fpm: pool www
Yo-An Lin
@c9s
Jun 13 2016 04:26
when you run /etc/init.d/phpbrew-fpm restart, there is any output?
William Notowidagdo
@williamn
Jun 13 2016 04:27
no output
Yo-An Lin
@c9s
Jun 13 2016 04:27
what if you remove --quiet and do_tmpfiles, do_check call?
around line 129, 128
William Notowidagdo
@williamn
Jun 13 2016 04:28
ok
Yo-An Lin
@c9s
Jun 13 2016 04:28
and remove the case block
with "do_start"
William Notowidagdo
@williamn
Jun 13 2016 04:29
here is line 128-130
        [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
        do_tmpfiles $VERBOSE
        do_check $VERBOSE
Yo-An Lin
@c9s
Jun 13 2016 04:29
ok, I updated the gist
William Notowidagdo
@williamn
Jun 13 2016 04:30
ok I will try
still not working
@c9s I got to go now. I will look this issue later
thanks for your time and effort @c9s
Yo-An Lin
@c9s
Jun 13 2016 04:33
no problem~
Yo-An Lin
@c9s
Jun 13 2016 04:49
@williamn found the cause
when /sbin/initctl --version is upstart,
/etc/init.d script will not be executed
service command should replace it.
William Notowidagdo
@williamn
Jun 13 2016 04:50
owh ok
Yo-An Lin
@c9s
Jun 13 2016 04:50
there is a correspond init script
William Notowidagdo
@williamn
Jun 13 2016 04:50
so I need to run with service phpbrew-fpm start?
Yo-An Lin
@c9s
Jun 13 2016 04:50
/etc/init/php5-fpm.conf
yes, but it uses different definition file
William Notowidagdo
@williamn
Jun 13 2016 04:51
ok
Yo-An Lin
@c9s
Jun 13 2016 04:51
here is the sample config:
# php5-fpm - The PHP FastCGI Process Manager

description "The PHP FastCGI Process Manager"
author "Ondřej Surý <ondrej@debian.org>"

start on runlevel [2345]
stop on runlevel [016]

# Precise upstart does not support reload signal, and thus rejects the
# job. We'd rather start the daemon, instead of forcing users to
# reboot https://bugs.launchpad.net/ubuntu/+source/php5/+bug/1272788
#
# reload signal USR2

pre-start exec /usr/lib/php5/php5-fpm-checkconf

respawn
exec /usr/sbin/php5-fpm --nodaemonize --fpm-config /etc/php5/fpm/php-fpm.conf
William Notowidagdo
@williamn
Jun 13 2016 04:51
ok great
I will try once I got some time
thanks again
Yo-An Lin
@c9s
Jun 13 2016 05:00
you're welcome!