Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

1 votes
0 answers
270 views
Can I use inetd or xinetd as a web server?
I just want to know if it is possible to use `xinetd` as a web server to server simple piped commands. For example, I want the output of `ps -ef|grep root|wc -l` to be served over HTTP using `xinetd` (without any other server software). How can I do that?
I just want to know if it is possible to use xinetd as a web server to server simple piped commands. For example, I want the output of ps -ef|grep root|wc -l to be served over HTTP using xinetd (without any other server software). How can I do that?
Ahmad Ismail (2998 rep)
Jun 24, 2022, 11:44 AM • Last activity: Jun 24, 2022, 11:54 AM
-1 votes
1 answers
692 views
Is inetutils not included in Debian or Ubuntu?
Is inetutils or some programs in it provided or installed by default in Debian or Ubuntu? If not, why does Debian or Ubuntu not include it? Is it because they have better alternative programs in other packages? For example, - inetd is included in inetutils, and it is not found on Ubuntu or Debian. W...
Is inetutils or some programs in it provided or installed by default in Debian or Ubuntu? If not, why does Debian or Ubuntu not include it? Is it because they have better alternative programs in other packages? For example, - inetd is included in inetutils, and it is not found on Ubuntu or Debian. What similar program is installed in Debian or Ubuntu by default? - syslogd is included in inetutils. Does Debian or Ubuntu use rsyslogd instead? Which package does rsyslogd belong to?
Ben (109 rep)
Apr 5, 2021, 03:01 PM • Last activity: Apr 6, 2021, 09:57 AM
2 votes
2 answers
571 views
How to access an inetd service?
So I created a simple inetd error logging service according to this example https://en.wikipedia.org/wiki/Inetd ``` #include #include int main(int argc, char **argv) { const char *fn = argv[1]; FILE *fp = fopen(fn, "a+"); if (fp == NULL) exit(EXIT_FAILURE); char str[4096]; /* inetd passes its inform...
So I created a simple inetd error logging service according to this example https://en.wikipedia.org/wiki/Inetd
#include 
#include 

int main(int argc, char **argv)
{
  const char *fn = argv;
  FILE *fp = fopen(fn, "a+");

  if (fp == NULL) 
    exit(EXIT_FAILURE);

  char str;
  /* inetd passes its information to us in stdin. */
  while (fgets(str, sizeof str, stdin)) {
    fputs(str, fp);
    fflush(fp);
  }
  fclose(fp);
  return 0;
}
I appended this line to `/etc/services/`
errorLogger 9999/udp
and this line to `/etc/inetd.conf`
errorLogger dgram udp wait root /usr/local/bin/errlogd errlogd /tmp/logfile.txt
How can I access this now? I configured the service on my Raspberry Pi in my local network. Do I need to write a client program that accesses the UDP port 9999 or can I do it via SSH? I already tried
ssh pi@raspberrypi -p 9999
but it says `ssh: connect to host raspberrypi port 9999: Connection refused` I also reload the systemd service with
sudo service inetd reload
and it didn't help.
neolith (273 rep)
Feb 8, 2021, 10:52 AM • Last activity: Feb 8, 2021, 04:09 PM
4 votes
1 answers
2217 views
What's the difference between the telnetd and inetutils-telnetd packages in Ubuntu?
1. Recently, a work came to me which needs to set telnet on linemode.so i install telnetd with `apt install telnetd`, which is controlled by `inetd`, and this operation will add new line `telnet stream tcp nowait telnetd /usr/sbin/tcpd /usr/sbin/in.telnetd` in `/etc/inetd.conf` 2. after install teln...
1. Recently, a work came to me which needs to set telnet on linemode.so i install telnetd with apt install telnetd, which is controlled by inetd, and this operation will add new line telnet stream tcp nowait telnetd /usr/sbin/tcpd /usr/sbin/in.telnetd in /etc/inetd.conf 2. after install telnetd by this way, i tried many ways to enable linemode in telnet service yet all failed ,so i removed telnetd by apt remove telnetd 3. then i reinstall telnetd by apt install inetutils-telnetd, this operation also add new line in /etc/inetd.conf which is telnet stream tcp nowait telnetd /usr/sbin/tcpd /usr/sbin/telnetd.after doing this, i add a -l option in this line and restart telnetd. in this way, line mode is enabled and works well. 4. althrough work is finished, but still can't i figure out why these two ways are different. what's the difference between these packages telnetd and inetutils-telnetd
zzsuki (41 rep)
Jan 19, 2021, 08:39 AM • Last activity: Jan 19, 2021, 09:18 AM
-1 votes
1 answers
50 views
Does inetd simplify server programs, without affecting the part of concurrently handling multiple clients?
In The Linux Programming Interface, Chapter 60 talks about - designing a server to concurrently handle multiple clients, by using sockets, multiple processes/threads or thread/process pools - designing a server to be invoked by inetd which simplifies the sever program. If a server is to be used with...
In The Linux Programming Interface, Chapter 60 talks about - designing a server to concurrently handle multiple clients, by using sockets, multiple processes/threads or thread/process pools - designing a server to be invoked by inetd which simplifies the sever program. If a server is to be used with inetd, it only has to deal with inputs from stdin and outputs to stdout, instead of sockets. inetd handles the part of using sockets, multiplex monitors for incoming requests, and for each incoming request, forks a process to execute a server program. I was wondering if a server program to be used with inetd can still have the same part of concurrently handling multiple clients, as a standalone version of the server program? Is it correct that inetd forks a new process for each incoming request, to execute the entire server program? So does the server program not need to handle multiple requests concurrently, but only one request? Does inetd makes the server program equivalent to a concurrent standalone version which forks a child process to process each received request? Is that a good choice compared to a standalone multithreaded server program? Thanks.
Tim (106420 rep)
Nov 24, 2020, 11:44 PM • Last activity: Nov 25, 2020, 12:03 AM
2 votes
0 answers
749 views
Can systemd be used as an inetd/xinetd replacement without being an init?
Can systemd be configured (in runtime or compile time) to serve as a simple process supervisor, not as `/sbin/init`? If yes, are there tutorials and other documentation to follow to make customized non-init-systemd setups? If no, what other thing should be used for UNIX-socket-activated services apa...
Can systemd be configured (in runtime or compile time) to serve as a simple process supervisor, not as /sbin/init? If yes, are there tutorials and other documentation to follow to make customized non-init-systemd setups? If no, what other thing should be used for UNIX-socket-activated services apart from plain openbsd-inetd (which, for example, cannot chown/chmod the sockets)?
Vi. (5985 rep)
Sep 24, 2020, 11:50 PM • Last activity: Sep 25, 2020, 01:55 AM
10 votes
3 answers
2514 views
Why do daemons only read their configuration file when they start up? Why can't they "react" to changes in that file/hot reload?
I know daemons have to be sent a HUP for config changes to take effect. But I'm wondering why this is, and if it is possible to create a daemon responsive to such changes.
I know daemons have to be sent a HUP for config changes to take effect. But I'm wondering why this is, and if it is possible to create a daemon responsive to such changes.
Frank Jones (109 rep)
May 18, 2020, 01:22 PM • Last activity: May 19, 2020, 07:09 PM
1 votes
3 answers
486 views
How does inetd transfer control to respective services?
How does [inetd][1] transfer control to the service, Below is my understanding * inetd listens on every port mentioned in `/etc/inetd.conf` * If a client make a request to one of the port that inetd listens then inetd transfers control of that request to a service by spinning it as a child process b...
How does inetd transfer control to the service, Below is my understanding * inetd listens on every port mentioned in /etc/inetd.conf * If a client make a request to one of the port that inetd listens then inetd transfers control of that request to a service by spinning it as a child process by looking /etc/inetd.conf * It is acts as multiplexer. My doubt is below * How the request is handover to the child process (respective service daemon)? * Already connection is made on the port by inetd so child process can't that port again until the inetd releases that port. If inetd releases that port then existing client connection will be droped (kindly correct me if my understanding is wrong).
Karthik Nedunchezhiyan (825 rep)
Mar 14, 2020, 11:44 AM • Last activity: Mar 16, 2020, 07:00 AM
0 votes
1 answers
665 views
tcpd, inetd/rinetd and iptables
What is the correlation between these programs? **tcpd** and **inted**/**rinetd** are very old but despite this they are still present in many distributions ... why? And there is also a correlation between `hosts.allow` and `hosts.deny` with **tcpd** but i noticed that these files are present even w...
What is the correlation between these programs? **tcpd** and **inted**/**rinetd** are very old but despite this they are still present in many distributions ... why? And there is also a correlation between hosts.allow and hosts.deny with **tcpd** but i noticed that these files are present even when **tcpd** is not installed ... (trying with the command **dpkg** also noticed that hosts.allow/deny is not correspond to no package) ... well .. a mess. Who helps me clarify? Thanks
user377583
Feb 18, 2020, 04:47 PM • Last activity: Feb 18, 2020, 05:09 PM
2 votes
1 answers
521 views
Is there a daemon which resolves a service name to a port?
A DNS server resolves a hostname to an IP address. A program can resolve a hostname to an IP address by calling `getaddrinfo()` which in turn asks a DNS server to do the resolution, if I am correct. In SysV init, is there some daemon which resolves a service name to a port, just like a DNS server? D...
A DNS server resolves a hostname to an IP address. A program can resolve a hostname to an IP address by calling getaddrinfo() which in turn asks a DNS server to do the resolution, if I am correct. In SysV init, is there some daemon which resolves a service name to a port, just like a DNS server? Does it do that by reading /etc/services? Does getaddrinfo() also invoke the daemon to perform the resolution? I know that inetd reads /etc/services to decide which sockets to listen to. But inetd doesn't seem to resolve service name to port, does it? Thanks.
Tim (106420 rep)
Feb 14, 2019, 12:48 AM • Last activity: Feb 17, 2019, 01:43 PM
-1 votes
1 answers
104 views
Does `inetd` (and `nc`) apply only to programs written as daemons?
When `inetd` makes several programs run as services, does `inetd` require the programs necessarily written as daemons (e.g. not having a controlling terminal, no interactive input, ...)? Or can`inetd` daemonize nondaemon processes, similar to what `setid` can do? By the way, same questions for `nc`,...
When inetd makes several programs run as services, does inetd require the programs necessarily written as daemons (e.g. not having a controlling terminal, no interactive input, ...)? Or caninetd daemonize nondaemon processes, similar to what setid can do? By the way, same questions for nc, given that https://unix.stackexchange.com/a/500646/674 Thanks.
Tim (106420 rep)
Feb 14, 2019, 02:53 PM • Last activity: Feb 15, 2019, 04:52 PM
6 votes
3 answers
932 views
Is there a single program version of inetd?
`inetd` can make several programs with stdin input and stdout output work like programs with input and output from and to sockets, and monitor their listening sockets simultaneously. Is there a simpler program than `inetd` which just works for a single program: make a single program with stdin input...
inetd can make several programs with stdin input and stdout output work like programs with input and output from and to sockets, and monitor their listening sockets simultaneously. Is there a simpler program than inetd which just works for a single program: make a single program with stdin input and stdout output work like a program with input and output from and to sockets? Thanks.
Tim (106420 rep)
Feb 14, 2019, 02:47 PM • Last activity: Feb 15, 2019, 02:12 PM
3 votes
1 answers
11434 views
What are the replacements of `inetd` and `/etc/inetd.conf` in Ubuntu?
`inetd` is a service dispatcher for services recorded in `/etc/inetd.conf`. In Lubuntu 18.04, there is no `/etc/inetd.conf`. `ps -A | grep inetd` returns nothing. What are the replacements of `inetd` and `/etc/inetd.conf`? I do not have `/etc/xinetd*`. Thanks.
inetd is a service dispatcher for services recorded in /etc/inetd.conf. In Lubuntu 18.04, there is no /etc/inetd.conf. ps -A | grep inetd returns nothing. What are the replacements of inetd and /etc/inetd.conf? I do not have /etc/xinetd*. Thanks.
Tim (106420 rep)
Feb 14, 2019, 01:01 AM • Last activity: Feb 14, 2019, 05:26 AM
0 votes
0 answers
38 views
Question on scalability of echo service on Linux
I'm trying to build a service which verifies that a network route is available. I have used the echo service on inetd in the past and it certainly fits the purpose but i am unsure about its scaling. Anyone ever tried to use echo for something like 50K clients? Any alternative ideas since ICMP not an...
I'm trying to build a service which verifies that a network route is available. I have used the echo service on inetd in the past and it certainly fits the purpose but i am unsure about its scaling. Anyone ever tried to use echo for something like 50K clients? Any alternative ideas since ICMP not an option and i have a RHEL7 server to utilize?
Georgios Vasilakis (1 rep)
Feb 5, 2019, 01:00 PM
0 votes
2 answers
642 views
ttdbserver and inetd
If I disable ttdbserver service in an AIX server (I commented the line with `#` in `/etc/inetd.conf`): #ttdbserver sunrpc_tcp tcp wait root /usr/dt/bin/rpc.ttdbserver rpc.ttdbserver 100083 1 is it necessary to restart daemons with inetd restart command, to apply changes?
If I disable ttdbserver service in an AIX server (I commented the line with # in /etc/inetd.conf): #ttdbserver sunrpc_tcp tcp wait root /usr/dt/bin/rpc.ttdbserver rpc.ttdbserver 100083 1 is it necessary to restart daemons with inetd restart command, to apply changes?
user308669 (11 rep)
Sep 3, 2018, 05:35 PM • Last activity: Sep 4, 2018, 09:42 AM
2 votes
1 answers
1111 views
How to install and run inetd on OSX or the equivalent in launchd
I'm trying to capture the data destined for a "networked printer" so it can be processed locally or forwarded to another system. It looks like https://unix.stackexchange.com/questions/203173/linux-as-a-network-printer-device-raw-port-9100 will do what I want and only requires: `9100 stream tcp nowai...
I'm trying to capture the data destined for a "networked printer" so it can be processed locally or forwarded to another system. It looks like https://unix.stackexchange.com/questions/203173/linux-as-a-network-printer-device-raw-port-9100 will do what I want and only requires: 9100 stream tcp nowait cat > some_file but I'd like to be able to test it on my Macbook and that does not have inetd. Potentially I could use launchd as it is the replacement for inetd on OSX, but reading the docs, it is not clear how to do the equivalent to the above. So either solution--how to get inetd for OSX or how to create a plist file for launchd do that does the equivalent is what I'm looking for.
George Shaw (141 rep)
Nov 28, 2017, 02:46 AM • Last activity: Nov 28, 2017, 01:37 PM
3 votes
1 answers
433 views
What services accept tcp connection?
I've been learning about socket programming recently, and am just beginning learning about tcp/ip sockets. [My study material][1] gives an example of connecting to the localhost `daytime` service by running `telnet 127.0.0.1 13` with the expected result that a telnet session should be opened. I have...
I've been learning about socket programming recently, and am just beginning learning about tcp/ip sockets. My study material gives an example of connecting to the localhost daytime service by running telnet 127.0.0.1 13 with the expected result that a telnet session should be opened. I have an entry for "daytime 13/tcp" in my /etc/services file, and I have the xinetd service running, but when I try the telnet command, I immediately get "Connection refused". **Q**: why doesn't telnetting to the daytime service work? **Q**: are there other localhost services that would accept a telnet connection? I tried to telnet to a random selection of services that had tcp entries in /etc/services, but all of them gave the same "Connection refused" error. My short-term goal is just to replicate my study material's successful telnet connection to a localhost tcp service - if not inetd, then anything else; I just want to learn by practice. >telnet 127.0.0.1 13 Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused >telnet 127.0.0.1 49000 Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused >telnet 127.0.0.1 9009 Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused >uname -a Linux linuxbox 3.11.10-301.fc20.x86_64 #1 SMP Thu Dec 5 14:01:17 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
StoneThrow (1937 rep)
Jun 13, 2017, 05:34 PM • Last activity: Jun 17, 2017, 11:53 AM
2 votes
2 answers
1974 views
How do I run inetd at startup on OpenBSD?
I am trying to backup my Synology NAS to my old NAS. The old NAS has to be an rsync compatible server (according to Synology), and the original OS didn't support it. Fortunately OpenBSD supports my NAS ('landisk', well done!), and I managed to get `rsync` running in daemon mode. I read the option to...
I am trying to backup my Synology NAS to my old NAS. The old NAS has to be an rsync compatible server (according to Synology), and the original OS didn't support it. Fortunately OpenBSD supports my NAS ('landisk', well done!), and I managed to get rsync running in daemon mode. I read the option to launch rsync via inetd. I thought this would be the best option. I followed the instructions in the man pages. Everything is done under the root account. The line rsync 873/tcp was already in my /etc/services. I created /etc/inetd.conf and added the line rsync stream tcp nowait root /usr/local/bin/rsync rsyncd --daemon Then I had to send a HUP signal to inetd. But with ps -A I didn't see inetd running. So I added the line inetd=YES to rc.conf.local, which looks now like this: ntpd_flags= inetd=YES When I enter inetd at the CLI everything works fine. But when I reboot the NAS, inetd is not running. What am I missing?
ffonz (121 rep)
May 5, 2015, 08:12 PM • Last activity: Jun 15, 2017, 02:25 PM
1 votes
1 answers
451 views
Can we kill inetd if there's nothing using it / no config?
In a small embedded Linux Busybox based system, by default **inetd** is being started at boot but **inetd.conf** has *every* service commented out as none of them are being used. Does this mean we can just remove the call to start **inetd** or could it be required by some system process down the lin...
In a small embedded Linux Busybox based system, by default **inetd** is being started at boot but **inetd.conf** has *every* service commented out as none of them are being used. Does this mean we can just remove the call to start **inetd** or could it be required by some system process down the line?
John U (344 rep)
Jan 9, 2017, 01:52 PM • Last activity: Jan 9, 2017, 02:06 PM
1 votes
1 answers
692 views
gdbserver as an inetdamon broken pipe
Ive added gdbserver in the inetd.conf and etc/services yet when I attempt to connect as follows I immediately get Remote communication error. Target disconnected.: Broken pipe. (gdb) target extended-remote rtx5:8010 Remote debugging using rtx5:8010 Remote communication error. Target disconnected.: B...
Ive added gdbserver in the inetd.conf and etc/services yet when I attempt to connect as follows I immediately get Remote communication error. Target disconnected.: Broken pipe. (gdb) target extended-remote rtx5:8010 Remote debugging using rtx5:8010 Remote communication error. Target disconnected.: Broken pipe. 8010 is what I have configured gdbserver to run on. However if I manually start gdbserver from the target with 8011 I can get them communicating. I tried adding "--multi" and the port to the inetd.conf file and reloaded it to no avail. is this possible?
LikeTheRock (21 rep)
Nov 29, 2016, 07:07 PM • Last activity: Nov 30, 2016, 03:11 PM
Showing page 1 of 20 total questions