Setting up Fogbugzmaintd on Unix or Macintosh

Fogbugzmaintd is a daemon which should be running at all times. It periodically prompts FogBugz to perform routine tasks like sending and retrieving email, purging expired spam, and backfilling certain database values after upgrade. (Fogbugzmaintd errors are logged to the syslog).

Certain php.ini settings may affect FogBugz's ability to correctly handle messages with attachments. We recommend that you increase the following settings to these values. Note: If these settings conflict with the settings required by any other PHP-based applications on your web server, please see the PHP documentation for alternatives - you may be able to edit these in fogbugz/fogbugz.conf.

 

php settingrecommended value
max_execution_time600
max_input_time600
memory_limit256M
upload_max_filesize50M
post_max_size50M


Certain MySQL settings may also affect FogBugz's ability to correctly handle messages. You should increase the MySQL max_allowed_packet setting to "50M". You can change this setting in the my.cnf file usually located in your mysql/data directory. See the MySQL site for more info.

Lastly, on some machines (RedHat 9 notably), PHP files are set to limit uploads to 500k. Look for a file called php.conf in your httpd/conf.d directory. If there is a value called LimitRequestBody, set it to 0 (meaning unlimited). If you cannot upload files over 500k, this is why.

In the FogBugz/Accessories folder, there is a shell script named fogbugzmaintd which can be used to start and stop the daemon:

$ fogbugzmaintd start
$ fogbugzmaintd stop

To set up fogbugzmaintd:

  1. Log on as root or issue the su command
  2. Start fogbugzmaintd now:

    $ cd (your FogBugz directory)
    $ cd Accessories
    $ ./fogbugzmaintd start
  3. To verify that it is running:

    ps aux | grep php

    Running the above command should show one php process, that ought to be the fogbugzmaintd process (which is a PHP script). You won't be able to see the name of the script (fogbugzmaintd) in that column because it doesn't fit.
  4. Add it to your server's startup scripts so it starts automatically when your server is rebooted. The way to do this is different on virtually every variety of Unix.

Macintosh OS X (Installer AUTOMATICALLY does this part):

Look in the Accessories folder inside your FogBugz directory. There is a folder there called MacFogBugzMaint. As root, copy this folder into the /Library/StartupItems directory:

$ sudo cp MacFogBugzMaint /Library/StartupItems

Red Hat or Mandrake/Mandriva Linux:

Add a line to the bottom of your /etc/rc.local file:
(your FogBugz directory)/Accessories/fogbugzmaintd start

Gentoo Linux:

Create this init file in the /etc/init.d directory, named fogbugzmaintd:

#!/sbin/runscript
start() {
	ebegin "Starting fogbugzmaintd"
	(your FogBUGZ directory)/Accessories/fogbugzmaintd start
	eend $?
}
stop() {
	ebegin "Stopping fogbugzmaintd"
	(your FogBUGZ directory)/Accessories/fogbugzmaintd stop
	eend $?
}
restart() {
	ebegin "Restarting fogbugzmaintd"
	(your FogBUGZ directory)/Accessories/fogbugzmaintd stop
	(your FogBUGZ directory)/Accessories/fogbugzmaintd start
	eend $?
}

Make the script executable:

$ chmod +x fogbugzmaintd

And add it to the runlevel:

$ rc-update -a fogbugzmaintd default

Debian Linux or Solaris:

Create this shell script in your /etc/init.d directory, named fogbugzmaintd:

#!/bin/sh
NAME=fogbugzmaintd
DAEMON=(your FogBugz directory)/Accessories/$NAME
SCRIPTNAME=/etc/init.d/$NAME

# Gracefully exit if FogBugz has been removed.
test -x $DAEMON || exit 0

case "$1" in
  start)
	$DAEMON start
	;;
  stop)
	$DAEMON stop
	;;
  restart|force-reload)
	$DAEMON start
	sleep 1
	$DAEMON stop
	;;
  *)
	echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2
	exit 1
	;;
esac

exit 0

Make the script executable:

$ chmod +x fogbugzmaintd

And add it to the runlevels:

Debian: $ update-rc.d fogbugzmaintd defaults

Solaris: $ ln -s /etc/init.d/fogbugzmaintd /etc/rc3.d/S55fogbugzmaintd

SuSE Linux:

Add a line to the bottom of your /etc/init.d/boot.local file:
(your FogBugz directory)/Accessories/fogbugzmaintd start

FreeBSD:

Create this short shell script in your /usr/local/etc/rc.d directory, named fogbugzmaintd.sh:

#!/bin/sh
(your FogBugz directory)/Accessories/fogbugzmaintd start

Make the script executable:

$ chmod +x fogbugzmaintd.sh