1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-18 08:02:48 +00:00

I forgot to add some new files so the Previous commit was incomplete.

PR:		ports/144262
Submitted by:	Peter Vereshagin <peter@vereshagin.org>
This commit is contained in:
Steven Kreuzer 2010-04-14 13:58:53 +00:00
parent b3ad5b01ea
commit 91300f7e73
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=252680
3 changed files with 79 additions and 0 deletions

View File

@ -0,0 +1,29 @@
#!/bin/sh
# PROVIDE: fcgi_spawn
# REQUIRE: LOGIN %%MYSQL%% %%PGSQL%%
# BEFORE:
# KEYWORD: shutdown
. %%RC_SUBR%%
name="fcgi_spawn"
rcvar=${name}_enable
fcgi_spawn_enable=${fcgi_spawn_enable:-"NO"}
pidfile=${fcgi_spawn_pid:-"/var/run/${name}.pid"}
load_rc_config ${name}
fcgi_spawn_config_path=${fcgi_spawn_config_path:-"/usr/local/etc/${name}"}
fcgi_spawn_log=${fcgi_spawn_log:-"/var/log/${name}.log"}
fcgi_spawn_socket_path=${fcgi_spawn_socket_path:-"/tmp/spawner.sock"}
fcgi_spawn_redefine_exit=${fcgi_spawn_redefine_exit:-"0"}
fcgi_spawn_username=${fcgi_spawn_username:-"fcgi"}
fcgi_spawn_groupname=${fcgi_spawn_groupname:-"fcgi"}
fcgi_spawn_flags=${fcgi_spawn_flags:-""}
command="%%PREFIX%%/bin/${name}"
command_args="-l ${fcgi_spawn_log} -p ${pidfile} -c ${fcgi_spawn_config_path} -u ${fcgi_spawn_username} -g ${fcgi_spawn_groupname} -s ${fcgi_spawn_socket_path}"
required_dirs=${fcgi_spawn_config_path}
run_rc_command "$1"

View File

@ -0,0 +1,16 @@
#!/bin/sh
#
# $FreeBSD$
#
if [ "$2" != "POST-DEINSTALL" ]; then
exit 0
fi
USER=fcgi
if pw usershow "${USER}" 2>/dev/null 1>&2; then
echo "To delete user permanently, use 'pw userdel ${USER}'. Also, unused groups of that user should be deleted, too"
fi
exit 0

View File

@ -0,0 +1,34 @@
#!/bin/sh
#
# $FreeBSD$
#
if [ "$2" != "PRE-INSTALL" ]; then
exit 0
fi
USER=fcgi
GROUP=${USER}
if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then
if pw groupadd ${GROUP} ; then
echo "Added group \"${GROUP}\"."
else
echo "Adding group \"${GROUP}\" failed..."
exit 1
fi
fi
if ! pw usershow "${USER}" 2>/dev/null 1>&2; then
if pw useradd ${USER} -g ${GROUP} -h - \
-s "/sbin/nologin" -d "/nonexistent" \
-c "FastCGI Spawner"; \
then
echo "Added user \"${USER}\"."
else
echo "Adding user \"${USER}\" failed..."
exit 1
fi
fi
exit 0