LinuxMCE Forums

General => Feature requests & roadmap => Topic started by: brononius on September 05, 2012, 07:17:42 am

Title: News flash
Post by: brononius on September 05, 2012, 07:17:42 am
Maybe a nice feature would be that a LinuxMCE "administrator" could send a kind of news flash that's pushed to all LinuxMCE installation?

Today, when you log in with ssh, you see from time to time update messages. Mostly i do this, but i'm always afraid that i can/will break something with this. For examply the message "New release precise available". I've seen on this forum that this will break the system?! So luckly i've seen the message? But i think that not everyone is looking each time all posts on the forum.

So maybe it would be nice that we can see a message from 'linuxMCE' that this is a bad idea?
This could also be used for mayor updates messages, new features...?

The message could/should appear when you login with ssh.
And maybe also on the admin page, an orbiter... ?

fe after log in with ssh
Linux dcerouter 2.6.32-42-generic #95-Ubuntu SMP Wed Jul 25 15:57:54 UTC 2012 i686 GNU/Linux
Ubuntu 10.04.4 LTS

Welcome to Ubuntu!
 * Documentation:

5 packages can be updated.
5 updates are security updates.

New release 'precise' available.
Run 'do-release-upgrade' to upgrade to it.

LinuxMCE messages

   - Don't do the 'do-release-upgrade' for the package 'precise'. It will break your system...
     More info on

   - Don't forget to checkup out our new XYorbiter:


Title: Re: News flash
Post by: mkbrown69 on September 05, 2012, 06:38:53 pm
Just a thought...  It could be implemented as a re-usable component, like a Twitter/XMPP/RSS feed reader...

Title: Re: News flash
Post by: tschak909 on September 05, 2012, 09:21:05 pm
ok, cool, awesome. make it, i'm as always in the #linuxmce-devel channel to provide support. :)

Title: Re: News flash
Post by: stedaniels on September 06, 2012, 07:02:01 pm
Something like this would probably do. I've used SVN as the source, the URL is configurable. Twitter doesn't provide the flexibility we'd likely want, and they are getting more closed by the day.

Code: [Select]
#!/bin/sh -e
#    95-lmce-dynamic-motd - display the motd message from LinuxMCE SVN
#                           useful to advise against release upgrades
#    Based on the below:
#    91-release-upgrade - display upgrade message or update the cache
#                         in the background
#    Originally Copyright (C) 2010 Canonical Ltd.
#    Original Authors: Dustin Kirkland <>
#    Authors: Steve Daniels <>
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, version 3 of the License.
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    GNU General Public License for more details.
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <>.

if [ -s "$stamp" ]; then
        # Stamp exists and is populated, so display
        lmce_dynamic_motd=`cat $stamp`
        echo -e "$lmce_dynamic_motd"
elif [ -f "$stamp" ]; then
        # Stamp exists, but is empty, see if it's expired
        now=$(date +%s)
        lastrun=$(stat -c %Y "$stamp") 2>/dev/null || lastrun=0
        expiration=$(expr $lastrun + 86400)
        if [ $now -ge $expiration ]; then
                # But is older than 1 day old, so update and output
                lmce_dynamic_motd="`exec wget -q -O - $lmce_dynamic_motd_url`"
                echo -e "$lmce_dynamic_motd" | tee $stamp
        # No cache at all, so update and output
        lmce_dynamic_motd="`exec wget -q -O - $lmce_dynamic_motd_url`"
        echo -e "$lmce_dynamic_motd" | tee $stamp

The file needs to exist here: /etc/update-motd.d/95-lmce-dynamic-motd
It also needs to be executable:
Code: [Select]
sudo chmod 755 /etc/update-motd.d/95-lmce-dynamic-motdObviously the URL "" needs to be changed to something else, or a file checked in there and maintained. You can even use COLOURS as listed here: ( plain text otherwise please.

Can make this a ticket and attach it if needed. Questions and improvements welcome.

Title: Re: News flash
Post by: tschak909 on September 06, 2012, 07:14:23 pm
I would recommend reading the MessageSend page on the wiki.

You will want to send a message to the Orbiter Plugin, for Display Message. This will do what you want.

You can prototype the message using the web admin advanced>configure>devices, going to the orbiter plugin, selecting send command, and looking for the Display Message command. It will show you the messagesend command it constructs, as you build the message.

Title: Re: News flash
Post by: stedaniels on September 07, 2012, 10:20:25 am
Hi tschak,

I think I've fulfilled the OP's request for SSH.

I'd imagine there would want to be some discussion over sending messages to the Orbiters and the web admin.

The web admin is easy, because it could just display a banner of some sort. But when you start to think of acknowledging it, setting a database flag perhaps? It starts to get more complicated. Same with MessageSend, you don't want the script running every time someone logs into SSH or every time the cron runs and MessageSend-ing to all the orbiters. There needs to be some kind of acknowledgement flagging. Then there's formatting for colours, font weight, etc. It'd need to be different for each output, console/web/Orbiter.

The script I've written specifically caters for the SSH MOTD. While it could be expanded, I'm more of a KISS kind of guy, that script in that location shouldn't be messing around with other things. It's purpose is just to generate and output an MOTD fragment.

For further discussion, the script looks at a fictional URL ( there would need to be a policy governing it's content and update frequency. I pointed at SVN because it has a good audit trail, which I think is important if your going to be sending messages to so many systems. It also means we can use raw files and not have to set up a fancy administration system for the messages.

I forgot to add that my script does have a dependency on wget.

Title: Re: News flash
Post by: _if_ on September 07, 2012, 01:14:46 pm
that script looks very cool and helpful to me. someone just needs to maintain it.
btw, do we have some sort of release notes where is listed what changes have been checked in and what they are for?

Title: Re: News flash
Post by: locutus on September 07, 2012, 01:21:38 pm
Title: Re: News flash
Post by: _if_ on September 09, 2012, 03:50:24 pm
ah cool!
it propably doesn't make sence to integrate that whole list because de updates depend on the status of every system, right?
Title: Re: News flash
Post by: on September 09, 2012, 04:19:10 pm
You could use instead of twitter. It's more free and also has an API. I was thinking of playing around with this in Python (the twitter modules work for as well).

Learning Python atm, whilst studying at uni AND working, so don't hold your breath though.
Title: Re: News flash
Post by: stedaniels on September 09, 2012, 10:56:29 pm
It would be trivial to do this in bash. But without buy-in and commitment from someone in-the-know to update the message then I see little point in spending any more time on it.
Title: Re: News flash
Post by: Marie.O on September 09, 2012, 10:59:33 pm

why don't you just keep track of the changes, hang out in IRC, track what happens in the wiki and the forum, and create messages for the project?
Title: Re: News flash
Post by: stedaniels on September 10, 2012, 10:54:06 am
I don't see a problem with that. Any preferences on where you'd like the messages pulled from?

The way I see it is, you'd obviously not want to have messages being pulled into everyone's systems if you didn't have ultimate control of the source.

If the source was a file on SVN you'd have that control while being able to update it at will, but it would require giving me write access to a subset of SVN, a bit of .htaccess magic could easily restrict my access if you felt it necessary.

If the source was something like Twitter, it's not very secure from a multiple people being able to access it and change the password point of view.

I could probably enhance my bash, to pull the latest post from a specific topic on the forum.. though if you'd prefer it to pull the content from forum then it'd be easier to do in Perl.

Thanks for joining the discussion, I'll await feedback.

Title: Re: News flash
Post by: Marie.O on September 10, 2012, 04:32:14 pm
It is not about *where* to pull stuff from, but to provide the source of information in a meaning full manor, i.e. YOU go around the places, and put everything news worthy together manually, and provide an rss feed of it, that everyone else can use. I was not referring to a programming task, but to a blogger task.
Title: Re: News flash
Post by: stedaniels on September 12, 2012, 02:59:54 pm
I know what you meant, your missing what I meant.

If this script goes out, it's in every new/upgraded LinuxMCE installation. This means whoever controls the source where the script gets it's updates from can send all manner of messages out to that entire user base. Although I deem myself a very trustworthy person, it would be foolish for the source not to be on a controlled resource. Even if I'm the one compiling it and publishing it, it should be at a LinuxMCE resource.

I hope you see what I mean now?
Title: Re: News flash
Post by: Marie.O on September 12, 2012, 03:07:05 pm
Do I take that as a commitment, that you will do this for the next 12 month? If yes, we will provide the necessary means on the LinuxMCE infrastructure.
Title: Re: News flash
Post by: on September 13, 2012, 07:32:48 pm
You could make it an opt-in feature to avoid any "misunderstandings" with people who'd rather not see it.

I, for one, welcome such a feature! It's nice to feel the warm embrace of the community even on your telly (otherwise such a cold, faceless place).. :D
Title: Re: News flash
Post by: golgoj4 on February 15, 2013, 01:59:42 am
I will take ownership of it if needed to keep it going. The forum is reminding me this is an old topic, but well people seem to be interested in this so moving it forward is good for the community :)