LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-20-2006, 12:02 PM   #1
stiffy
LQ Newbie
 
Registered: Jan 2006
Posts: 7

Rep: Reputation: 0
Start netcat listening session with inetd(or other)


I´m currently setting up an old laptop to act as a "wireless music player".
To do this, I`m using netcat to receive and then pipe the audio stream via sox into rawplay.
Is there a way to configure inetd to automatically start netcat when port 5454 is accessed?
The way it is now I have to ssh into the box to start the shell script that sets up the netcat/sox/rawplay pipe manually, and it would be nice to have this done by inetd or some other service.

Thanks in advance!

Last edited by stiffy; 12-20-2006 at 12:04 PM.
 
Old 12-20-2006, 03:01 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Couldn't you use the form "ssh user@host:yourscript" so the ssh command starts the script.
 
Old 12-20-2006, 05:02 PM   #3
stiffy
LQ Newbie
 
Registered: Jan 2006
Posts: 7

Original Poster
Rep: Reputation: 0
I suppose i could, but how do i keep nc running? It seems to quit right away.
I tried to append an & at the end of the command, didnt work..
 
Old 12-20-2006, 06:25 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I just thought that you might not want a port open for netcat. The netcat command is also a tool that crackers love. It is almost like a net enabled dd command.

Take a look at the configs in /etc/xinet.d/ and base your config on one of them. There are two things to consider. First, you could create a system user to run the service as. Second, read up on running your service in a jail.

Both netcat and xinetd can work with udp datagram streams as well as tcp connections. Udp would be a better choice for delivering live media.
 
Old 12-21-2006, 05:26 AM   #5
stiffy
LQ Newbie
 
Registered: Jan 2006
Posts: 7

Original Poster
Rep: Reputation: 0
Well, this machine is connected to my internal network only, so security isn't paramount. Also I'm on Slackware 11, which I think use inetd. I tried setting up port 5454 in /etc/services, like this:

wfstream 5454/tcp
wfstream 5454/udp


and adding a corresponding line in /etc/inetd.conf, like this:

wfstream stream tcp nowait root /usr/bin/nc -l -p 5454 |sox -t mp3 - -t wav - |rawplay


Well, it doesn't work this way, any ideas?
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
inetd does not automatically start ( occasionaly) epazst Linux - Networking 1 04-20-2006 03:05 PM
inetd is running but netstat show no listening ports shroc Linux - Networking 1 01-31-2006 04:30 PM
cant start the yast inetd config vtecturbo13 SUSE / openSUSE 1 03-08-2005 03:28 AM
Why is inetd listening? Vincent_Vega Linux - Security 8 09-17-2004 12:38 PM
Start vsftpd with inetd Thinkgeekness Linux - Software 25 07-02-2004 08:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration