Content of /usr/local/etc/rc.d/foswiki file for FreeBSD 10.2:

#!/bin/sh                                                                                            

# PROVIDE: foswiki                                                                                   
# REQUIRE: DAEMON                                                                                    
# KEYWORD: shutdown                                                                                  

. /etc/rc.subr

name="foswiki"
rcvar="foswiki_enable"

# foswiki params                                                                                     
if [ -r /usr/local/etc/$name ]; then
    . /usr/local/etc/$name
fi

# foswiki defaults, if file does not set param                                                       
: ${foswiki_user:=www}
: ${foswiki_group:=www}
: ${foswiki_root:=/usr/local/www/foswiki}
: ${fcgi:=foswiki.fcgi}
: ${bind:=127.0.0.1:9000}
: ${children:=3}
: ${max_requests:=-1}
: ${max_size:=250000}
: ${check_size:=10}
: ${quiet:=true}
: ${pidfile:=/var/run/$name.pid}

# load /etc/rc.conf params                                                                           
load_rc_config $name
: ${rc_debug=yes}

# echo foswiki_root: $foswiki_root                                                                   

desc="Foswiki backend server"
# Not sure why to set PATH or what to set it to.
PATH=/sbin:/bin:/usr/sbin:/usr/bin

command=$foswiki_root/bin/$fcgi
procname=$name-fcgi-pm
foswiki_chdir=${foswiki_root}/bin

start_precmd=do_start_precmd

do_start_precmd()
{
    :>$pidfile
    chown $foswiki_user:$foswiki_group $pidfile
    command_args="-n $children -l $bind -p $pidfile -d -c $check_size -x $max_requests -s $max_size"
    if $quiet; then
        command_args="$command_args -q"
    fi
}


run_rc_command "$1"

sample content of /usr/local/etc/foswiki file:
foswiki_root=/usr/local/www/foswiki
fcgi=foswiki.fcgi
bind=127.0.0.1:9000
children=3
max_requests=-1
max_size=200000
check_size=10
quiet=true

Configuration listed above works with service foswiki start, stop and status commands. Other commands were not tested.
Discussion

Fixes look reasonable.

-- Sergei G; 12 January 2017

Fixing some typos, please check and verify my changes.

-- Manas; 7th January 2017

Variable foswiki_root shoud be probably renamed to app_root. Variables foswiki_user and foswiki_group have special meaning to FreeBSD rc processing and thus require specified names. However, this naming convension collides with foswiki_root and that's why app_root is a goot alternative.

-- Sergei G September 28, 2015

The initial version of the Foswiki (1.0.6) port has been committed to the FreeBSD ports tree, and more information may be found here: http://www.freshports.org/www/foswiki/. At the moment, Foswiki plugins are not packaged as individual ports, but support for that is coming in a future version of the port.

-- GregLarkin - 10 Aug 2009

The first version of a FreeBSD port of Foswiki is available, and I'd like some Foswiki users on FreeBSD to give it a try before I commit it to the ports tree.

It can be downloaded from: http://people.freebsd.org/~glarkin/shars/foswiki.shar. Install the port with the following commands:
cd /usr/ports
fetch http://people.freebsd.org/~glarkin/shars/foswiki.shar
sh foswiki.shar
cd www/foswiki && make install clean
 

I'm interested in feedback for any of the following questions and more:

- Does the port have the correct OPTIONS?
- Are all necessary dependencies included?
- Is the sample Apache config file acceptable?
- Is the pkg-message clear enough?
- Are you able to get a working Foswiki installation without too much
manual tweaking?
- Does the port uninstall cleanly?

Uninstalling does leave a number of files and directories around (see
dirrmtry statements in pkg-plist) because I cannot predict how many new
topics will be created inside of the installation directory.

This port doesn't install of the plugins yet, but those will follow.

-- GregLarkin - 15 Jun 2009
Topic revision: r6 - 12 Jan 2017, SergeiG
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy