OpenSUSE :: Grep Hangs On Sockets?

Jun 6, 2010

Here's a silly question: suppose I want to "grep" an entire directory. Real life example: we reconfigured our mail server to a different IP address, so I needed to search for each occurrence of the original to make sure they'd all been changed.

A simple

Code:
grep -i -l -r "192.168.1.200" *

... works great until it hits a socket. This particular mail server has sockets scattered at random through the directory. When grep hits one of these, it hangs.

I've tried every command line option I can think of it to force it to ignore these sockets, but to no avail. Any of you Grep Gurus out there want to give me a hand?

View 1 Replies


ADVERTISEMENT

OpenSUSE Install :: Can't Login To Root In GUI / Error Can't Establish Any Listening Sockets?

Aug 28, 2010

I was logged in as root, made some changes to my users and think I may have inadvertently changed root somehow. Ever since then, my machine runs just fine, I can sudo, Yast, etc without any issues. (Root password is fine) but when I try to log in as root, the system changes the screen display, as if it's going to login, then returns me back to the login prompt without error. If I "ctl+alt+F1", I drop out to the console and can login as root, but cannot startx because the display is already in use.... So, I removed the .X0-lock, but still cannot get the GUI to load. (after running rm /tmp/./X0-lock, I get a fatal error, "can't establish any listening sockets..." "Ctl+Alt+F7" brings me back to the GUI where I am logged in as myself in Gnome) if I login with my user account, everything runs fine and all is well.

View 9 Replies View Related

Programming :: Input File - Grep Within Grep

Nov 22, 2010

I need to kind of grep within grep. My input file would be something like:

[Code]....

and I need to find the first occurrence of hello before MY PATTERN (hello 9008 in this case), so the output should be:

[Code]....

View 4 Replies View Related

OpenSUSE :: Grep And Recursive -r Not Working?

Aug 9, 2010

works fine on a FAT32 dsk:

Code:

fgrep -iRn -C 2 'print' *.txt
---also recurses one level and displays all kinds of data
---------------------------------------------------------------
in root / ext4 directory:

Code:

fgrep -iRn -C 2 'print' *.* or fgrep -iRn -C 2 'print' *.txt
---displays msgs:
fgrep: *.*: No such file or directory
and
fgrep: *.txt: No such file or directory

I am probably missing something very basic.recursive does not seem to work from root directory.Is this (as they used to say) a feature? This is on an 11.2 system, upgraded to 11.3 (ran zypper verify to verify. According to it.. all is well).

View 9 Replies View Related

Networking :: How Many Possible Sockets On 64-bit

Jan 24, 2011

What's the total no. that the OS can create? Does this differ from 32-bit?

View 1 Replies View Related

Programming :: PING Using Raw Sockets In C?

Nov 18, 2010

Is there any way to implement a simple ping script in C (unix)? I'm programming simple OpenWRT scripts.

I have found some examples of ping in C:

[URL]

However, nothing happens, nothing is sent.

When I look at the code, in the portion where the socket is created, I can see that the socket is not binding to any interface:

Code:
if ((sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP)) == -1)
{
perror("socket");
exit(EXIT_FAILURE);
}
setsockopt(sockfd, IPPROTO_IP, IP_HDRINCL, &optval, sizeof(int));

Instead, it uses "setsockopt" to set some options.

My guess is that it is trying to send packets over the eth0 interface instead over the wl0 (wireless) interface (which is the one I want to use to send pings).

Now, my question is: Is there any other way to send pings in C by binding to an interface?

View 1 Replies View Related

Networking :: How To Send A File Using Sockets ?

Jun 25, 2010

Hi ,

I created a socket.port no 21 meaning ftp client.
I am sending some stings and receviing some data from server.Fine.

But I want to send a file some x.c to host using socket.
Please can someone help me whether we can do it or not.
If we can how can we send a file.I was only able to send buffer and data but not a file.Please if possible can you help me with example.

Regards,
shaiva

View 2 Replies View Related

Programming :: C/C++ - Program Detecting New Sockets

Jul 25, 2010

I need to create a C/C++ program in Linux that succeeds in detecting how many tcp-sockets and what tcp-sockets are created by the other processes in the system in a particular time interval (e.g., the interval time this application is running in). Then, I'd need to get some information like local/remote port number and local/remote ip address of each of these sockets.

View 8 Replies View Related

Programming :: How To Use Sockets To Display GUI At Server End

Aug 27, 2010

I am struggling a little on how to best approach this problem. I have wrote a server program that runs via xinetd, that obviously spits out data at the client end. Fairly straightforward stuff?There is a point in my server code where I need to display an image/gui i.e something that runs on X11 that prompts a user to perform a task on the display connected at the the server side.So far I have written a test program that displays some text at the client end and then launches the browser at the server end. I have also set the following export. Code: export DISPLAY=:0 and then goes on to launch my web browser. Works great when ran locally on the server and when I remotely telnet in to the server and run the code.

However when I try to run the same piece of code as a xinetd service the export seems to have zero affect and the client terminal window displays errors associated with there not being a X11 server running.The code launches fine when I create a socket to serverip:6556 it just the ability to display gui programs to another display that does not seem to be working.

View 5 Replies View Related

Networking :: Cannot Open Sockets In Computer

Sep 14, 2010

The problem started when I noticed I couldn't upload to people using a torrent downloading program, the program listened on port X and when I sniffed on the same port I saw that syn's are forwarded correctly from my nat to that port but the program doesn't relate to those packets. Then I listened with NC, and even on another port nothing is being answered to those syns packets.

View 3 Replies View Related

General :: Difference Between CPU Core And Sockets?

Mar 26, 2010

how to differentiate cores and sockets in CPU?

View 5 Replies View Related

General :: Using Netlink Sockets To Get MAC Address?

Jul 7, 2010

I am trying to retrieve an interface's MAC address using netlink address. I got to a point, where I am able to parse the reply for 'RTM_GETLINK' till 'case IFLA_ADDRESS'. After that, I have no idea to print the MAC address.

View 1 Replies View Related

Programming :: Send A Packet Through Sockets C++

Feb 1, 2011

Can someone help me with this problem,trying to send a packet,using tcp/ip,the packet should look like this:

Code:
field 1: SOCKS protocol version, 1 byte (0x05 for this version)
field 2: status, 1 byte:
0x00 = request granted
0x01 = general failure
0x02 = connection not allowed by ruleset
0x03 = network unreachable
0x04 = host unreachable
0x05 = connection refused by destination host
0x06 = TTL expired
0x07 = command not supported / protocol error
0x08 = address type not supported
field 3: reserved, must be 0x00
field 4: address type, 1 byte:
0x01 = IPv4 address
0x03 = Domain name
0x04 = IPv6 address
field 5: destination address of
4 bytes for IPv4 address
1 byte of name length followed by the name for Domain name
16 bytes for IPv6 address
field 6: network byte order port number, 2 bytes
and this is my code:

Code:
int domainLen = strlen(domain);
char reply[domainLen + 7];
reply[0] = 5; // version
reply[1] = 0; // succed
reply[2] = 0; // reserved
reply[3] = 3; // its a domain
reply[4] = domainLen;; // lenght of domain
for(int j = 0; j < domainLen; ++j)
{
reply[j + 5] = domain[j];
}
reply[5 + domainLen] = 80; // port
reply[20] = '�';
Send(reply, sizeof(reply));
domain is "www.google.com". Am I doing it right ? I dont know much about bits.

View 6 Replies View Related

CentOS 5 :: Epoll - Sockets And Threads ?

May 20, 2009

There is a transient bug in my code which I just can't catch.

The basic idea is this. I have a multithreaded server and two thread pools, the IO pool and Worker pool. The main server thread listens to incoming connections. When it gets one, it dispatches a thread from the IO pool to read the socket. An IO thread reads the socket. If there is data, it invokes a thread from the Worker pool. This thread then finishes off the processing including closing the socket. The code follows.

Before I show the code, let me tell you what's happening when I am testing it. I have a client program which has about 30 threads, each opening a separate socket connection with the server. Each sends a request which the server responds to. Sometimes I have all the threads finish in a zip. Sometimes both the client and the server hangs. And yet at other times, the client gets a connection refused message.

Now the code. I have omitted some of the nitty-gritties, including possibly variable declarations. I'll post them if it's required.

View 1 Replies View Related

Ubuntu :: Hangs At Install Screen - Then Reboots And Hangs At HP Logo

Feb 15, 2011

I am trying to install Ubuntu 10.10 x64 on a HP Pavilion p6565uk.

My PC is x64 compatible, although ubuntu will not install.

I don't get to any gui, it says ubuntu will continue install in 5 seconds, at 0, nothing happens. The CPU light is flashing, but nothing happens.

After about 10 minutes, it reboots, but when the HP splash screen shows (Before the boot selection screen) it just hangs. I have to do a hard shutdown to boot back up.

I am using wubi for install.

View 1 Replies View Related

OpenSUSE :: 11.2 - KDE Hangs Up On Boot

Mar 2, 2010

I installed OpenSUSE 11.2 and manipultes Window Behavior from Personal Settings so I can't access to my account while login. I use kde. Now I can access the system from the root login. How can I restablish the kde default settings on my account from the root account?

View 6 Replies View Related

OpenSUSE :: Hangs On SSH Logout?

May 4, 2010

I've been using OpenSUSE (11.2) and ssh to access my Ubuntu Server (8.04). The problem is that when I give the shutdown command to turn off the server (sudo shutdown -P now), OpenSUSE hangs and I can't close bash and the computer locks up. I then need to turn my OpenSUSE box off by pushing the power button. Any idea what might be causig this?I'm not sure if this is the right place to ask this question because I don't think this is a bash problem but I wasn't really sure where to ask this question.

View 6 Replies View Related

OpenSUSE :: KDE 4.5 Hangs Up While Logging In

Aug 29, 2010

I have an ACER TravelMate 6003LMI with openSUSE 11.3 and I updated now to KDE 4.5. So far, the update went fine, but now I cannot login anymore. openSUSE 11.3 boots up to the login prompt, I'm logging in, the KDE progress bar reaches about 75% and then it hangs up.


/etc/X11/xim: Checking whether an input method should be started.
sourcing /etc/sysconfig/language to get the value of INPUT_METHOD
INPUT_METHOD is not set or empty (no user selected input method).
Trying to start a default input method for the locale de_DE.UTF-8 ...
There is no default input method for the current locale.
Dummy input method "none" (do not use any fancy input method by default)
startkde: Starting up...
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
kbuildsycoca4 running...
Fetched layout groups from X server: layouts: ("de") variants: ("nodeadkeys")
Invalid D-BUS member name 'idle-hint' found in interface 'org.freedesktop.ConsoleKit.Session' while parsing introspection .....

View 9 Replies View Related

Ubuntu :: Active UNIX Domain Sockets?

Jul 27, 2010

After my first installation/ version of Ubuntu 64, I performed a netstat and noticed I did NOT have any Active UNIX domain sockets as I do now. After doing some research, I found this is related to MYSQL and server services which I am in no need of running and nor do I want to run if not needed. So exactly what are these services used for, which app is creating this and why?

Is it possible to remove the app or processes if they are not needed? Killing these connections every time they attempt to establish would be rhetorical.

~$ uname -a
Linux panda 2.6.32-24-generic #38-Ubuntu SMP Mon Jul 5 09:20:59 UTC 2010 x86_64 GNU/Linux
:~$ netstat | more
Active Internet connections (w/o servers)

[Code].....

View 1 Replies View Related

Programming :: Parallel Data Transfer Using Sockets

Feb 25, 2011

I am doing a project where 2 clients connect to server and communicate (chat) and transfer data one after other using sockets. I have working code for this in C language. Now our main aim is to create a communication link where two clients transfer multiple streams data parallely. To be more precise i want to transfer images files and audio files parallel at same time, so is it possible to send data parallel using one socket connection?

View 3 Replies View Related

Red Hat / Fedora :: Unable To Connect To Windowsxp Sockets

Mar 14, 2010

I am using windowsxp in one pc and another running on fedora 11,,, i develop socket based applications which run on fedora linux. But i need to test these applications with a software running on windows xp. i found that i could not connect to socket of the application running on fedora from an application running on windows. i am not able to identify the problem. should i try any other linux distribution?

View 4 Replies View Related

Networking :: Bad: Two Sockets Of Different Ports In A Single Program?

Mar 4, 2011

I am trying to make a file proxy server...that is any request of file a client makes goes to the proxy server...it checks it in cache if not there then asks main server for the file. to act as a server for client and as client for server...how to do it in a single program. I tried with 2sockets with different ports one for client-proxy server and one for proxyserver-main server.But it does not workAm i doing something wrong or is there any other method

View 2 Replies View Related

Networking :: How To Receive ICMP Messages In UDP Sockets

Jul 9, 2009

I have a C program which does.

1. Creates a UDP socket
2. Send the UDP Request packet to the TFTP server.
3. If the TFTP server is not listening in the 69 port, the remote machine send an ICMP ("Port Unreachable") message.

Is there a way to receive a notification from the Linux kernel on receipt of an ICMP packet to the created UDP socket.

View 1 Replies View Related

Networking :: HTTPD Not Starting - No Listening Sockets Available

Sep 29, 2010

root@HOST [~]# /etc/init.d/httpd start
Starting httpd: no listening sockets available, shutting down
Unable to open log [FAILED]
root@HOST [~]# /etc/init.d/httpd restart
Stopping httpd: [FAILED]
Starting httpd: no listening sockets available, shutting down
Unable to open logs [FAILED]
root@HOST [~]# tail -n 10 /var/log/messages
Sep 29 17:59:30 localhost avahi-daemon[2870]: New relevant interface wlan0.IPv4 for mDNS.
Sep 29 17:59:30 localhost avahi-daemon[2870]: Joining mDNS multicast group on interface wlan0.IPv4 with address 196.219.240.236.
Sep 29 17:59:30 localhost avahi-daemon[2870]: Registering new address record for 196.219.240.236 on wlan0.
Sep 29 17:59:31 localhost avahi-daemon[2870]: New relevant interface wlan0.IPv6 for mDNS.
Sep 29 17:59:31 localhost avahi-daemon[2870]: Joining mDNS multicast group on interface wlan0.IPv6 with address fe80::223:cdff:fecb:9c5e.
Sep 29 17:59:31 localhost avahi-daemon[2870]: Registering new address record for fe80::223:cdff:fecb:9c5e on wlan0.
Sep 29 17:59:31 localhost NetworkManager: <info> (wlan0): device state change: 7 -> 8
Sep 29 17:59:31 localhost NetworkManager: <info> Policy set 'Sunsoft1' (wlan0) as default for routing and DNS.
Sep 29 17:59:31 localhost NetworkManager: <info> Activation (wlan0) successful, device activated.
Sep 29 17:59:31 localhost NetworkManager: <info> Activation (wlan0) Stage 5 of 5 (IP Configure Commit) complete.
What is the problem I have a local server
CentOS Linux

View 19 Replies View Related

General :: (Netstat -a Command) Why Some Sockets Do Not Have Path Name

Oct 15, 2010

When I run "netstat -a" commnand, it display:

Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 20269 /tmp/.gdm_socket
...
unix 2 [ ] DGRAM 997161
unix 3 [ ] STREAM CONNECTED 942628 /tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 942627
unix 3 [ ] STREAM CONNECTED 942626 /tmp/.X11-unix/X0 ....

Why some socket don't have Path name? And what mean's RefCnt = 2?

View 2 Replies View Related

General :: Setting Timeout Time For TCP Sockets?

Jun 8, 2011

I have written simple TCP server-client programs in 'C' on my RHEL 5 64 bit.I want to add SEND and RECEIVE timeout for this socket; so that if server is not responding in given time, request will get timeout instead of waiting in "recv" call.But I failed to do so.

View 6 Replies View Related

Server :: Apache Crash - No Listening Sockets Available

May 23, 2011

Code:
[Sun May 22 04:02:06 2011] [notice] SIGHUP received. Attempting to restart
(98) Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs

Above message is from /etc/httpd/logs/error_log.1. Saturday morning I reinstall my server. After finish, no error. I can access my HTTP server. Monday morning it has crashed. I don't know what is the meaning about this message.

View 2 Replies View Related

Software :: Api For Analyzing The Stock Market In C Using Bsd Sockets?

Jul 1, 2011

i was wondering how to get a api for analyzing the stock market or certain stocks from google finance and writing a database with a search alogorithm in c

View 2 Replies View Related

Programming :: Creating 2 Sockets In Client / Server?

Jun 9, 2010

I have a problem creating my second socket in client file. the program was running well but when I try to add another socket to connect to the same server, I got a problem connecting to the first socket! it doesn't make sense. the original code was:

sockfd[i] = socket(AF_INET, SOCK_STREAM, 0);
if(sockfd[i] < 0) error("(MAIN) - Error openning socket 1");
port_num[i] = portno;
bzero((char*) &serv_addr[i], sizeof(serv_addr[i]));

[Code].....

View 1 Replies View Related

Programming :: Read DNS Informaton Using Sockets And C Libraries

Jun 9, 2010

I am using the API libpcap in order to filter the traffic of the port 53 from my PC ro other PCs, in other words the DNS traffic.I want to get more information about the DNS traffic that is being sent to the DNS server, in other words the queries. So far I have no idea how to read the information data or payload of the UDP package in order to read the content of the traffic for example if there is any PTR, A, MX, etc Resource Record.According to the RFC 1053 there is a header that is possible to use in order to easily get this info.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved