One way to deal with it is to create a user, e.g.
"ser". Create a directory /var/run/ser and make its
owner ser. Then start ser with with user ser and use
/var/run/ser/ser.pid.
--- list(a)chung.li wrote:
ehlo,
unfortunately this isn't working if you start ser as
a non root user,
it cannot create /var/run/ser.pid .. because it
didn't do that before
changing user, ex. if you set ser.cfg uid="nobody"
gid"nobody" ...
cheers
Fremen
Shi Hoch writes:
<< HTML content follows >>
Hope it will be useful.
�
#!/bin/bash
#
# Startup script for SER
#
# chkconfig: 345 85 15
# description: Ser is a fast SIP Proxy.
#
# processname: ser
# pidfile: /var/run/ser.pid
# config: /etc/ser/ser.cfg
�
# Source function library.
. /etc/rc.d/init.d/functions
�
ser=/sbin/ser
prog=ser
RETVAL=0
OPTIONS="-P /var/run/ser.pid"
�
start() {
������� echo -n $"Starting $prog: "
������� daemon $ser $OPTIONS
������� RETVAL=$?
������� echo
������� [ $RETVAL = 0 ] && touch
/var/lock/subsys/ser
������� return $RETVAL
}
�
stop() {
����� echo -n $"Stopping $prog: "
����� killproc $ser
����� RETVAL=$?
����� echo
����� [ $RETVAL = 0 ] && rm -f
/var/lock/subsys/ser /var/run/ser.pid
}
�
reload() {
����� echo -n $"Reloading $prog: "
����� killproc $ser -HUP
����� RETVAL=$?
����� echo
}
�
# See how we were called.
case "$1" in
� start)
����� start
����� ;;
� stop)
����� stop
����� ;;
� status)
������� status $ser
����� RETVAL=$?
����� ;;
� restart)
����� stop
����� start
����� ;;
� condrestart)
����� if [ -f /var/run/ser.pid ] ; then
����������� stop
����������� start
����� fi
����� ;;
� *)
����� echo $"Usage: $prog
{start|stop|restart|condrestart|status|help}"
����� exit 1
esac
�
exit $RETVAL
�
�
Shi Hoch
_______________________________________________
Serusers mailing list
serusers(a)lists.iptel.org
http://lists.iptel.org/mailman/listinfo/serusers
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around