Hello,

I'm trying to create a script that would launch php-cgi in fastcgi mode.
So far, I've the following script :

#!/bin/sh
#
# PROVIDE: phpfastcgi
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable phpfastcgi :
#
# phpfastcgi_enable (bool):             Set it to "YES" to enable
phpfastcgi
#                                       Default is "NO".
# phpfastcgi_flags (str):               Set the uwsgi command line
arguments
#                                       Default is "-M -L".

. /etc/rc.subr

name="phpfastcgi"
rcvar=`set_rcvar`

[ -z "$phpfastcgi_enable" ]          && phpfastcgi_enable="NO"
[ -z "$phpfastcgi_flags" ]          && phpfastcgi_flags=""

load_rc_config $name

sig_stop="TERM"
pidfile="/var/run/${name}/${name}.pid"
command="/usr/sbin/daemon -f -p ${pidfile} /usr/local/bin/php-cgi"

run_rc_command "$1"

When invoked with start argument, it barfs at me but launches php-cgi as
expected :
e...@srvbsdfenssv:~> sudo /usr/local/etc/rc.d/phpfastcgi start
/usr/local/etc/rc.d/phpfastcgi: WARNING: no shebang line in /usr/sbin/daemon
[: /usr/sbin/daemon: unexpected operator
Starting phpfastcgi.

When invoked with stop argument, it errors and doesn't stop the process
as expected :
e...@srvbsdfenssv:~> sudo /usr/local/etc/rc.d/phpfastcgi stop
/usr/local/etc/rc.d/phpfastcgi: WARNING: no shebang line in /usr/sbin/daemon
phpfastcgi not running? (check /var/run/phpfastcgi/phpfastcgi.pid).

>From a quick peek at /etc/rc.subr, it seems that messages regarding
lack of shebang line in /usr/sbin/daemon indicate something is wrong in
my script but atm, I can't figure it.

Any idea, anyone ?

Kind Regards

Éric Masson

-- 
 RJ> j'ai eu des cookies sur mon HD et j'ai un peu peur des représailles
 Il faut reformater ton disque dur et le jetter depuis le 3e étage de la
 tour Eiffel pour le détruire irrémédiablement sans laisser de traces.
 -+- LP in <http://www.le-gnu.net> : Par ici ou parano c'est pareil -+-
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to