On Wed, Nov 08, 2017 at 08:43:55PM +0100, Martijn van Duren wrote:
> Hello C.,
> 
> Can you start up the daemon process from the CLI (without the rc
> script)? If not and it still has the same error message as below (which
> I reckon it will) you might want to change your mysqli.default_socket =
> in your /etc/php-7.0.ini.
> Do note however that this will also affect php-fpm and mod_php which run
> chrooted by default (hence the weird path), so if you need those installs
> unaffected try to create a custom ini-file and specify it with -c as a
> php-argument.
> 
> Also note that php is not designed to write daemons in and should only
> be done if there are no other options. The rc-script won't restart your
> daemon automatically if it crashes.
> 
> Hope this helps.
> 
> martijn@
> 
> > 

Wow!! ... Many many thanks Martijn. I have added "-c" switch to daemon_args and 
created another .ini file for this "daemon", and it works. Here it is:

#!/bin/sh -x
#

daemon="/usr/local/bin/php-7.0"
daemon_flags="-c /etc/tt-rss/php-7.0.ini /var/www/htdocs/rss/update_daemon2.php 
--log /tmp/update_rss.log"
daemon_user="www"

. /etc/rc.d/rc.subr

pexp="${daemon}${daemon_flags:+ ${daemon_flags}}"

rc_bg=YES
rc_reload=NO

rc_post() {
        rm -f /var/www/htdocs/rss/lock/update_daemon.lock
}

rc_cmd $1

 Inside .ini I have configured mysqli.default_socket option:

mysqli.default_socket = /var/www/var/run/mysql/mysql.sock

-- 
Greetings,
C. L. Martinez

Reply via email to