Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

using Fedora 14:

echo 'while true; do sleep 5; if ifconfig | grep "inet addr:" | grep -vq ""; then if ! mount | grep -q "/home/user/Desktop/Share"; then mount -vvv -t cifs -o ro,noexec,nosuid,nodev,password=,nolock // /home/user/Desktop/Share; fi; fi; done &' > /etc/rc.d/rc5.d/S99mountsmb
chmod +x /etc/rc.d/rc5.d/S99mountsmb

i mount an anonym Samba share [checks it in every 5 sec]

it's working, ok, great!

But: when i shut down my Fedora box, i can see the lines containing this scripts lines! Many times, about ~50x on the screen.

How could i disable these lines when shutting down? I [and other people] don't want to see those lines for about ~ 5 sec

Thank you!

share|improve this question

It seems like you're rolling your own solution for the problem that cron addresses. While it's true that cron won't run every five seconds, you could run a script every minute which runs your code every five seconds.

Within this script and/or the crontab entry, you should redirect stderr to /dev/null (or another log file) --- e.g. > /etc/rc.d/rc5.d/S99mountsmb 2>/dev/null

I don't have a lot of experience with Samba mounts, but I'd guess that there's probably some way to configure the mount to keep itself alive as well.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.