I got SOGo 1.3.4 to compile and install on FreeBSD 8.1, wohoo!

I will write up my procedure and post it somewhere when I have the time, It was
quite easy though. However, making a startup script was a bit harder, so I
thought I'd share it. Maybe it could go in the source code bundle for other
FreeBSD users.

For reference; GNUstep is installed in /usr/local/GNUstep on FreeBSD, this
needs changing in the SOGo.conf file for apache.

  # cp /usr/local/src/SOGo/SOGo-1.3.4/Apache/SOGo.conf
/usr/local/etc/apache22/Includes/
  # nano /usr/local/etc/apache22/Includes/SOGo.conf

change /usr/GNUstep to /usr/local/GNUstep

then add 'sogod_enable="YES"' to /etc/rc.conf

then add rc script for sogod:
# nano /usr/local/etc/rc.d/sogod
>>>>>>>>>>>>>>>>>>>
#!/bin/sh
 #
 #
 # PROVIDE: sogod
 # REQUIRE: memcached
 #
 # Add the following lines to /etc/rc.conf to enable sogod:
 #
 # sogod_enable (bool): Set it to "YES" to enable sogod.
 # Default is "NO"
 #
 #
 
 . /etc/rc.subr
 
 name="sogod"
 rcvar=`set_rcvar`
 
 load_rc_config ${name} 

 : ${sogod_enable="NO"}
 : ${sogod_user="sogo"}
 : ${sogod_group="sogo"}
 : ${sogod_workers="-WOWorkersCount 1"}
 : ${sogod_command="/usr/local/GNUstep/Local/Tools/Admin/sogod"}
 : ${sogod_logfile="/var/log/sogo/sogo.log"}

 pidfile="/var/run/sogo/sogo.pid"
 command="/usr/sbin/daemon"
 command_args="-p ${pidfile} -u ${sogod_user} ${sogod_command} ${sogod_workers}
-WOPidFile ${pidfile} -WOLogFile ${sogod_logfile}"
 
 start_precmd="sogod_prestart"
 start_cmd="sogod_start"
 stop_cmd="sogod_stop"
 status_cmd="sogod_status"

 sogod_prestart() {
   if [ ! -d `dirname ${pidfile}` ]; then
     mkdir `dirname ${pidfile}` && chown ${sogod_user}:${sogod_group} `dirname
${pidfile}`
   fi
   if [ ! -d `dirname ${sogod_logfile}` ]; then
     mkdir `dirname ${sogod_logfile}`
     touch ${sogod_logfile} && chown ${sogod_user}:${sogod_group}
${sogod_logfile}
   fi
   if [ -z ${GNUSTEP_SYSTEM_ROOT} ]; then
     . /usr/local/GNUstep/System/Library/Makefiles/GNUstep.sh
   fi
 }

 sogod_start () {
     ${command} ${command_args} 
 }

 sogod_stop () {
     kill `cat ${pidfile}`
 }

 sogod_status () {
     if [ -f ${pidfile} ]; then
       echo "${name} is running as pid `cat ${pidfile}`"
     else
       echo "${name} is not running"
     fi
 }
 
 run_rc_command "$1"
<<<<<<<<<<<<<<<<<

omitting the  >>>> and <<<< of course!

then assuming a user called sogo with matching group name has been created, and
ht e'defaults' are set, it's just: 
# service start sogod


/etc/passwd for me looks like this:
#cat /etc/passwd | grep sogo
sogo:*:1002:1002:SOGo Admin:/home/sogo:/usr/local/bin/bash

Hope this helps someone.
-- 
users@sogo.nu
https://inverse.ca/sogo/lists

Reply via email to