Tiny Core Base > TCB Q&A Forum
lighttpd and bftpd won't bother running at startup
jrm7262:
🙂👍
Rich:
Hi jrm7262
--- Quote from: jrm7262 on February 05, 2025, 12:56:31 PM --- ... I will try sleep (and wait). ...
--- End quote ---
When I saw that, I thought to myself "there's no wait command".
Then I figured better ask the interweb and found it was a shell builtin.
Sure enough, there it is at the end of the list:
--- Code: ---tc@E310:~$ help
Built-in commands:
------------------
. : [ [[ alias bg break cd chdir command continue echo eval exec
exit export false fg getopts hash help history jobs kill let
local printf pwd read readonly return set shift source test times
trap true type ulimit umask unalias unset wait
tc@E310:~$
--- End code ---
Thanks for showing me a new command to look into.
GNUser:
Hi Rich. Shell scripts cannot catch signals while a sleep command is running in the foreground. For example, if a shell script is executing this command:
--- Code: ---sleep 60
--- End code ---
and I send the script SIGUSR1 (let's pretend SIGUSR1 causes the script to do something special), the script will not respond to the signal until the 60 seconds of sleep are over.
On the other hand, this useful construct:
--- Code: ---sleep 60 & wait $!
--- End code ---
has the same effect of causing the script to pause for 60 seconds, with the big difference that the script can respond to signals during those 60 seconds.
Scott88:
Looks like the second process might not start if the first one doesnt exit properly.Try launching them in the background with & but add a small delay between them
sh
/usr/local/sbin/lighttpd -f /usr/local/etc/lighttpd.conf &
sleep 2
/usr/local/sbin/bftpd -d &Sometimes, missing full paths or nohup can also be the issue.:)
yvs:
--- Quote ---Shell scripts cannot catch signals while a sleep command is running in the foreground. For example, if a shell script is executing this command:
Code:
sleep 60
and I send the script SIGUSR1 (let's pretend SIGUSR1 causes the script to do something special), the script will not respond to the signal until the 60 seconds of sleep are over.
--- End quote ---
In this case you probably want to send SIGUSR1 to the whole group
There's the difference:
--- Code: ---% cat tst.sh
:
trap 'echo Caugth' USR1
sleep 10000000
% sh ./tst.sh &
[1] 7708
% kill -USR1 7708
<nothing happened>
% kill -USR1 -7708
User defined signal 1
Caught
[1] + exit 138 sh ./tst.sh
--- End code ---
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version