New to FreeBSD - inetd or rc.conf ?

mikey777

Member


Messages: 40

I'm fairly new to FreeBSD, and unix in general as I used to always be the overseer of unix groups...
Why do we still have inetd ?
Or, why are we moving towards rc.conf ?
Do we need both ?
 

Hakaba

Active Member

Reaction score: 59
Messages: 144

maybe it is not in the scope of your question, but I read this some day ago about sinit and Deamontools.
it is not FreeBSD related, but it explain the spirit behind.
 

jmos

Member

Reaction score: 11
Messages: 22

rc.conf: system configuration
inetd: specialised starter for internet tools

There is no "switching from inetd to rc.conf", both are really different tools: Inetd fires up a service only when it is requested to be run, while services started via rc.conf are up right after the system boot. And rc.conf isn‘t only a starter for services: hostname, keymap, network configuration stuff etc. is configured there. Internet services started via rc.conf are daemons, they are running all the time. Services started via inetd are stopped after the job is done.

So: Yes, we need rc.conf. If you need inetd depends on your use case.
 
OP
M

mikey777

Member


Messages: 40

Oh. I was under the assumption that if sshd, ftpd, ? are started in inetd they are always available. Maybe what I was reading is that as long as inted has started, it can spawn sshd/ftpd/? whenever it needs to. So is is better for a process like sshd to run as it's own process or have a parent like inetd ?
BTW, why does sshd and ftpd have hard-coded process IDs ?
 

DonK

New Member

Reaction score: 4
Messages: 8

I was under the assumption that if sshd, ftpd, ? are started in inetd they are always available. Maybe what I was reading is that as long as inted has started, it can spawn sshd/ftpd/? whenever it needs to. So is is better for a process like sshd to run as it's own process or have a parent like inetd ?
It works best for me to add sshd_enable="YES" to /etc/rc.conf and to use inetd for ftpd, popd, and tftpd.
 

jmos

Member

Reaction score: 11
Messages: 22

I was under the assumption that if sshd, ftpd, ? are started in inetd they are always available. Maybe what I was reading is that as long as inted has started, it can spawn sshd/ftpd/? whenever it needs to. So is is better for a process like sshd to run as it's own process or have a parent like inetd ?
Depends all on your configuration of inetd an the corresponding executables. The intention of inetd is not to have services running all the time when they are not needed all the time. But you can be creative in starting and stopping daemons (even out of a start menu in a X11 session).

To cut a long story short: Don't think about inetd as long as you don't have a use case where the usual way makes you some headaches. Nowadays inetd is rather seldom used, and mostly for services where inetd makes sense the author of such a tool writes about it in the documentation. And in case of SSHD the FreeBSD handbook describes no inetd. But of course: You can do that. But as long as you don't know why: No need for it.

BTW, why does sshd and ftpd have hard-coded process IDs ?
If your executing a "service sshd restart" you'll see that sshd doesn't have a hard coded process ID - it changes. I strongly expect ftpd to do the same.
 

gnath

Active Member

Reaction score: 38
Messages: 152

Do we need both ?
Not really, you have required services which FreeBSD provides with full control and designed in that way. Inetd is a super-server daemon on Linux systems with many security issues and designed in that way for that system.
 
Top