Re: Is there a way to display a message on the clients?

View: New views
2 Messages — Rating Filter:   Alert me  

Re: Is there a way to display a message on the clients?

by Graham Innes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Tim / Jazz,

I do this successfully by using a script which I execute with:

sudo /opt/drbl/bin/drbl-doit -h "$ipaddr" sudo -u $account /usr/bin/msg

where $ipaddr is the IP address of the PC and $account is the username of the user on the PC to whom the message is being sent.

The script (/usr/bin/msg) is as follows:

#!/bin/bash

export DISPLAY=:0
zenity --warning --text="Your message goes here!"

In my case this runs from a web-based application (user www-data on Debian / Ubuntu), so I had to modify the sudoers file to avoid the password prompt on execution (reduction in security!).

I was not able to get this working without putting everything into a script as above.

Hope that helps...



Message: 3
Date: Thu, 13 Aug 2009 16:44:12 +0100
From: "Tim Shelley" <tim_j_shelley@...>
Subject: Re: [Drbl-user] Is there a way to display a message on the
       clients?
To: "'Jazz Yao-Tsung Wang'" <jazzwang.tw@gmail.com>
Cc: drbl-user@...
Message-ID: <BAY113-DAV332B28FBB218695A58327B7050@...>
Content-Type: text/plain;       charset="us-ascii"

Hi Jazz,

Thanks for the info. I know it's not strictly DRBL related, so your help is
appreciated. I'll see what more I can discover.

Regards,

Tim.

-----Original Message-----
From: Jazz Yao-Tsung Wang [mailto:jazzwang.tw@...]
Sent: 13 August 2009 15:56
To: Tim Shelley
Cc: drbl-user@...
Subject: Re: [Drbl-user] Is there a way to display a message on the clients?

> Thanks. I've been playing with it. I changed the :0 to :0.0, but I get the
> following error:
> Gtk-WARNING **: cannot open display :0.0

Well, once I sent the mail, I found I miss something again.

1. the user who is running x-windows are different if you're using auto
login.
2. drbl-doit run ssh as "root" who is not current owner of display :0.0

so....there might need more hack to achieve this feature, such as

1. adding "xhost +" to x-window session,
   it will allow other user to connect display :0.0
2. .... maybe something more ....

Jazz




------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Drbl-user mailing list
Drbl-user@...
https://lists.sourceforge.net/lists/listinfo/drbl-user

Re: Is there a way to display a message on the clients?

by TimShelley :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi Graham,

Thanks for the info.

I'm going to play with this to see if I can figure out a way of sending out a visual message to all clients on our DRBL network, telling any open clients to say logout as the server will be rebooting in 10 minutes etc...

If I understand how you are doing it, each user needs to be part of sudo so that you can run 'sudo -u $account /usr/bin/msg' on the client? I'm guessing that the msg script will not run correctly without running it as sudo?

Regards,

Tim


From: gdi2k@...
Date: Thu, 17 Sep 2009 08:05:56 +0800
To: drbl-user@...
Subject: Re: [Drbl-user] Is there a way to display a message on the clients?

Hi Tim / Jazz,

I do this successfully by using a script which I execute with:

sudo /opt/drbl/bin/drbl-doit -h "$ipaddr" sudo -u $account /usr/bin/msg

where $ipaddr is the IP address of the PC and $account is the username of the user on the PC to whom the message is being sent.

The script (/usr/bin/msg) is as follows:

#!/bin/bash

export DISPLAY=:0
zenity --warning --text="Your message goes here!"

In my case this runs from a web-based application (user www-data on Debian / Ubuntu), so I had to modify the sudoers file to avoid the password prompt on execution (reduction in security!).

I was not able to get this working without putting everything into a script as above.

Hope that helps...



Message: 3
Date: Thu, 13 Aug 2009 16:44:12 +0100
From: "Tim Shelley" <tim_j_shelley@...>
Subject: Re: [Drbl-user] Is there a way to display a message on the
       clients?
To: "'Jazz Yao-Tsung Wang'" <jazzwang.tw@gmail.com>
Cc: drbl-user@...
Message-ID: <BAY113-DAV332B28FBB218695A58327B7050@...>
Content-Type: text/plain;       charset="us-ascii"

Hi Jazz,

Thanks for the info. I know it's not strictly DRBL related, so your help is
appreciated. I'll see what more I can discover.

Regards,

Tim.

-----Original Message-----
From: Jazz Yao-Tsung Wang [mailto:jazzwang.tw@...]
Sent: 13 August 2009 15:56
To: Tim Shelley
Cc: drbl-user@...
Subject: Re: [Drbl-user] Is there a way to display a message on the clients?

> Thanks. I've been playing with it. I changed the :0 to :0.0, but I get the
> following error:
> Gtk-WARNING **: cannot open display :0.0

Well, once I sent the mail, I found I miss something again.

1. the user who is running x-windows are different if you're using auto
login.
2. drbl-doit run ssh as "root" who is not current owner of display :0.0

so....there might need more hack to achieve this feature, such as

1. adding "xhost +" to x-window session,
   it will allow other user to connect display :0.0
2. .... maybe something more ....

Jazz





View your other email accounts from your Hotmail inbox. Add them now.
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Drbl-user mailing list
Drbl-user@...
https://lists.sourceforge.net/lists/listinfo/drbl-user