diff options
author | Steven Kreuzer <skreuzer@FreeBSD.org> | 2010-04-14 13:58:53 +0000 |
---|---|---|
committer | Steven Kreuzer <skreuzer@FreeBSD.org> | 2010-04-14 13:58:53 +0000 |
commit | 91300f7e73a9b098997813993d35a5d70490b613 (patch) | |
tree | 1c3dcdbb8d41d0df53d66921a5cc59922588a252 /www/p5-FCGI-Spawn | |
parent | b3ad5b01ea21e687e36b62264e5dd8de3a44b719 (diff) | |
download | ports-91300f7e73a9b098997813993d35a5d70490b613.tar.gz ports-91300f7e73a9b098997813993d35a5d70490b613.zip |
I forgot to add some new files so the Previous commit was incomplete.
PR: ports/144262
Submitted by: Peter Vereshagin <peter@vereshagin.org>
Notes
Notes:
svn path=/head/; revision=252680
Diffstat (limited to 'www/p5-FCGI-Spawn')
-rw-r--r-- | www/p5-FCGI-Spawn/files/fcgi_spawn.in | 29 | ||||
-rw-r--r-- | www/p5-FCGI-Spawn/pkg-deinstall | 16 | ||||
-rw-r--r-- | www/p5-FCGI-Spawn/pkg-install | 34 |
3 files changed, 79 insertions, 0 deletions
diff --git a/www/p5-FCGI-Spawn/files/fcgi_spawn.in b/www/p5-FCGI-Spawn/files/fcgi_spawn.in new file mode 100644 index 000000000000..ac3ef3e7b4b9 --- /dev/null +++ b/www/p5-FCGI-Spawn/files/fcgi_spawn.in @@ -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" diff --git a/www/p5-FCGI-Spawn/pkg-deinstall b/www/p5-FCGI-Spawn/pkg-deinstall new file mode 100644 index 000000000000..17dd3452ada8 --- /dev/null +++ b/www/p5-FCGI-Spawn/pkg-deinstall @@ -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 diff --git a/www/p5-FCGI-Spawn/pkg-install b/www/p5-FCGI-Spawn/pkg-install new file mode 100644 index 000000000000..64d8de07eb78 --- /dev/null +++ b/www/p5-FCGI-Spawn/pkg-install @@ -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 |