2008-01-25 18:51:52 Starting daemon from /etc/rc messes up stdin?
Steve Strobel (UNITED STATES)
Message: 50172 I am trying to start a long-running background process (daemon) from /etc/rc using a command like "/sleep_and_echo &" (I am using the simple script shown below for testing). When I run that command manually after booting, I can continue to enter commands at the "root~>" prompt and see the responses (intermingled with the "Sleeping..." output from the background task). When I run that task from the /etc/rc file, it seems to prevent me doing anything else from the console, both while it is running and even after it has completed. What am I missing?
#! /bin/sh
echo "This is /mnt/permanent/startup/sleep_and_echo"
sleep 1
echo "Sleeping..."
sleep 1
echo "Sleeping..."
sleep 1
echo "Sleeping..."
sleep 1
echo "Sleeping..."
sleep 1
echo "Sleeping..."
sleep 1
Thanks for any suggestions,
Steve
QuoteReplyEditDelete
2008-02-06 10:41:10 Re: Starting daemon from /etc/rc messes up stdin?
Mike Frysinger (UNITED STATES)
Message: 50766 seems to work for me ... anything running in /etc/rc should not affect the login shell launched on the console ...
what are your console / simpleinit settings ?
..............
Have a lot of fun...
jThis is /mnt/permanent/startup/sleep_and_echo
BusyBox v1.9.0 (2008-02-05 20:09:28 EST) built-in shell (msh)
Enter 'help' for a list of built-in commands.
root:/> PHY: 0:01 - Link is Up - 100/Full
Sleeping...
uptime
14:20:13 up 0 min, load average: 0.00, 0.00, 0.00
root:/> Sleeping...
root:/> uptime
14:20:14 up 0 min, load average: 0.08, 0.01, 0.00
root:/> Sleeping...
root:/> uptime
14:20:15 up 0 min, load average: 0.08, 0.01, 0.00
root:/> Sleeping...
date
Thu Jan 1 14:20:16 UTC 1970
root:/> daSleeping...
te
Thu Jan 1 14:20:17 UTC 1970
root:/>
QuoteReplyEditDelete
2008-02-15 18:42:00 Re: Starting daemon from /etc/rc messes up stdin?
Steve Strobel (UNITED STATES)
Message: 51132 It started working for me too. I must have had something set up incorrectly, but I never figured out what it was. Thanks for the help.