As in the other thread you've asked about progress on, I think you should
write your servers to properly "daemon'ise" themselves. Then you do not
need to attempt to background them. I'm pretty sure you will run into
problems trying to run servers the way you are.
Please the manual references I gave in the other thread.
On Mon, 10 May 2010, Jongsoo Kim wrote:
> Thanks Neil
>
> I tried but no luck.
>
>
>
> One thing I noticed is other programs under rc2.d are shown when I type "ps
> -ef"
>
> But my two programs are not showing.
>
>
>
> When initial booting, it prints out "Starting script acu_servers " and all
> other print message from my program.
>
> And then "login:" prompts.
>
>
>
> But my programs are not running.
>
>
>
> To me, the run-level script is for idle programs. But my programs need to
> run all the time.
>
>
>
>
>
>
>
>
>
> Jongsoo
>
>
>
>
>
> From: On Behalf Of
> Neil Stone
> Sent: Monday, May 10, 2010 10:13 PM
> To:
> Subject: RE: [ts-7000] [ts-7500] beginner question: boot script in
> /etc/init.d and /etc/rc2.d
>
>
>
>
>
> Looks to me like your if statement is borked, but thats just my opinion..
>
> Try;
>
> if [ -f /var/lock/acu_servers ] ; then
> exit 1
> else
> echo "Starting script acu_servers "
> cd /home/eclipse
> /home/eclipse/acu_server &
> /home/eclipse/acu_rt_server &
> touch /var/lock/acu_servers
> fi
>
> Hth..
>
> Neil Stone
>
> -----Original Message-----
> From: Jongsoo Kim < <jongsoo.kim%40azultd.com>
>>
> Sent: 10 May 2010 22:47
> To: <ts-7000%40yahoogroups.com>
> Subject: [ts-7000] [ts-7500] beginner question: boot script in /etc/init.d
> and /etc/rc2.d
>
> Dear group
>
> I realized I am a very beginner to Linux ( I thought I knew OK).
>
> We wrote two programs "acu_server" and "acu_rt_server" and I am trying to
> make these program start when TS7500 boots. I saved the binary files of
> "acu_server" and "acu_rt_server" under /home/eclipse ( I just decided to
> use eclipse directory just for convenience since I am using eclipse)
>
> After some study of Debian, a simple following script called "acu_servers"
> was written and copied into /etc/init.d directory and then "update-rc.d
> acu_servers defaults" was issued.
>
> The problems is during boot, I see the correct boot output message shows up
>
> But if I do "ps -v", my two programs are not running.
>
> As usual, I greatly appreciate if someone can kindly advise me.
>
> #! /bin/sh
>
> ### BEGIN INIT INFO
>
> # Provides: acu_servers
>
> # Required-Start: $remote_fs $syslog
>
> # Required-Stop: $remote_fs $syslog
>
> # Default-Start: 2 3 4 5
>
> # Default-Stop: 0 1 6
>
> # Short-Description: Start acu_server and acu_rt_server
>
> ### END INIT INFO
>
> PATH=/sbin:/usr/sbin:/bin:/usr/bin
>
> case "$1" in
>
> start)
>
> if test -f /var/lock/acu_servers; then
>
> exit 1
>
> fi
>
> echo "Starting script acu_servers "
>
> cd /home/eclipse
>
> /home/eclipse/acu_server &
>
> /home/eclipse/acu_rt_server &
>
> touch /var/lock/acu_servers
>
> ;;
>
> stop)
>
> echo "Stopping script acu_servers"
>
> killall acu_server acu_rt_server
>
> rm -f /var/lock/acu_servers
>
> ;;
>
> *)
>
> echo "Usage: /etc/init.d/acu_servers {start|stop}"
>
> exit 1
>
> ;;
>
> esac
>
> exit 0
>
> Thanks
>
> Jongsoo Kim
>
>
>
>
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|