General :: Receive Shutdown Broadcast Notification In Desktop (GNU, Gnome)
Jul 17, 2011
When # shutdown +5 is run all the terminals (including pseudo terminals) are sent broadcast messages saying system is about to go down. Is it possible for user to receive this in the form of OSD or system tray notification so that he will be informed even if he is not running any terminal emulator or running it but minimized it and working with something else?
View 1 Replies
Sep 25, 2010
When setting up an alias for eth0, the interface works as expected for normal traffic, but does not receive broadcast traffic.
Host 1's setup:
Code:
Pinging host 1's normal interface from host 2 works as expected:
Code:
Pinging host 1's alias interface from host 2 works as expected:
Code:
Broadcast pinging from host 2 only gets a reply from host 1's real interface (as well as some other uninteresting devices on the network):
Code:
I have confirmed by listening on both interfaces using netcat, and broadcasting using netcat, and again only the real interface receives data.
Is this by design, or is it possible to get interface aliases to receive broadcast traffic?
View 1 Replies
View Related
Feb 24, 2011
I am working on uClinux/almost same as Linux. I am new to socket programming. I have two micro controllers running on same code. Simple run with arguments mean send merged string.
run 1st micro controller (Send): ./Name "anystring"
run 2st micro controller (Recive):/Name
My code is:
int receive() {
// Create socket
int sock_fd;
struct sockaddr_in addr;
char buffer[kBufferSize];
int bytes_received=0;
int addr_len = sizeof(addr);
printf("receive start ");
sock_fd = socket(AF_INET, SOCK_DGRAM, 0);
if ( sock_fd == -1 ) {
printf("receive Create ");
// Error occurred return 0; }
printf("Res Create sucee ");
// Create address from which we want to receive, and bind it
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = INADDR_ANY;
addr.sin_port = htons(kPortNumber);
if ( bind(sock_fd, (struct sockaddr*)&addr, sizeof(addr)) < 0 ) {
printf("receive bind "); // Error occurred return 0; }
printf("Bind Succeful sucee ");
while ( 1 ) {
// Receive a message, waiting if there's nothing there yet
bytes_received = recvfrom(sock_fd, buffer, kBufferSize-0, 0,
(struct sockaddr*)&addr, &addr_len);
if ( bytes_received < 0 ) { // Error occurred
printf("receive bytes "); return 0; }
printf(" bytes_received succeful ");
printf("Ressocketstring : %s ",buffer);
memset(Ressocketstring,0x00 , sizeof(Ressocketstring));
strcpy(buffer,Ressocketstring); printf("Ressocketstring : %s
",Ressocketstring); printf(" ");
printf("Hello Receive finished");
// Now we have bytes_received bytes of data in buffer. Print it!
fwrite(buffer, sizeof(char), bytes_received, stdout); } }
int transmit(char * data, int length) {
int sock_fds[kMaxSockets];
// Obtain list of all network interfaces
/* struct ifaddrs *addrs;
if ( getifaddrs(&addrs) < 0 ) {
// Error occurred return 0; } */
// Loop through interfaces, selecting those AF_INET devices that support broadcast, but aren't loopback or point-to-point
struct sockaddr_in addr; int number_sockets = 0; struct hostent *he;
/* const struct ifaddrs *cursor = addrs;
while ( cursor != NULL && number_sockets < kMaxSockets ) {
if ( cursor->ifa_addr->sa_family == AF_INET
&& !(cursor->ifa_flags & IFF_LOOPBACK)
&& !(cursor->ifa_flags & IFF_POINTOPOINT)
&& (cursor->ifa_flags & IFF_BROADCAST) ) {
// Create socket*/
sock_fds[number_sockets] = socket(AF_INET, SOCK_DGRAM, 0);
if ( sock_fds[number_sockets] == -1 ) // Error occurred {
printf("Error Create "); return 0; }
he = gethostbyname((char *)BCASTADDRESS) ;
if (he==NULL ) {printf("Error gethostbyname ");
herror("gethostbyname"); printf("Error host "); exit(1);
} printf("Res He ");
// Create address from which we want to send, and bind it
memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET;
addr.sin_addr = *((struct in_addr *)he->h_addr);//((struct sockaddr_in *)cursor->ifa_addr)->sin_addr; addr.sin_port = htons(kPortNumber);
if ( bind(sock_fds[number_sockets], (struct sockaddr*)&addr, sizeof(addr)) < 0 )
{ // Error occurred printf("Error bind "); return 0; }
// Enable broadcast int flag = 1;
if ( setsockopt(sock_fds[number_sockets], SOL_SOCKET, SO_BROADCAST, &flag, sizeof(flag)) != 0 ) // Err occur { printf("Error Enable "); return 0; }
number_sockets =1; printf("Succes 1 "); printf("transmit Create ");
// Initialise broadcast address memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET; addr.sin_addr.s_addr = INADDR_BROADCAST;
addr.sin_port = htons(kPortNumber);
// Send through each interface int i;
for ( i=0; i<number_sockets; i++ ) {
if ( sendto(sock_fds[i], data, length, 0, (struct sockaddr*)&addr, sizeof(addr)) < 0 )
{ printf("Error Send "); // Error occurred return 0;
} printf("Succes 2 "); } return 1; } void MergeMessage( ) {
memset(socketstring,0x00,sizeof(socketstring));
sprintf(socketstring,"%s@%s@%s@%s@%s@%s@%s@%s@%s@%s@%s
",Tmeg.s1,Tmeg.s2,Tmeg.s3,Tmeg.s4,Tmeg.s5,Tm eg.s6,Tmeg.s7,Tmeg.s8,Tmeg.s9,Tmeg.s10,Tmeg.s11);
printf(" MergeSocketMessage : %s ",socketstring); }
int main (int argc, char** argv) {
int fd=0,bdc=0; struct ifreq ifr; printf("Tsarting man ");
fd = socket(AF_INET, SOCK_DGRAM, 0);
strncpy(ifr.ifr_name, "eth0", IFNAMSIZ-1);
ioctl(fd, SIOCGIFADDR, &ifr); close(fd);
memset(MYIP,'-',sizeof(MYIP));
memset(BCASTADDRESS,'-',sizeof(BCASTADDRESS));
strcpy(MYIP, inet_ntoa(((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr));
printf("Etho: %s ,len:%d ", MYIP,strlen(MYIP));
for(bdc=strlen(MYIP);MYIP[bdc-1]!='.';bdc--) {}
strncpy(BCASTADDRESS,MYIP,bdc-1); strcat(BCASTADDRESS,".255");
printf("BCASTADDRESS: %s ,len:%d
", BCASTADDRESS,strlen(BCASTADDRESS));
printf("Initial Broad Cast message "); {
/*s0"0" (id=76)
s1"500" (id=77)s2"100" (id=78)s3"100" (id=78)s4"startVD" (id=79)
s5"lighting" (id=80)s6"reading" (id=81)s7"Anna" (id=82)s8"0" (id=76)
s9"";s10"" (id=64)s11"" (id=64)*/
strcpy(Tmeg.s0,"0"); strcpy(Tmeg.s1,"500");strcpy(Tmeg.s2,"100");strcpy(Tmeg.s3,"100");
strcpy(Tmeg.s4,"startvd");strcpy(Tmeg.s5,"lighting");strcpy(Tmeg.s6,"reading");
strcpy(Tmeg.s7,"anna");strcpy(Tmeg.s8,"0"); }
MergeMessage (Tmeg); if( strlen(argv[1]) ) {
//strcpy(socketstring,Tmeg,sizeof(Tmeg));
if(transmit(socketstring, strlen(socketstring) ) ) {
printf(""%s" transmitted. ", socketstring); } else {
printf("Error occurred: %s ", strerror(errno)); return 1; } }
else { for( ; ; ) {
if ( argc < 2 ) // No argument: Just listen {
printf("Listening... "); if ( !receive() ) {
printf("Error occurred: %s ", strerror(errno)); return 1;
} return 0; } } } printf("Finished "); return 0;
} //////////////// .h file is /////////////
//#define WIN32_LEAN_AND_MEAN// Exclude rarely-used stuff from Windows headers
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <fcntl.h>
#include <netdb.h>
#include <signal.h>
#include <sys/wait.h>
#include <sys/ioctl.h>
#define SubLen50
//#include <ifaddrs.h>
#include <errno.h>
char MYIP[20];
char BCASTADDRESS[20];
typedef struct {
char s0[SubLen];
char s1[SubLen];
char s2[SubLen];
char s3[SubLen];
char s4[SubLen];
char s5[SubLen];
char s6[SubLen];
char s7[SubLen];
char s8[SubLen];
char s9[SubLen];
char s10[SubLen];
char s11[SubLen];
}msg_struct;
msg_struct Sendmsg;
msg_struct Tmeg; //Recivemsg;
Boolean pri[6];
char socketstring[SubLen*12];
char Ressocketstring[SubLen*12];
int kBufferSize = (SubLen*12);
View 2 Replies
View Related
Aug 31, 2011
After power off the Gnome desktop environment does not start on my machine. It never gets past the splash screen with Fedora logo.The OS boots, and I can ssh and even run graphical applications, such as Thunderbird, remotely. No errors are reported in /var/log/Xorg.0.log. There are errors reported in .xsession-errors (attached) but I do not now how to recover from them
View 8 Replies
View Related
Apr 16, 2011
I've installed GNOME 3 on my Gentoo Linux, it really awesome and I love it.But here is a little glitch that I don't get used to: The notification area is hide until I hit "Windows" key or move the mouse cursor to the right-bottom corner.Since I've some program use the notification to indicate their status (for example, my Chinese input method use this to indicate whether I'm in English mode or Chinese mode. And a program that show the CPU temperature on the notification area).It becomes a little inconvenient if I've to move the cursor or hit "Windows" key just in order to check those status.
So is it possible to make the notification area always show on the screen? Or is it possible to integrate the notification area to menu bar just like GNOME 2.X or XFCE4?Besides that, I would like to know is it possible to remove the accessibility on the menu bar top-right corner?
View 1 Replies
View Related
Apr 6, 2011
I have installed Fedora 15 Alpha with GNOME 3. Everything is working fine. However, I can't see any option to hibernate or shutdown.
In the top panel when I click my user name, I only have one option and that is to suspend. Normally I like to hibernate or shutdown. And I can't see any option of what to do when I close my netbook. Normally, I prefer to hibernate.
View 3 Replies
View Related
Nov 3, 2010
I have Ubuntu 10.10 on e-machine T-1221 I can shut down the machine using :
sudo shutdown -h from terminal
I can shutdown using powerbutton on case. I can't use the applet indicator powerbutton in root account, but, I can use the command under "System-->-Shutdown" in root account, but I don't see "System-->-Shutdown" in users account. Is there a way to add it ? I installed Debian 6.0 Squeeze on my Acer Aspire 3620 Laptop it works just fine and has the same Gnome Desktop. The only thing different is that there is no powerbutton available thru Gnome applets, only the command on menu under" Sytem-->-Shutdown", which I'm fine with on this machine.
These are the things I tried on emachine T-1221
I tried "acpi=force"
I tried "noacpi"
I tried "noacpi nolapic"
I read the bug reports it stated that on live-cd there was only suspend and hibernate. There is no shutdown or reboot. I tried: "#start acpi", it closed with errors. It said that Ubuntu uses upstart. Is there a script which you can add to power button to add the shutdown.? Really I don't necessarily need powerbutton, I think the work around would be adding the command to "System-->-Menu.
View 3 Replies
View Related
Nov 7, 2010
creating your own notification icon for Gnome? Like the Power, Network, and Sound ones. I found something called Zenity but it doesn't seem to be able to create a drop-down menu and I can't see how I'd update the information in the icon once it is created. I have a script set up to check something and want to report the results back via a persistent notification icon, with the ability to change the icon and its properties (mouseover/tooltip text) and drown-down menu text as appropriate.
View 8 Replies
View Related
Mar 26, 2010
I have added a ubuntu 9.10 desktop machine to a windows domain, I can log on to the ubuntu machine using domain user accounts and passwordds, now I want to configure the linux machine to connect to the MS exchange server 2003 in the domain to send receive emails. How can I do this? I tried installing thunderbird but it doesnt give an option for SMTP or ms exchange server in the mail settings.
View 3 Replies
View Related
Jun 22, 2011
I am using 64 bit F15 with gnome in fallback mode with compiz.I see the clock in the login screen, but with no changes clock does not show anymore and i can't see the notification area (the four desktops in the right corner as well as the windows name). I have deleted .gconf and .gconfd (that solved a similar issue time ago), but it does not work this time.I have
View 2 Replies
View Related
Apr 28, 2011
I have four different desktops, or workspaces, on here. I use one for a web browser, another for instant messaging, the third for Evolution, and the fourth for whatever, usually working in folders or word documents or whatnot. Whenever someone sends me a message on Empathy and I'm not focused on the chat window it dings. This is true for desktops 2-4, but when I'm on workspace 1 whether my web browser is minimized or not I don't get the notification sound, the persons message just appears as a notification panel.
View 9 Replies
View Related
Jan 29, 2011
Note: the image may load slowly as it is a server on my home internet connection
[IMG]http://mshenrick.dyndns.org/Pictures/uf1.png
as you can see, most icons are in the notification area, but skype and any programs with icons opened after appear always on top in the top left corner.
I've tried moving things about to no avail
View 1 Replies
View Related
Aug 26, 2009
I am a complete newbie only had pc with linux installed for a week, for some stupid reason we had 8.10 pre-installed and decided to upgrade to 9.04 now we can't get past the gnome login screen asking for user name and password. Linux was already installed by mesh with a userename and password which we didn't change,we are really stumped as we can't get past this logon screen.
View 8 Replies
View Related
Apr 22, 2010
I cannot locate shutdown log for Linux shutdown to check various activities carried out during shutdown. I can view Startup Log which is availble on console>Applications>System Tools>System Logs.
I have included Shutdown/Startup in dbora, so that Oracle 10gR2 Shutdown/Startup will be automated during OS Shutdown/Startup.
I want to check Shutdown log because Oracle Shutdown was not running, as from $ORACLE_HOME/shutdown.log contains no entries, where as startup log contains latest startup details.
That means here 2 issues are there. One, I want to locate OS Shutdown Log and the other being Why Oracle Shutdown not getting executed.
View 2 Replies
View Related
Apr 7, 2011
I've installed openSUSE 11.4 fresh on my laptop. When I do a shutdown from Gnome and choose the Shut Down option I always return back to the login screen and from there I need to choose the shutdown command again and it works from there. Is there a way to fix the first shutdown option from within Gnome so that it shuts down instead of logging out?
View 1 Replies
View Related