View previous topic :: View next topic |
Author |
Message |
DeathFire n00b
Joined: 01 Jul 2004 Posts: 51 Location: Canada
|
Posted: Thu Jul 01, 2004 6:50 pm Post subject: Services Not Starting |
|
|
Hi,
I have a Gentoo server up and running, but I have two services that aren't wanting to start automatically at boot. A search through the forums has not turned up any answers. The two services that I am having problems with are ASSP and Pop-Before-SMTP. They were not emerged so I suspect that this is part of the problem. The startup scripts are different than the standard startup scripts supplied with the other services. What I find odd though is that I can start them fine manually either from /etc/init.d/ or /etc/runlevels/default so that tells me that they are good at least that far.
Here is a sample:
Code: | #!/bin/sh
# chkconfig: 235 99 10
# description: Start or stop the ASSP SPAM Proxy server
#
### BEGIN INIT INFO
# Provides: ASSP
# Required-Start: $network $syslog
# Required-Stop: $network
# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Description: Start or stop the ASSP SPAM Proxy server
### END INIT INFO
# Rev 0.2.0 R.Toth
# Mods to specify the correct startup directory..
# This needs to be hard-coded for now, until a better way comes up...
# Specifically, the location(s) of the scripts, pid file, config file...
# Mods made for 0.2.0 and new config file format to locate PID file too..
base=/etc/assp
confFile=$base/assp.cfg
start="$base/rc/start.dat $base"
stop="$base/rc/stop.dat $base"
lockfile=/var/lock/subsys/assp.lock
pidFile=$base/pid
name='ASSP'
case "$1" in
'start')
echo "Starting ASSP via: $start"
$start >/dev/null 2>&1 </dev/null
# $start
RETVAL=$?
if [ "$RETVAL" = "0" ]; then
touch $lockfile >/dev/null 2>&1
fi
;;
'stop')
$stop
RETVAL=$?
if [ "$RETVAL" = "0" ]; then
rm -f $lockfile
fi
;;
'status')
pidfile=`grep "^pidfile=" $confFile | sed -e 's/pidfile=//g'`
if [ "$pidfile" = "" ]; then
pidfile=$pidFile
fi
if [ -s $pidfile ]; then
pid=`cat $pidfile`
kill -0 $pid >/dev/null 2>&1
if [ "$?" = "0" ]; then
echo "$name (pid $pid) is running"
RETVAL=0
else
echo "$name is stopped"
RETVAL=1
fi
else
echo "$name is stopped"
RETVAL=1
fi
;;
'restart')
$stop && $start
RETVAL=$?
;;
*)
echo "Usage: $0 { start | stop | status | restart }"
RETVAL=1
;;
esac
exit $RETVAL
|
As compared to sshd
Code: | #!/sbin/runscript
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/files/sshd.rc6,v 1.12 2004/03/18 13:08:05 aliz Exp $
depend() {
use logger dns
need net
}
checkconfig() {
if [ ! -d /var/empty ] ; then
mkdir -p /var/empty || return 1
fi
if [ ! -e /etc/ssh/sshd_config ] ; then
eerror "You need an /etc/ssh/sshd_config file to run sshd"
eerror "There is a sample file in /usr/share/doc/openssh"
return 1
fi
gen_keys
}
gen_keys() {
if [ ! -e /etc/ssh/ssh_host_key ] ; then
einfo "Generating Hostkey..."
/usr/bin/ssh-keygen -t rsa1 -b 1024 -f /etc/ssh/ssh_host_key -N ''
fi
if [ ! -e /etc/ssh/ssh_host_dsa_key ] ; then
einfo "Generating DSA-Hostkey..."
/usr/bin/ssh-keygen -d -f /etc/ssh/ssh_host_dsa_key -N ''
fi
if [ ! -e /etc/ssh/ssh_host_rsa_key ] ; then
einfo "Generating RSA-Hostkey..."
/usr/bin/ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
fi
}
start() {
checkconfig || return 1
ebegin "Starting sshd"
start-stop-daemon --start --quiet --pidfile /var/run/sshd.pid \
--startas /usr/sbin/sshd
eend $?
}
stop() {
ebegin "Stopping sshd"
start-stop-daemon --stop --quiet --pidfile /var/run/sshd.pid
eend $?
}
|
I suspect that there has to be something done differently in the startup script? Does anyone know for sure?
Thanks! |
|
Back to top |
|
|
beesea Apprentice
Joined: 07 Mar 2003 Posts: 273
|
|
Back to top |
|
|
DeathFire n00b
Joined: 01 Jul 2004 Posts: 51 Location: Canada
|
Posted: Thu Jul 01, 2004 10:05 pm Post subject: |
|
|
Yes I have, I used rc-update to add them and checked to make sure that the link is in /etc/runlevels/default and that I can start them manually from there, which I can. |
|
Back to top |
|
|
DeathFire n00b
Joined: 01 Jul 2004 Posts: 51 Location: Canada
|
Posted: Wed Jul 07, 2004 2:35 pm Post subject: |
|
|
Anyone have any ideas on the matter? If not I guess I will try rewriting the init script for them and see where that takes me. |
|
Back to top |
|
|
manywele l33t
Joined: 12 Jul 2003 Posts: 739 Location: Inside
|
Posted: Wed Jul 07, 2004 6:22 pm Post subject: |
|
|
I'm afraid I don't have a solution for you but I am curious about the problem.
Do you see anything interesting in /var/lib/init.d? Such as a failed directory, do your scripts show up in the softscripts or started dirs?
How're your bash reading abilities? You could try looking through /sbin/rc to try to see what's actually happening. |
|
Back to top |
|
|
java geek n00b
Joined: 29 Jan 2003 Posts: 52 Location: Midlothian VA
|
Posted: Mon Jul 12, 2004 2:46 am Post subject: it's a system V type script and so wont work with gentoo |
|
|
you need to change it to a gentoo type script. Look in the docs for a reference |
|
Back to top |
|
|
romst n00b
Joined: 16 Nov 2005 Posts: 1
|
Posted: Wed Nov 16, 2005 9:01 am Post subject: daemontools |
|
|
You may use daemontools script, like this (run):
#!/bin/sh
exec 2>&1 >/dev/nul
exec /usr/local/assp/assp.pl /usr/local/assp |
|
Back to top |
|
|
|