[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Kwrited



I looked through the debian-kde archives and found a script you wrote which is 
supposed to work around that. However, it appears it doesn't work for KDE 
3.1, or at least on my setup.


#!/bin/bash

## kdewall:     simple wall for Debian/KDE
##
##              KDE KDE users which use only konsole never see
##              wall messages (no utmp entry 'cause Debian
##              does not like libtempter and it has not HAVE_LIBUTIL)
##              (at least now kwrited does not only waste memory :)
                
prg="${0##*/}"

if [ $# -ne 1 ]; then
        echo "Usage:  $prg  msgfile" >&2
        exit 
fi

if [ -f "$1" -a -r "$1" ]; then
        msgfile="$1"
else
        echo "File not found or not readable: '$1'" >&2
        exit 
fi

msgheader="Message from '$USER@$HOSTNAME' ( ate):"

# selection of kwrited processes:
#       o find all /bin/cat processes
#       o check if parent is kwrited
#       o write to all ptys of bin

echo "informing kwriteds ..."
ps ax -o pid,ppid,cmd | grep /bin/cat | grep -v grep |
        while read pid ppid foo; do
                #ps -o pid,ppid,cmd -p $ppid;
                #ps -o ppid,pid,tty,cmd -p $pid --no-header

                pty=/dev/" s -o tty -p $pid --no-header"      
                if [ -w "$pty" ]; then
                        case "$pty" in
                           /dev/pts/[0-9]*)
                                printf "\n$msgheader\n" > "$pty"
                                cat "$msgfile"          > "$pty"
                                printf "\n--\n"                 > "$pty"

                                echo "$prg: msg send to '$pty'"
                                ;;
                           *)
                                echo "$prg: Invalid pty name: '$pty'" >&2
                                ;;
                        esac
                else
                        echo "$prg: '$pty' not writeable" >&2
                fi
        done
echo "using wall ..."
wall "$msgfile"





On Sunday 19 January 2003 04:39 am, Achim Bohnet wrote:
> kwrited code needs to be adapted to the way /var/run/*tmp handling is
> required by the Debian Policy.  The utempter lib used by AFAIR redhat and
> suse was not accepted by debian. There were some discussion long time ago
> on debian-kde. Search the archive.
>
> AFAIR kwrited complained after setgid utmp (debian way to manage u|wtmp).
> gnome-terminal has an extra helper apps. Maybe kwrited could use something
> similar.
>
> Achim



Reply to: