Re: [SOGo] FreeBSD startup script

2011-01-06 Thread Euan Thoms
uot;/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"
  
  
  And then you need to enable the service:
  #echo 'sogod_enable="YES"'  /etc/rc.conf
  
  And then start the service:
  #service sogod start
  
  And then restart apache:
  #apachectl restart
  
  
  Hope this helps you.
  


   Regards,
  
   Euan Thoms 
IT
Manager / Software Developer
  
  
  
  

  Tel:


  +65 6500 4600

  
  

  Fax:


  +65 6500 4660

  
  

  DID:


  +65 6500 4659

  
  

  Mobile:


  +65 91278333

  

  
   
  
1 Fifth Avenue, 
  #04-04/05, Guthrie House, 
  Singapore 268802 
  
The information in this email is confidential
    and may be legally privileged. The contents may not be
disclosed or used by anyone other than the addressee. If you
are not the intended recipient, please notify us immediately
and do not copy, distribute or take any action based on this
e-mail. 
  


 Original Message 
Subject: Re: [SOGo] FreeBSD startup script
From: Jose Amengual jose.ameng...@workatplay.com
To: Euan Thoms euan.th...@fastrack.com.sg
Date: Wed Jan 05 2011 01:08:52 GMT+0800 (SGT)
Thank you for your answer, I actually manage to
  install it properly but now I need to start the service with debug
  mode because there is some weird error that I'm getting..
  
  But as far as compilation goes is now "ok".
  
  Pretty much I did what you said in the email before you sent it to
  me I run this command to avoid all the error with the libraries :
  
  ldconfig -m /usr/local/GNUstep/Local/Library/Libraries/
  
  After that SOPE and SOGo compiled correctly.
  
  Now I decided to start over with a fresh install and write down
  all the instructions.
  
  
  
  On Thu, Dec 30, 2010 at 7:02 PM, Euan
Thoms euan.th...@fastrack.com.sg
wrote:

   Hi Jose, well, I found it quite easy to
  get it all compiled. Firstly make sure you have all the
  dependencies installed from ports (libmemcached,
  memcached, apache22, openldap, GNUstep,
  postgresql/mysql-server/clients). Make sure to source
  the GNUstep.sh file, it sets up \necessay environments
  variables. Add extra lib directories (from dependencies)
  to your LD_LIBRARY_PATH , may help.
  
  It's a bit hazey for me now, I compiled it 2 weeks ago and
  didn't make many notes. I decided to use Postgresql
  instead of MySQL, so maybe I disabled mysql in the
  makefiles. It's confusing for me because I spent days and
  days trying to get it to compile on Solaris, so the steps
  I took are blurred with that of FreeBSD. But FreeBSD was a
  piece of cake compared to Solaris, which never actually
  worked, I gave up. 
  
  Make sure to use the SOPE version supplied for SOGo,
  should a link on

[SOGo] FreeBSD startup script

2010-12-17 Thread euan.thoms
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