[mythtv-users] mythtv-status stopped showing up in motd

Brian Maupin bgmaupin at gmail.com
Wed Nov 25 05:36:15 UTC 2009


On Tue, Nov 24, 2009 at 10:57 PM, Johnny <jarpublic at gmail.com> wrote:
>> Oops, I should've read it properly. Have you tried removing the
>> redirects to /dev/null so cron sends you the output?
>
> Thanks for the tip. The output seems normal. When I run sudo
> /etc/init.d/mythtv-status reload, then /etc/motd is updated properly.
> But when I log in the motd day is reset and it doesn't show up. I even
> tried doing the reload and then logging in with a second ssh window.
> The act of logging in seems to reset the motd somehow. I don't know
> enough about the login process to know where to look to find out how
> this could be happening.
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>

I noticed that on my ubuntu karmic setup.  It seems like ubuntu is
updating the motd on login so it can display update related
information - you have X number of packages to update, need to reboot
etc.  If you look at /etc/update-motd.d/ you can see the files it
pulls together to do this.  You have a couple options.  You can turn
this login generation of the motd off and let mythtv-status generate
the motd like before.  I don't know where you configure this though,
since I like those messages I didn't look for it, so I can't help you
there.  Googling "/etc/update-motd.d karmic" or something like that
will probably get you started or dpkg -S /etc/update-motd.d should
give you an idea of which package to look at.

If you leave it on you can create a new entry in this folder to add
the mythtv-status stuff.  You have more options here as well, you can
have mythtv-status run everytime you login, adding a second or two to
your login but having up to date information, or have mythtv-status
run on a schedule and not incur the delay at the expense of slightly
stale information (depending on how often it runs).

For everytime you login.  This should use the settings configured in
/etc/default/mythtv-status

FILE: /etc/update-motd.d/50-mythtv-status
#!/bin/sh

if [ -x /usr/bin/mythtv-status ] ; then
       if [ -f /etc/default/mythtv-status ] ; then
               . /etc/default/mythtv-status
               /usr/bin/mythtv-status $ARGS -h $HOST
       else
               /usr/bin/mythtv-status
       fi
fi



To use a scheduled mythtv-status, this is like the current/old way to do it
FILE: /etc/update-motd.d/50-mythtv-status
#!/bin/sh
[ -f /var/run/mythtv-status] && cat /var/run/mythtv-status


AND edit the /etc/init.d/mythtv-status so it writes to a separate file
instead of trying to manage the motd

I don't have the original /etc/init.d/mythtv-status to do a diff of,
but just change the start and stop sections so they look like below

start|reload|refresh|restart|force-reload)
    log_daemon_msg "Updating $DESC" "$NAME"
    rm -f "/var/run/$NAME" 2>/dev/null || true
    $DAEMON $ARGS -h $HOST > "/var/run/$NAME"
    log_end_msg 0
    ;;
stop)
    log_daemon_msg "Stopping $DESC" "$NAME"
    rm -f "/var/run/$NAME" 2>/dev/null || true
    log_end_msg 0
    ;;

You also need to have a cron entry to do a reload on a schedule, but
when you installed mythtv-status with apt it should ave already set
that up.


More information about the mythtv-users mailing list