Stop gracefully a kmail client using DCOP - KDE

This is a discussion on Stop gracefully a kmail client using DCOP - KDE ; Hello, everyone: I've been trying to figure this one out for a while and never got it to work. Kmail runs on my box at home and when I'm out I ssh in and use mutt to read mail. The ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Stop gracefully a kmail client using DCOP

  1. Stop gracefully a kmail client using DCOP

    Hello, everyone:
    I've been trying to figure this one out for a while and never got it
    to work.
    Kmail runs on my box at home and when I'm out I ssh in and use mutt to
    read mail. The problem is that if I open mail using mutt the mutt
    client does something to the index files in kmail and when I come back
    home and restart kmail it shows old read messages as unread. It's
    really annoying. However, if I shut down kmail and then use mutt the
    kmail index files will be ok. However, sometimes I forget to shut down
    kmail.
    How do I shut down kmail if I ssh in from a remote host? I can use
    kill but the problem is when you shut down kmail gracefully (using
    File->Quit) it writes to its index files right before it closes down.
    If you kill kmail it will not write to them and that creates a problem
    as I indicated above.
    To solve the problem I have tried to use dcop. So when I try this:
    dcop --user user1 --list-sessions
    I get this back:
    # Active sessions for user /home/user1 :
    # .DCOPserver_myhost__0
    Ok, so to connect to kmail I do this:
    # dcop kmail --session .DCOPserver_myhost__0
    But I get this in return:
    # ERROR: Couldn't attach to DCOP server!

    I'm stuck here. Does anyone know what the problem is and what I can do
    to fix this?
    Thank you for your help in advance.
    Roumen.


  2. Re: Stop gracefully a kmail client using DCOP

    wrote in message
    news:1190749951.007076.175720@o80g2000hse.googlegr oups.com...
    > Hello, everyone:
    > I've been trying to figure this one out for a while and never got it
    > to work.
    > Kmail runs on my box at home and when I'm out I ssh in and use mutt to
    > read mail. The problem is that if I open mail using mutt the mutt
    > client does something to the index files in kmail and when I come back
    > home and restart kmail it shows old read messages as unread. It's
    > really annoying. However, if I shut down kmail and then use mutt the
    > kmail index files will be ok. However, sometimes I forget to shut down
    > kmail.
    > How do I shut down kmail if I ssh in from a remote host? I can use
    > kill but the problem is when you shut down kmail gracefully (using
    > File->Quit) it writes to its index files right before it closes down.
    > If you kill kmail it will not write to them and that creates a problem
    > as I indicated above.
    > To solve the problem I have tried to use dcop. So when I try this:
    > dcop --user user1 --list-sessions
    > I get this back:
    > # Active sessions for user /home/user1 :
    > # .DCOPserver_myhost__0
    > Ok, so to connect to kmail I do this:
    > # dcop kmail --session .DCOPserver_myhost__0
    > But I get this in return:
    > # ERROR: Couldn't attach to DCOP server!
    >
    > I'm stuck here. Does anyone know what the problem is and what I can do
    > to fix this?


    Sorry I can't answer the dcop problem but remember that kill can send any
    signal to a process not just the KILL signal. Therefore you can send a TERM
    signal to kmail which should cause it to shut down gracefully.

    $ kill -TERM

    or

    $ killall kmail
    (killall defaults to the TERM signal according to the man page)

    --
    Geoff



  3. Re: Stop gracefully a kmail client using DCOP

    Hello,

    semovrs@concord.edu wrote:

    > I've been trying to figure this one out for a while and never got it
    > to work.
    > [...]
    > I'm stuck here. Does anyone know what the problem is and what I can do
    > to fix this?
    > Thank you for your help in advance.
    > Roumen.


    Use kdcop to explore the interfaces then you can drag'n drop the entry
    do a shell and get

    dcop kmail MainApplication-Interface quit

    Bernd Strieder


  4. Re: Stop gracefully a kmail client using DCOP

    Geoffrey:
    Thank you for your response. I tried kill -TERM but it kills
    kmail non-gracefully because it obviously won't write to the kmail
    index files - when I reopen kmail it shows emails I have already
    opened as new. I tried killall with the same result.

    Geoffrey Clements wrote:
    > wrote in message
    > news:1190749951.007076.175720@o80g2000hse.googlegr oups.com...
    > > Hello, everyone:
    > > I've been trying to figure this one out for a while and never got it
    > > to work.
    > > Kmail runs on my box at home and when I'm out I ssh in and use mutt to
    > > read mail. The problem is that if I open mail using mutt the mutt
    > > client does something to the index files in kmail and when I come back
    > > home and restart kmail it shows old read messages as unread. It's
    > > really annoying. However, if I shut down kmail and then use mutt the
    > > kmail index files will be ok. However, sometimes I forget to shut down
    > > kmail.
    > > How do I shut down kmail if I ssh in from a remote host? I can use
    > > kill but the problem is when you shut down kmail gracefully (using
    > > File->Quit) it writes to its index files right before it closes down.
    > > If you kill kmail it will not write to them and that creates a problem
    > > as I indicated above.
    > > To solve the problem I have tried to use dcop. So when I try this:
    > > dcop --user user1 --list-sessions
    > > I get this back:
    > > # Active sessions for user /home/user1 :
    > > # .DCOPserver_myhost__0
    > > Ok, so to connect to kmail I do this:
    > > # dcop kmail --session .DCOPserver_myhost__0
    > > But I get this in return:
    > > # ERROR: Couldn't attach to DCOP server!
    > >
    > > I'm stuck here. Does anyone know what the problem is and what I can do
    > > to fix this?

    >
    > Sorry I can't answer the dcop problem but remember that kill can send any
    > signal to a process not just the KILL signal. Therefore you can send a TERM
    > signal to kmail which should cause it to shut down gracefully.
    >
    > $ kill -TERM
    >
    > or
    >
    > $ killall kmail
    > (killall defaults to the TERM signal according to the man page)
    >
    > --
    > Geoff



  5. Re: Stop gracefully a kmail client using DCOP

    Bernd:
    the command you gave me works to kill kmail if it's open in the same
    session as the one that I run the dcop command in, i.e. if I open
    kmail on my desktop at home and then I go somewhere and ssh in and try
    to run this on that ssh session it will not kill kmail. It will return
    the following error instead:
    ERROR: Couldn't attach to DCOP server!
    So as I described in my original there must be a way to "attach" to an
    existing session but I keep getting the "can't attach" error.
    Your advice was certainly helpful though, I'll play with it and see
    what I can do. Let us know if you find anything youself.
    Roumen.

    Bernd Strieder wrote:
    > Hello,
    >
    > semovrs@concord.edu wrote:
    >
    > > I've been trying to figure this one out for a while and never got it
    > > to work.
    > > [...]
    > > I'm stuck here. Does anyone know what the problem is and what I can do
    > > to fix this?
    > > Thank you for your help in advance.
    > > Roumen.

    >
    > Use kdcop to explore the interfaces then you can drag'n drop the entry
    > do a shell and get
    >
    > dcop kmail MainApplication-Interface quit
    >
    > Bernd Strieder



  6. Re: Stop gracefully a kmail client using DCOP

    Hello,

    semovrs@concord.edu wrote:

    > Bernd:
    > the command you gave me works to kill kmail if it's open in the same
    > session as the one that I run the dcop command in, i.e. if I open
    > kmail on my desktop at home and then I go somewhere and ssh in and try
    > to run this on that ssh session it will not kill kmail. It will return
    > the following error instead:
    > ERROR: Couldn't attach to DCOP server!


    Use google with keywords "Attaching DCOP":

    http://lists.kde.org/?l=kde-bindings...7109222250&w=2

    Bernd


+ Reply to Thread