Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 01-19-2005, 03:25 PM   #1
LQ Newbie
Registered: Jan 2005
Posts: 1

Rep: Reputation: 0
Logging with Start stop daemon


I wrote a script to start an algorithm on one of my database machines. After some tweaking I have gotten the Start, stop, restart, and reload to function fine. My problem is that with the start stop daemon, the logging of stdout and stderr logs that of SSD, not what I am executing. Is there a way to log the execute commands output? Below is the script to save time in anyone needing to ask. Thanks.


#Script to start and stop algorithm control


export JAVA_HOME=/usr/share/java/j2sdk1.4.2_05/bin
export CLASS_PATH=/usr/local/digonex/lib
export POSTGRESQL_PATH=/usr/share/java

SSD=`which start-stop-daemon`

export login_name=******
export login_password=******

PARAMETERS="-cp $POSTGRESQL_PATH/postgresql.jar:$CLASS_PATH/AlgorithmControl.jar:$CLASS_PATH/DTISoapClient.jar AlgorithmControl.AlgorithmControl $login_name $login_password $mapserver_IP >> /var/log/algorithm_control.log 2>&1"

case "$1" in
echo "Starting up the $NAME"

#`$START` >> /var/log/algorithm_control.log 2>&1 &

$SSD --start --make-pidfile --pidfile $PIDFILE --background --exec $START -- $PARAMETERS

echo "Stopping the $NAME"
kill -s INT `cat $PIDFILE`

echo -n "Restarting $NAME"
kill -s INT `cat $PIDFILE`
sleep 3

while [ "$i" = go ]

ps aux | grep -v restart | grep [a]lgorithm > /root/algorithm_tmp.log

if [ -s /root/algorithm_tmp.log ]; then

sleep 5


$SSD --start --make-pidfile --pidfile $PIDFILE --background --exec $START -- $PARAMETERS


rm /root/algorithm_tmp.log

echo -n "Reloading Algorithm"
kill -s HUP `cat $PIDFILE`

echo "Usage: /etc/init.d/algorithm {start|stop|restart}"
exit 1

exit 0

Any help on getting this to log the executed command would help me immensly. Thanks a lot.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
start-stop-daemon problems after process crash emarti20 Linux - Software 3 04-15-2005 08:54 AM
How do I stop the sshd daemon? ebenh Linux - Software 5 09-04-2004 01:06 PM
Howto stop daemon from starting Lawful Linux - General 3 04-30-2004 04:06 PM
How do you stop a daemon from starting at bootup?? rberry88 Fedora 6 02-18-2004 01:44 PM
daemon logging- how do I? jimieee Linux - General 1 09-17-2003 09:45 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:40 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration