On Thu, 24 Feb 2011, c...@cane-clan.de wrote:

/usr/local/sbin/sogod) It always told me it couldn't find libSOGo.so.1 but this
file is available at/usr/local/lib.
Well this problem has disappeard while i was sleeping tonight (don't know why,
maybe the reconnect of my ssh session fixed the problem),

Likely your daily housekeeping script did "ldconfig" which set up version symlinks for the new libraries and recorded them in the cache /etc/ld.so.cache . Remember to do that by hand after installing a new library.

so now it tells me i shouldn't run sogod as root.

See "startproc -u $USER..." (where USER=sogo) in the script below.

Creating a new User shouldn't be my problem,

Here's what I put in /etc/passwd. Group 12 is "mail"; I didn't bother to create a group for sogo since it would have no other members. /sbin/nologin as the shell is for paranoia (you might want to be "normal" and use /bin/sh). When doing "su" you need instead "su -s /bin/sh ..." to override the paranoid shell.

sogo:x:419:12:SOGo Special User:/var/lib/sogo:/sbin/nologin

but can someone tell me how to
install sogod to /etc/init.d and how to setup the service to start at system
startup?

Below is my startup script. (This is on OpenSuSE 11.2.) To activate it for boot-time startup do: insserv /etc/init.d/sogod (insserv -r filename, to turn it off.) In the script, I'm using postgresql; if you use mysql you should change the dependency. Also check, and change as needed, the variable settings. I'm sure you will need DAEMON=/usr/local/bin/sogod . Also remember you need the GNUstep registry daemon and memcached to start at boot.


James F. Carter          Voice 310 825 2897    FAX 310 206 6673
UCLA-Mathnet;  6115 MSA; 520 Portola Plaza; Los Angeles, CA, USA  90095-1555
Email: j...@math.ucla.edu    http://www.math.ucla.edu/~jimc (q.v. for PGP key)

===== /etc/init.d/sogod
#!/bin/bash
#
#       Startup script for SOGo server
#       Original script Copyright (C) 2007-2009 Inverse inc., under GPL.
#       Original authors: Wolfgang Sourdeau <wsourd...@inverse.ca>
#               and Francis Lachapelle <flachape...@inverse.ca>
#       Hacked for LSB by Jim Carter <j...@math.ucla.edu>, 2011-02-18
#       LSB skeleton Copyright (C) 1995--2005  Kurt Garloff, SUSE / Novell Inc.
#       Skeleton under LGPL.

# Contains bash-isms (uses ~sogo).  Debian policy is that all startup scripts
# should run under any POSIX shell.

### BEGIN INIT INFO
# Provides:          sogo
# Required-Start:    $network postgresql
# Should-Start:      $time postfix dovecot ldap
# Required-Stop:     $network postgresql
# Should-Stop:       $time postfix dovecot ldap
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: SOGo groupware server
# Description:       SOGo provides calendars, contact lists,
# and other PIM objects on the network. ### END INIT INFO

PATH=/sbin:/bin:/usr/sbin:/usr/bin
# Fancy SuSE shell functions, e.g. show outcomes in color
. /etc/rc.status

DESC="SOGo"
case $1 in
    stop )           TITLE="stopping $DESC" ; ;;
    status )         TITLE="checking status of $DESC" ; ;;
    * )              TITLE="${1}ing $DESC" ; ;;
esac

# Shows the outcome and exits.  1st arg is the numeric error code or 0 for
# success; the rest (if any) are printed after the title.  Codes:
# 0 = success, 1 = generic error, 5 = not installed, 6 = not configured,
# 7 = not running; except for status, 0 = running, 1 = PID file exists, # 3 = not running (reported as "unused"), 4 = generic weird status. function barf () {
    rc_failed $1
    shift
    echo "${TITLE}"
    echo "    $*"
    rc_status -v
    rc_exit
}

NAME=sogo
DAEMON=/usr/sbin/sogod
ARG_GSMAKE=`gnustep-config --variable=GNUSTEP_MAKEFILES 2>/dev/null`
DARG_GNUSTEP_SH="$ARG_GSMAKE/GNUstep.sh"

USER=$NAME
PREFORK=1

PIDFILE=/var/run/$NAME/$NAME.pid
LOGFILE=/var/log/$NAME/$NAME.log

# The above variables can be overridden in $SYSCONF if it exists.
# The internal configuration file is in ~sogo/GNUstep/Defaults/.GNUstepDefaults
SYSCONF=/etc/sysconfig/$NAME
if [ -f $SYSCONF ]; then
    . $SYSCONF
fi
GNUDFLTS=`eval "echo ~$NAME/GNUstep/Defaults/.GNUstepDefaults"`
if [ ! -r "$GNUDFLTS" ] ; then
    barf 6 "Can't read configuration file $GNUDFLTS"
fi

if [ ! -x $DAEMON ]; then
    barf 5 "$DAEMON is not executable."
fi

function checkDir () {
    local directory="$1"
    if [ ! -d "$directory" ] ; then
        barf 5 "$directory does not exist."
    fi

    if [ `/usr/bin/stat "$directory" -c %U` != "$USER" ] ; then
        barf 6 "$directory is not owned by user '$USER'."
    fi
}

if [ -z "$GNUSTEP_SYSTEM_ROOT" ] ; then
  . $DARG_GNUSTEP_SH
fi

DAEMON_OPTS="-WOWorkersCount $PREFORK -WOPidFile $PIDFILE -WOLogFile $LOGFILE"

case "$1" in
  start)
        checkDir /var/run/$NAME
        checkDir /var/spool/$NAME
        checkDir /var/log/$NAME
        echo -n "$TITLE "
        /sbin/startproc -p $PIDFILE -u $USER $DAEMON $DAEMON_OPTS
        rc_status -v
        ;;
  stop)
        echo -n "$TITLE "
        /sbin/killproc -p $PIDFILE $DAEMON
        rc_status -v
        ;;
  restart)
        ## Stop the service and regardless of whether it was
        ## running or not, start it again.
        $0 stop
        sleep 1
        $0 start
        # Remember status and be quiet
        rc_status
        ;;
    try-restart|force-reload)
        ## Do a restart only if the service was active before.
        ## SOGo doesn't respond usefully to SIGHUP, so use this also for reload.
        $0 status
        if test $? = 0; then
                $0 restart
        else
                rc_reset        # Not running is not a failure.
        fi
        # Remember status and be quiet
        rc_status
        ;;
    reload )
        barf 3 "(can't reload, use restart instead)"
        ;;
    status)
        echo -n "$TITLE "
        /sbin/checkproc -p $PIDFILE $DAEMON
        rc_status -v
        ;;
  *)
        echo "Usage: $0 {start|stop|restart|status}"
        exit 1
        ;;
esac
rc_exit
--
users@sogo.nu
https://inverse.ca/sogo/lists

Reply via email to