The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]

Scripts / handy tips
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Newer Topic  |  Older Topic 
 dns2go boot script
Author: apache916 
Date:   04-05-03 05:46

For those interested in a handy script that will automatically run your dns2go service every time at boot and run it in the background out of sight. Here is the script that I created. If anyone discovers a serious flaw in my script please email me at r.casipit@attbi.com, thanks.

#!/bin/sh
echo -n ' Dns2go'

case "$1" in
start)
/usr/local/bin/dns2go &
;;
stop)
kill -9 `cat /var/run/dns2go.pid`
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
exit 64
;;
esac

exit 0
#End


Note: First create a file called dns2go.sh in your /usr/local/etc/rc.d directory by going to that directory and typing mk dns2go.sh, then type "ee dns2go.sh" which will put you into the text editor ee for that particular file, insert the script you see above and then press the [Esc] key to exit. It'll ask if you want to save the changes you made to the file and select yes. Then you type "chmod 755 dns2go.sh" in order to make the file executable. If everything went ok the script will run at bootup and place the service in the background. All this of course was done on my server running freebsd 4.8. Everything here is taken from memory and if I have failed to list all the details I apologize in advance. I hope this helps someone else out there!

Reply To This Message
 
 Re: dns2go boot script
Author: Robert 
Date:   08-05-03 23:22

I'm lame! Here's a much better script for all you dns2go users.

#!/bin/sh
#Just a very lightweight but effective script to start dns2go #and apache at boot.

echo -n "Starting apache and dns2go services..."

/usr/local/bin/dns2go &
/usr/local/apache/bin/apachectl start

exit 0



How simple is that? Forgive me for being a newbie.
Steps:
1]#ee /usr/local/etc/rc.d/script.sh
2]insert the script above into the file and exit/save
3]#chmod u+x script.sh
4]reboot and the script should run! *crossed-fingers*

Reply To This Message
 
 Re: dns2go boot script
Author: Robert 
Date:   13-05-03 06:55

Don't use this lightweight script! Received hangups during a sudden reboot. *shrugs*

Reply To This Message
 
 Re: dns2go boot script
Author: wtp 
Date:   03-12-03 11:53

Hello,

Is it better to use deamontools from ports?

I'm ussing it to keep live snort, dns and other services. Very, very good staff.

Greeting (from Poland)
--
wtp
Greatest BSD service for newbies http://www.bsdguru.org



Reply To This Message
 Forum List  |  Threaded View   Newer Topic  |  Older Topic 


 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Password:
 Remember my login:
   
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum

phorum.org