Go Back   DaemonForums > Miscellaneous > Guides

Guides All Guides and HOWTO's.

Thread Tools Display Modes
  #1   (View Single Post)  
Old 24th January 2010
J65nko J65nko is offline
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,503
Default Comment out '/etc/inetd.conf' and disable 'inetd' daemon

Comment out /etc/inetd.conf and prevent inetd from starting:

# ---------------------------------------------------------
echo  Comment out all lines of inetd,conf

# -- real 

# -- testing
#FILE=$(basename ${FILE}) 
#BACKUP=$(basename ${BACKUP}) 

cp -p $FILE $BACKUP 
sed -e '/^[^#]/s/^/#/' $BACKUP > $FILE

The regular expression:
/	: start search
^	: at begin of line
[^#]	: followed by not a comment '#' sign
/	: end of search
Note that '^' means the the begin of line, or the null character
at the begin of line. Within a character class '[ ]' it negates the characters
from the character class. So '[#]' will match a '#', and '[^#]' matches
any character as long it is not a '#"

So on all lines which do not start with a '#' do the following "search and replace" :
s	: 'search and replace' or substitute
/	: delimiter or indicator for start of search pattern
^	: null string at begin of line
/	: end of search pattern, start of replacement pattern
#	: a literal '#' character
/	: end of replacement
A simple shell snippet to disable inetd on OpenBSD

# ----------------------------------------------------------
echo Disable inetd


cat <<END  >>${FILE}

Note for FreeBSD users:
You will have to check "/etc/defaults/rc.conf" for the correct setting. Modify the FILE variable to point at /etc/rc.conf
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenBSD nsd (name server daemon) imported in CVS J65nko News 2 17th January 2010 06:05 PM
dbus-daemon lumiwa FreeBSD General 2 2nd October 2008 12:05 AM
difference between rc.conf and loader.conf disappearedng FreeBSD General 5 3rd September 2008 05:54 AM
inetd, ftpd problems jsadm FreeBSD General 7 24th August 2008 08:33 PM
Runing vsftpd in standalone mode or with inetd? bigb89 FreeBSD Security 2 8th May 2008 11:38 PM

All times are GMT. The time now is 10:03 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick