Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Always try to do things in chronological order; it's less confusing that way.


computers / alt.os.linux.mint / Terminate a program from terminal

SubjectAuthor
* Terminate a program from terminalBig Al
+* Re: Terminate a program from terminalBig Al
|`* Re: Terminate a program from terminalPaul
| `* Re: Terminate a program from terminalBig Al
|  `* Re: Terminate a program from terminalPaul
|   `- Re: Terminate a program from terminalBig Al
+- Re: Terminate a program from terminalJohnny
+- Re: Terminate a program from terminalEdmund
`* Re: Terminate a program from terminalArti F. Idiot
 `* Re: Terminate a program from terminalArti F. Idiot
  +- Re: Terminate a program from terminalBig Al
  `* Re: Terminate a program from terminalNic
   `- Re: Terminate a program from terminalBig Al

1
Terminate a program from terminal

<updjh6$1houp$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=7540&group=alt.os.linux.mint#7540

  copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ala...@invalid.com (Big Al)
Newsgroups: alt.os.linux.mint
Subject: Terminate a program from terminal
Date: Wed, 31 Jan 2024 08:55:50 -0500
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <updjh6$1houp$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 31 Jan 2024 13:55:50 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="5fffdf8e616a668490d0581e8d44807b";
logging-data="1631193"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18XAhxUzo+gtgbXi3WFdKHvsGpQCgpZD60="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:/TMee4YfQg5HD8kSYhPMTTw7PCc=
Content-Language: en-US
 by: Big Al - Wed, 31 Jan 2024 13:55 UTC

I want to close a program gracefully, allowing it to save it's settings
properly. Just as if I had done the "X" at the top.

Everything I read seems to imply kill -15 or kill -s TERM will do it.

I'm trying to shutdown Thunderbird during a backup script. When I use
the above, TB opens an messages I have read show back up as unread,
implying to me that it did not shutdown properly.

Anyone up to speed on terminating processes in Linux?
--
Linux Mint 21.2 Cinnamon
Al

Re: Terminate a program from terminal

<updkic$1i4o4$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=7541&group=alt.os.linux.mint#7541

  copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!news.samoylyk.net!newsfeed.xs3.de!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ala...@invalid.com (Big Al)
Newsgroups: alt.os.linux.mint
Subject: Re: Terminate a program from terminal
Date: Wed, 31 Jan 2024 09:13:32 -0500
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <updkic$1i4o4$1@dont-email.me>
References: <updjh6$1houp$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 31 Jan 2024 14:13:32 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="5fffdf8e616a668490d0581e8d44807b";
logging-data="1643268"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19rSJnxVv/UQB/H4t0xaBXV4U+Xn/G+hwY="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:PrnugDg2dfX83JPYvqyfuOLJRJo=
Content-Language: en-US
In-Reply-To: <updjh6$1houp$1@dont-email.me>
 by: Big Al - Wed, 31 Jan 2024 14:13 UTC

On 1/31/24 08:55 AM, Big Al wrote:
> I want to close a program gracefully, allowing it to save it's settings
> properly.   Just as if I had done the "X" at the top.
>
> Everything I read seems to imply kill -15 or kill -s TERM will do it.
>
> I'm trying to shutdown Thunderbird during a backup script.  When I use
> the above, TB opens an messages I have read show back up as unread,
> implying to me that it did not shutdown properly.
>
> Anyone up to speed on terminating processes in Linux?
I even found using pidof command to produce a list of all pids of
thunderbird since there are a few child processes running.
"ps -ef | grep thunderbird" returns 4 processes.
"pidof thunderbird" also returns those 4 processes.

So killing them one at a time should be more graceful than just killing
the main process.
"for PID in $(pidof thunderbird); do kill -15 $PID; done"

The nice part of pidof command is that it lists the PIDs in high to low
order meaning you kill the main process last.

However doing the kill -15 or TERM signal does not close TB and save
states. I can mark an entire newsgroup read and then run the commands
above and when I restart TB the newsgroup is not read.

Maybe this isn't possible but it sure would be nice if it was.

--
Linux Mint 21.2 Cinnamon
Al

Re: Terminate a program from terminal

<20240131082108.106d3c86@Johnny>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=7542&group=alt.os.linux.mint#7542

  copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: joh...@invalid.net (Johnny)
Newsgroups: alt.os.linux.mint
Subject: Re: Terminate a program from terminal
Date: Wed, 31 Jan 2024 08:21:08 -0600
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <20240131082108.106d3c86@Johnny>
References: <updjh6$1houp$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="b61713509c3d9fa12e836a3d3032d6bf";
logging-data="1642482"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18GtVgpCGhp3nHY+IvmAZz+"
Cancel-Lock: sha1:KKOIBJ5I71JroTM0uX7B2Ea8eIM=
X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu)
 by: Johnny - Wed, 31 Jan 2024 14:21 UTC

On Wed, 31 Jan 2024 08:55:50 -0500
Big Al <alan@invalid.com> wrote:

> I want to close a program gracefully, allowing it to save it's
> settings properly. Just as if I had done the "X" at the top.
>
> Everything I read seems to imply kill -15 or kill -s TERM will do
> it.
>
> I'm trying to shutdown Thunderbird during a backup script. When I
> use the above, TB opens an messages I have read show back up as
> unread, implying to me that it did not shutdown properly.
>
> Anyone up to speed on terminating processes in Linux?

I use xkill. I don't know if it shuts down gracefully, but I don't
care.

https://www.geeksforgeeks.org/how-to-kill-processes-on-the-linux-desktop-with-xkill/

Re: Terminate a program from terminal

<updp30$1j0m7$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=7543&group=alt.os.linux.mint#7543

  copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nos...@needed.invalid (Paul)
Newsgroups: alt.os.linux.mint
Subject: Re: Terminate a program from terminal
Date: Wed, 31 Jan 2024 10:30:39 -0500
Organization: A noiseless patient Spider
Lines: 65
Message-ID: <updp30$1j0m7$1@dont-email.me>
References: <updjh6$1houp$1@dont-email.me> <updkic$1i4o4$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 31 Jan 2024 15:30:40 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2b3f26c427b9d2606f2120f5698f10e0";
logging-data="1671879"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19fq6tJB6JwlrI35hxTQrrrUH2METAMPI4="
User-Agent: Ratcatcher/2.0.0.25 (Windows/20130802)
Cancel-Lock: sha1:K6n0IubKd4ej0FnCjmdpvk09bPI=
Content-Language: en-US
In-Reply-To: <updkic$1i4o4$1@dont-email.me>
 by: Paul - Wed, 31 Jan 2024 15:30 UTC

On 1/31/2024 9:13 AM, Big Al wrote:
> On 1/31/24 08:55 AM, Big Al wrote:
>> I want to close a program gracefully, allowing it to save it's settings properly.   Just as if I had done the "X" at the top.
>>
>> Everything I read seems to imply kill -15 or kill -s TERM will do it.
>>
>> I'm trying to shutdown Thunderbird during a backup script.  When I use the above, TB opens an messages I have read show back up as unread, implying to me that it did not shutdown properly.
>>
>> Anyone up to speed on terminating processes in Linux?
> I even found using pidof command to produce a list of all pids of thunderbird since there are a few child processes running.
> "ps -ef | grep thunderbird" returns 4 processes.
> "pidof thunderbird" also returns those 4 processes.
>
> So killing them one at a time should be more graceful than just killing the main process.
> "for PID in $(pidof thunderbird); do kill -15 $PID; done"
>
> The nice part of pidof command is that it lists the PIDs in high to low order meaning you kill the main process last.
>
> However doing the kill -15 or TERM signal does not close TB and save states.   I can mark an entire newsgroup read and then run the commands above and when I restart TB the newsgroup is not read.
>
> Maybe this isn't possible but it sure would be nice if it was.
>

ps -ef | grep thunder | grep -v grep # Just to isolate to the three processes.
# The output doesn't look exactly like this. This has been edited.

UID PID PPID C STIME TTY TIME CMD
bullwin+ 1802 1496 3 09:38 ? 00:01:07 /usr/lib/thunderbird/thunderbird
bullwin+ 2020 1802 0 09:39 ? 00:00:01 /usr/lib/thunderbird/thunderbird -contentproc -childID 1 -isForBrowser ...
bullwin+ 2076 1802 0 09:39 ? 00:00:00 /usr/lib/thunderbird/thunderbird -contentproc -childID 2 -isForBrowser ...

I would think sending the signal to the PPID (1802) would be better organized.

The things based off Quantum, are a mottley lot, with some of the
sandbox-like children restarting if they receive various signals.
So like starfish, "whacking at the legs is useless" :-)

"The most commonly used signals are as follows.

Signal Name Signal Value Effect
----------- ------------ ------
SIGHUP 1 Hangup, reload a process
SIGINT 2 Interrupt from keyboard
SIGKILL 9 Kill a process
SIGTERM 15 Terminate a process gracefully
SIGSTOP 17, 19, 23 Stop a process

The SIGKILL and SIGSTOP signals cannot be caught, blocked, or ignored,
while the SIGTERM signal can be caught or ignored. That is why we can
use SIGKILL in Linux when SIGTERM fails to stop or end the process.
"

kill -15 1802

Doing that is still not exactly the same as clicking the "X".
A registered signal handler in the program can catch that and
do a graceful shutdown. Clicking the "X" does not have to
go through the exact same path if they want (some programs
do their own decorations, especially if run on multiple platforms
and wishing to fake the same graphical interface elements, everywhere).
Firefox has been known to do clever things, so anything is possible.

Paul

Re: Terminate a program from terminal

<upe0ek$1k3g8$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=7546&group=alt.os.linux.mint#7546

  copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ala...@invalid.com (Big Al)
Newsgroups: alt.os.linux.mint
Subject: Re: Terminate a program from terminal
Date: Wed, 31 Jan 2024 12:36:20 -0500
Organization: A noiseless patient Spider
Lines: 75
Message-ID: <upe0ek$1k3g8$1@dont-email.me>
References: <updjh6$1houp$1@dont-email.me> <updkic$1i4o4$1@dont-email.me>
<updp30$1j0m7$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 31 Jan 2024 17:36:20 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="afcfc1bc17867ab153ffcd6d2173d483";
logging-data="1707528"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX181j6zEiMzjWWKJSfTGoOS8nclS9WwS8X0="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:vcHvM8DcyTG/2XELIpUE5icmL7U=
In-Reply-To: <updp30$1j0m7$1@dont-email.me>
Content-Language: en-US
 by: Big Al - Wed, 31 Jan 2024 17:36 UTC

On 1/31/24 10:30 AM, Paul wrote:
> On 1/31/2024 9:13 AM, Big Al wrote:
>> On 1/31/24 08:55 AM, Big Al wrote:
>>> I want to close a program gracefully, allowing it to save it's settings properly.   Just as if I had done the "X" at the top.
>>>
>>> Everything I read seems to imply kill -15 or kill -s TERM will do it.
>>>
>>> I'm trying to shutdown Thunderbird during a backup script.  When I use the above, TB opens an messages I have read show back up as unread, implying to me that it did not shutdown properly.
>>>
>>> Anyone up to speed on terminating processes in Linux?
>> I even found using pidof command to produce a list of all pids of thunderbird since there are a few child processes running.
>> "ps -ef | grep thunderbird" returns 4 processes.
>> "pidof thunderbird" also returns those 4 processes.
>>
>> So killing them one at a time should be more graceful than just killing the main process.
>> "for PID in $(pidof thunderbird); do kill -15 $PID; done"
>>
>> The nice part of pidof command is that it lists the PIDs in high to low order meaning you kill the main process last.
>>
>> However doing the kill -15 or TERM signal does not close TB and save states.   I can mark an entire newsgroup read and then run the commands above and when I restart TB the newsgroup is not read.
>>
>> Maybe this isn't possible but it sure would be nice if it was.
>>
>
> ps -ef | grep thunder | grep -v grep # Just to isolate to the three processes.
> # The output doesn't look exactly like this. This has been edited.
>
> UID PID PPID C STIME TTY TIME CMD
> bullwin+ 1802 1496 3 09:38 ? 00:01:07 /usr/lib/thunderbird/thunderbird
> bullwin+ 2020 1802 0 09:39 ? 00:00:01 /usr/lib/thunderbird/thunderbird -contentproc -childID 1 -isForBrowser ...
> bullwin+ 2076 1802 0 09:39 ? 00:00:00 /usr/lib/thunderbird/thunderbird -contentproc -childID 2 -isForBrowser ...
>
> I would think sending the signal to the PPID (1802) would be better organized.
>
> The things based off Quantum, are a mottley lot, with some of the
> sandbox-like children restarting if they receive various signals.
> So like starfish, "whacking at the legs is useless" :-)
>
> "The most commonly used signals are as follows.
>
> Signal Name Signal Value Effect
> ----------- ------------ ------
> SIGHUP 1 Hangup, reload a process
> SIGINT 2 Interrupt from keyboard
> SIGKILL 9 Kill a process
> SIGTERM 15 Terminate a process gracefully
> SIGSTOP 17, 19, 23 Stop a process
>
> The SIGKILL and SIGSTOP signals cannot be caught, blocked, or ignored,
> while the SIGTERM signal can be caught or ignored. That is why we can
> use SIGKILL in Linux when SIGTERM fails to stop or end the process.
> "
>
> kill -15 1802
>
> Doing that is still not exactly the same as clicking the "X".
> A registered signal handler in the program can catch that and
> do a graceful shutdown. Clicking the "X" does not have to
> go through the exact same path if they want (some programs
> do their own decorations, especially if run on multiple platforms
> and wishing to fake the same graphical interface elements, everywhere).
> Firefox has been known to do clever things, so anything is possible.
>
> Paul
>
>
Your kill -15 does the job but I suppose it's in the TB code to not
close everything up properly. That's what I'm doing and it works, but
not exactly right.

I could try submitting a bug, but you know how fast that will be fixed.
--
Linux Mint 21.2 Cinnamon
Al

Re: Terminate a program from terminal

<upe4qs$1l2if$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=7547&group=alt.os.linux.mint#7547

  copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nom...@hotmail.com (Edmund)
Newsgroups: alt.os.linux.mint
Subject: Re: Terminate a program from terminal
Date: Wed, 31 Jan 2024 19:51:04 +0100
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <upe4qs$1l2if$1@dont-email.me>
References: <updjh6$1houp$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 31 Jan 2024 18:51:08 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="50703e6e4ae53ea16f42e857e44847ea";
logging-data="1739343"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19UJ8zIXBBwFn+zLMDTpSdb"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:08HMOV9QFh0fnqVrQhSTVD5+1w4=
Content-Language: en-US
In-Reply-To: <updjh6$1houp$1@dont-email.me>
 by: Edmund - Wed, 31 Jan 2024 18:51 UTC

On 1/31/24 14:55, Big Al wrote:
> I want to close a program gracefully, allowing it to save it's settings
> properly.   Just as if I had done the "X" at the top.
>
> Everything I read seems to imply kill -15 or kill -s TERM will do it.
>
> I'm trying to shutdown Thunderbird during a backup script.  When I use
> the above, TB opens an messages I have read show back up as unread,
> implying to me that it did not shutdown properly.
>
> Anyone up to speed on terminating processes in Linux?

"Xkill"

You can make a custom key-combi for it.

ps aux find the program and kill that nr.

--
-------------

The moment any organization established from pure noble intentions get
some influence, it will be corrupted from both inside and outside.
Then we have organizations established from pure evil.

Edmund

Re: Terminate a program from terminal

<upecqg$62s$1@nnrp.usenet.blueworldhosting.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=7548&group=alt.os.linux.mint#7548

  copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!nnrp.usenet.blueworldhosting.com!.POSTED!not-for-mail
From: add...@is.invalid (Arti F. Idiot)
Newsgroups: alt.os.linux.mint
Subject: Re: Terminate a program from terminal
Date: Wed, 31 Jan 2024 14:07:28 -0700
Organization: Anarchists of America
Message-ID: <upecqg$62s$1@nnrp.usenet.blueworldhosting.com>
References: <updjh6$1houp$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 31 Jan 2024 21:07:29 -0000 (UTC)
Injection-Info: nnrp.usenet.blueworldhosting.com;
logging-data="6236"; mail-complaints-to="usenet@blueworldhosting.com"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:5QZtzlUT4p8cdgv1w90d9z9ErTU= sha256:BYGw2lSOwh2HGH5+8hIUNn0hhVDQlLXzDtLjUiczhRc=
sha1:ZA7i5+SlLCWdE6oPzQ487YgtUhQ= sha256:v5akjEjZCqvi5Evh09QMNKWbs0bI0PxN27FN+hiD3V8=
Content-Language: en-US
In-Reply-To: <updjh6$1houp$1@dont-email.me>
 by: Arti F. Idiot - Wed, 31 Jan 2024 21:07 UTC

On 1/31/24 6:55 AM, Big Al wrote:
> I want to close a program gracefully, allowing it to save it's settings
> properly.   Just as if I had done the "X" at the top.
>
> Everything I read seems to imply kill -15 or kill -s TERM will do it.
>
> I'm trying to shutdown Thunderbird during a backup script.  When I use
> the above, TB opens an messages I have read show back up as unread,
> implying to me that it did not shutdown properly.

I was curious about this too. I did come across some Visual-Basic code
for finding child windows/processes and killing them but it was for
Win64. Running 'thunderbird -h' shows some options for enabling remote
control via either '--marionette' or '--remote-allow-hosts <hosts>';
perhaps there are some examples on some of the Mozilla sites. I think
if you could force either an acct re-sync or a switch to offline mode
that may then allow a clean(er) shutdown via kill(1).

Re: Terminate a program from terminal

<upegbn$lb6$1@nnrp.usenet.blueworldhosting.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=7549&group=alt.os.linux.mint#7549

  copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!rocksolid2!news.neodome.net!tncsrv06.tnetconsulting.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!nnrp.usenet.blueworldhosting.com!.POSTED!not-for-mail
From: add...@is.invalid (Arti F. Idiot)
Newsgroups: alt.os.linux.mint
Subject: Re: Terminate a program from terminal
Date: Wed, 31 Jan 2024 15:07:51 -0700
Organization: Anarchists of America
Message-ID: <upegbn$lb6$1@nnrp.usenet.blueworldhosting.com>
References: <updjh6$1houp$1@dont-email.me>
<upecqg$62s$1@nnrp.usenet.blueworldhosting.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 31 Jan 2024 22:07:51 -0000 (UTC)
Injection-Info: nnrp.usenet.blueworldhosting.com;
logging-data="21862"; mail-complaints-to="usenet@blueworldhosting.com"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:EvuPBrmleksQj5QK9u8RasUK7w4= sha256:J8vCvyFhZ9RYzS1cIwQap0yw8E56oXvNiMumhdqEk/A=
sha1:je8WGkxnroKtjHgjhufxGOFS22Y= sha256:/rpooFqxbfqkRL1iMtbfi/woVni/6e0sFppke6uj8mw=
In-Reply-To: <upecqg$62s$1@nnrp.usenet.blueworldhosting.com>
Content-Language: en-US
 by: Arti F. Idiot - Wed, 31 Jan 2024 22:07 UTC

On 1/31/24 2:07 PM, Arti F. Idiot wrote:
> On 1/31/24 6:55 AM, Big Al wrote:
>> I want to close a program gracefully, allowing it to save it's
>> settings properly.   Just as if I had done the "X" at the top.
>>
>> Everything I read seems to imply kill -15 or kill -s TERM will do it.
>>
>> I'm trying to shutdown Thunderbird during a backup script.  When I use
>> the above, TB opens an messages I have read show back up as unread,
>> implying to me that it did not shutdown properly.
>
> I was curious about this too.  I did come across some Visual-Basic code
> for finding child windows/processes and killing them but it was for
> Win64.  Running 'thunderbird -h' shows some options for enabling remote
> control via either '--marionette' or '--remote-allow-hosts <hosts>';
> perhaps there are some examples on some of the Mozilla sites.  I think
> if you could force either an acct re-sync or a switch to offline mode
> that may then allow a clean(er) shutdown via kill(1).

A possible solution: install the xdotools package then run

$ xdotool search --onlyvisible --name thunderbird key ctrl+q

Running 'xdotools search --name thunderbird' a second time doesn't list
any leftover windows so perhaps the running of CTRL+Q (same as File >>
Quit) in the main visible window is doing a clean shutdown? If you are
wanting to do this remotely, ie. ssh into host and shut down TB, you
might need to specify a desktop # or similar.

Re: Terminate a program from terminal

<upehuh$1ncjq$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=7550&group=alt.os.linux.mint#7550

  copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nos...@needed.invalid (Paul)
Newsgroups: alt.os.linux.mint
Subject: Re: Terminate a program from terminal
Date: Wed, 31 Jan 2024 17:34:57 -0500
Organization: A noiseless patient Spider
Lines: 82
Message-ID: <upehuh$1ncjq$1@dont-email.me>
References: <updjh6$1houp$1@dont-email.me> <updkic$1i4o4$1@dont-email.me>
<updp30$1j0m7$1@dont-email.me> <upe0ek$1k3g8$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 31 Jan 2024 22:34:58 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2b3f26c427b9d2606f2120f5698f10e0";
logging-data="1815162"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Zoq1zdk46LstuLOnTZv792PoW7JxmLgc="
User-Agent: Ratcatcher/2.0.0.25 (Windows/20130802)
Cancel-Lock: sha1:ZqhnrVEx/1PstXThylOcUiaF9xc=
In-Reply-To: <upe0ek$1k3g8$1@dont-email.me>
Content-Language: en-US
 by: Paul - Wed, 31 Jan 2024 22:34 UTC

On 1/31/2024 12:36 PM, Big Al wrote:
> On 1/31/24 10:30 AM, Paul wrote:
>> On 1/31/2024 9:13 AM, Big Al wrote:
>>> On 1/31/24 08:55 AM, Big Al wrote:
>>>> I want to close a program gracefully, allowing it to save it's settings properly.   Just as if I had done the "X" at the top.
>>>>
>>>> Everything I read seems to imply kill -15 or kill -s TERM will do it.
>>>>
>>>> I'm trying to shutdown Thunderbird during a backup script.  When I use the above, TB opens an messages I have read show back up as unread, implying to me that it did not shutdown properly.
>>>>
>>>> Anyone up to speed on terminating processes in Linux?
>>> I even found using pidof command to produce a list of all pids of thunderbird since there are a few child processes running.
>>> "ps -ef | grep thunderbird" returns 4 processes.
>>> "pidof thunderbird" also returns those 4 processes.
>>>
>>> So killing them one at a time should be more graceful than just killing the main process.
>>> "for PID in $(pidof thunderbird); do kill -15 $PID; done"
>>>
>>> The nice part of pidof command is that it lists the PIDs in high to low order meaning you kill the main process last.
>>>
>>> However doing the kill -15 or TERM signal does not close TB and save states.   I can mark an entire newsgroup read and then run the commands above and when I restart TB the newsgroup is not read.
>>>
>>> Maybe this isn't possible but it sure would be nice if it was.
>>>
>>
>> ps -ef | grep thunder | grep -v grep     # Just to isolate to the three processes.
>>                                           # The output doesn't look exactly like this. This has been edited.
>>
>> UID             PID    PPID  C STIME TTY      TIME     CMD
>> bullwin+       1802    1496  3 09:38 ?        00:01:07 /usr/lib/thunderbird/thunderbird
>>     bullwin+    2020    1802  0 09:39 ?        00:00:01 /usr/lib/thunderbird/thunderbird -contentproc -childID 1 -isForBrowser ...
>>     bullwin+    2076    1802  0 09:39 ?        00:00:00 /usr/lib/thunderbird/thunderbird -contentproc -childID 2 -isForBrowser ...
>>
>> I would think sending the signal to the PPID (1802) would be better organized.
>>
>> The things based off Quantum, are a mottley lot, with some of the
>> sandbox-like children restarting if they receive various signals.
>> So like starfish, "whacking at the legs is useless" :-)
>>
>>    "The most commonly used signals are as follows.
>>
>>     Signal Name  Signal Value   Effect
>>     -----------  ------------   ------
>>     SIGHUP        1             Hangup, reload a process
>>     SIGINT        2             Interrupt from keyboard
>>     SIGKILL       9             Kill a process
>>     SIGTERM      15             Terminate a process gracefully
>>     SIGSTOP      17, 19, 23     Stop a process
>>
>>     The SIGKILL and SIGSTOP signals cannot be caught, blocked, or ignored,
>>     while the SIGTERM signal can be caught or ignored. That is why we can
>>     use SIGKILL in Linux when SIGTERM fails to stop or end the process.
>>    "
>>
>> kill -15 1802
>>
>> Doing that is still not exactly the same as clicking the "X".
>> A registered signal handler in the program can catch that and
>> do a graceful shutdown. Clicking the "X" does not have to
>> go through the exact same path if they want (some programs
>> do their own decorations, especially if run on multiple platforms
>> and wishing to fake the same graphical interface elements, everywhere).
>> Firefox has been known to do clever things, so anything is possible.
>>
>>     Paul
>>
>>
> Your kill -15 does the job but I suppose it's in the TB code to not close everything up properly.  That's what I'm doing and it works, but not exactly right.
>
> I could try submitting a bug, but you know how fast that will be fixed.

I checked with "xprop" and the three pane view of Thunderbird is
owned by the Parent PID.

Maybe my mistake is suggesting -15.

kill -15 <ppid value>

kill -2 <ppid value> # SIGINT, equivalent to control-C in the shell

Paul

Re: Terminate a program from terminal

<upei13$1nc2o$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=7551&group=alt.os.linux.mint#7551

  copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ala...@invalid.com (Big Al)
Newsgroups: alt.os.linux.mint
Subject: Re: Terminate a program from terminal
Date: Wed, 31 Jan 2024 17:36:19 -0500
Organization: A noiseless patient Spider
Lines: 41
Message-ID: <upei13$1nc2o$1@dont-email.me>
References: <updjh6$1houp$1@dont-email.me>
<upecqg$62s$1@nnrp.usenet.blueworldhosting.com>
<upegbn$lb6$1@nnrp.usenet.blueworldhosting.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 31 Jan 2024 22:36:19 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d19dcafc7398fcc7772e24cce021ba43";
logging-data="1814616"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+OPgJcQQCrTTlY97kW5g8xxtnQDcrnGeA="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:np0DpDfjFdApmSL2IISdRb8WmdI=
Content-Language: en-US
In-Reply-To: <upegbn$lb6$1@nnrp.usenet.blueworldhosting.com>
 by: Big Al - Wed, 31 Jan 2024 22:36 UTC

On 1/31/24 05:07 PM, Arti F. Idiot wrote:
> On 1/31/24 2:07 PM, Arti F. Idiot wrote:
>> On 1/31/24 6:55 AM, Big Al wrote:
>>> I want to close a program gracefully, allowing it to save it's
>>> settings properly.   Just as if I had done the "X" at the top.
>>>
>>> Everything I read seems to imply kill -15 or kill -s TERM will do it.
>>>
>>> I'm trying to shutdown Thunderbird during a backup script.  When I
>>> use the above, TB opens an messages I have read show back up as
>>> unread, implying to me that it did not shutdown properly.
>>
>> I was curious about this too.  I did come across some Visual-Basic
>> code for finding child windows/processes and killing them but it was
>> for Win64.  Running 'thunderbird -h' shows some options for enabling
>> remote control via either '--marionette' or '--remote-allow-hosts
>> <hosts>'; perhaps there are some examples on some of the Mozilla
>> sites.  I think if you could force either an acct re-sync or a switch
>> to offline mode that may then allow a clean(er) shutdown via kill(1).
>
> A possible solution:  install the xdotools package then run
>
> $ xdotool search --onlyvisible --name thunderbird key ctrl+q
>
> Running 'xdotools search --name thunderbird' a second time doesn't list
> any leftover windows so perhaps the running of CTRL+Q (same as File >>
> Quit) in the main visible window is doing a clean shutdown?  If you are
> wanting to do this remotely, ie. ssh into host and shut down TB, you
> might need to specify a desktop # or similar.

Seems to work:
xdotool search --onlyvisible --name thunderbird key ctrl+q

I marked the entire alt.os.linux.mint group as read and sure nuf, it
opened back up with the group read. This may be my answer. More
testing to come.
Thanks.
--
Linux Mint 21.2 Cinnamon
Al

Re: Terminate a program from terminal

<upeicp$1ndnb$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=7552&group=alt.os.linux.mint#7552

  copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!paganini.bofh.team!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ala...@invalid.com (Big Al)
Newsgroups: alt.os.linux.mint
Subject: Re: Terminate a program from terminal
Date: Wed, 31 Jan 2024 17:42:33 -0500
Organization: A noiseless patient Spider
Lines: 89
Message-ID: <upeicp$1ndnb$1@dont-email.me>
References: <updjh6$1houp$1@dont-email.me> <updkic$1i4o4$1@dont-email.me>
<updp30$1j0m7$1@dont-email.me> <upe0ek$1k3g8$1@dont-email.me>
<upehuh$1ncjq$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 31 Jan 2024 22:42:34 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d19dcafc7398fcc7772e24cce021ba43";
logging-data="1816299"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19jOvooZaU38zrEV7mhj0vPwLCdYuX8QhI="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:I/NtZ+wob6QD27ZKNYCgUEjdDxU=
In-Reply-To: <upehuh$1ncjq$1@dont-email.me>
Content-Language: en-US
 by: Big Al - Wed, 31 Jan 2024 22:42 UTC

On 1/31/24 05:34 PM, Paul wrote:
> On 1/31/2024 12:36 PM, Big Al wrote:
>> On 1/31/24 10:30 AM, Paul wrote:
>>> On 1/31/2024 9:13 AM, Big Al wrote:
>>>> On 1/31/24 08:55 AM, Big Al wrote:
>>>>> I want to close a program gracefully, allowing it to save it's settings properly.   Just as if I had done the "X" at the top.
>>>>>
>>>>> Everything I read seems to imply kill -15 or kill -s TERM will do it.
>>>>>
>>>>> I'm trying to shutdown Thunderbird during a backup script.  When I use the above, TB opens an messages I have read show back up as unread, implying to me that it did not shutdown properly.
>>>>>
>>>>> Anyone up to speed on terminating processes in Linux?
>>>> I even found using pidof command to produce a list of all pids of thunderbird since there are a few child processes running.
>>>> "ps -ef | grep thunderbird" returns 4 processes.
>>>> "pidof thunderbird" also returns those 4 processes.
>>>>
>>>> So killing them one at a time should be more graceful than just killing the main process.
>>>> "for PID in $(pidof thunderbird); do kill -15 $PID; done"
>>>>
>>>> The nice part of pidof command is that it lists the PIDs in high to low order meaning you kill the main process last.
>>>>
>>>> However doing the kill -15 or TERM signal does not close TB and save states.   I can mark an entire newsgroup read and then run the commands above and when I restart TB the newsgroup is not read.
>>>>
>>>> Maybe this isn't possible but it sure would be nice if it was.
>>>>
>>>
>>> ps -ef | grep thunder | grep -v grep     # Just to isolate to the three processes.
>>>                                           # The output doesn't look exactly like this. This has been edited.
>>>
>>> UID             PID    PPID  C STIME TTY      TIME     CMD
>>> bullwin+       1802    1496  3 09:38 ?        00:01:07 /usr/lib/thunderbird/thunderbird
>>>     bullwin+    2020    1802  0 09:39 ?        00:00:01 /usr/lib/thunderbird/thunderbird -contentproc -childID 1 -isForBrowser ...
>>>     bullwin+    2076    1802  0 09:39 ?        00:00:00 /usr/lib/thunderbird/thunderbird -contentproc -childID 2 -isForBrowser ...
>>>
>>> I would think sending the signal to the PPID (1802) would be better organized.
>>>
>>> The things based off Quantum, are a mottley lot, with some of the
>>> sandbox-like children restarting if they receive various signals.
>>> So like starfish, "whacking at the legs is useless" :-)
>>>
>>>    "The most commonly used signals are as follows.
>>>
>>>     Signal Name  Signal Value   Effect
>>>     -----------  ------------   ------
>>>     SIGHUP        1             Hangup, reload a process
>>>     SIGINT        2             Interrupt from keyboard
>>>     SIGKILL       9             Kill a process
>>>     SIGTERM      15             Terminate a process gracefully
>>>     SIGSTOP      17, 19, 23     Stop a process
>>>
>>>     The SIGKILL and SIGSTOP signals cannot be caught, blocked, or ignored,
>>>     while the SIGTERM signal can be caught or ignored. That is why we can
>>>     use SIGKILL in Linux when SIGTERM fails to stop or end the process.
>>>    "
>>>
>>> kill -15 1802
>>>
>>> Doing that is still not exactly the same as clicking the "X".
>>> A registered signal handler in the program can catch that and
>>> do a graceful shutdown. Clicking the "X" does not have to
>>> go through the exact same path if they want (some programs
>>> do their own decorations, especially if run on multiple platforms
>>> and wishing to fake the same graphical interface elements, everywhere).
>>> Firefox has been known to do clever things, so anything is possible.
>>>
>>>     Paul
>>>
>>>
>> Your kill -15 does the job but I suppose it's in the TB code to not close everything up properly.  That's what I'm doing and it works, but not exactly right.
>>
>> I could try submitting a bug, but you know how fast that will be fixed.
>
> I checked with "xprop" and the three pane view of Thunderbird is
> owned by the Parent PID.
>
> Maybe my mistake is suggesting -15.
>
> kill -15 <ppid value>
>
> kill -2 <ppid value> # SIGINT, equivalent to control-C in the shell
>
> Paul
>
-2 Didn't save status of marked messages.
Arti F. Idiot came up with what looks like a way with xdotool.
--
Linux Mint 21.2 Cinnamon
Al

Re: Terminate a program from terminal

<CoAuN.139678$taff.137839@fx41.iad>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=7553&group=alt.os.linux.mint#7553

  copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!news.nntp4.net!newsfeed.hasname.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx41.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Reply-To: Nic@none.invalid
Subject: Re: Terminate a program from terminal
Newsgroups: alt.os.linux.mint
References: <updjh6$1houp$1@dont-email.me>
<upecqg$62s$1@nnrp.usenet.blueworldhosting.com>
<upegbn$lb6$1@nnrp.usenet.blueworldhosting.com>
Content-Language: en-US
From: Nic...@none.invalid (Nic)
Organization: Arm Chair Observer
In-Reply-To: <upegbn$lb6$1@nnrp.usenet.blueworldhosting.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 30
Message-ID: <CoAuN.139678$taff.137839@fx41.iad>
X-Complaints-To: abuse(at)newshosting.com
NNTP-Posting-Date: Wed, 31 Jan 2024 23:07:14 UTC
Date: Wed, 31 Jan 2024 18:07:13 -0500
X-Received-Bytes: 2481
 by: Nic - Wed, 31 Jan 2024 23:07 UTC

On 1/31/24 5:07 PM, Arti F. Idiot wrote:
> On 1/31/24 2:07 PM, Arti F. Idiot wrote:
>> On 1/31/24 6:55 AM, Big Al wrote:
>>> I want to close a program gracefully, allowing it to save it's
>>> settings properly.   Just as if I had done the "X" at the top.
>>>
>>> Everything I read seems to imply kill -15 or kill -s TERM will do it.
>>>
>>> I'm trying to shutdown Thunderbird during a backup script. When I
>>> use the above, TB opens an messages I have read show back up as
>>> unread, implying to me that it did not shutdown properly.
>>
>> I was curious about this too.  I did come across some Visual-Basic
>> code for finding child windows/processes and killing them but it was
>> for Win64.  Running 'thunderbird -h' shows some options for enabling
>> remote control via either '--marionette' or '--remote-allow-hosts
>> <hosts>'; perhaps there are some examples on some of the Mozilla
>> sites.  I think if you could force either an acct re-sync or a switch
>> to offline mode that may then allow a clean(er) shutdown via kill(1).
>
> A possible solution:  install the xdotools package then run
>
> $ xdotool search --onlyvisible --name thunderbird key ctrl+q
>
> Running 'xdotools search --name thunderbird' a second time doesn't
> list any leftover windows so perhaps the running of CTRL+Q (same as
> File >> Quit) in the main visible window is doing a clean shutdown? 
> If you are wanting to do this remotely, ie. ssh into host and shut
> down TB, you might need to specify a desktop # or similar.
Ctl+Q It shuts down TB in an instant, and I don't have xdotool installed.

Re: Terminate a program from terminal

<upek2m$1njh1$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=7556&group=alt.os.linux.mint#7556

  copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ala...@invalid.com (Big Al)
Newsgroups: alt.os.linux.mint
Subject: Re: Terminate a program from terminal
Date: Wed, 31 Jan 2024 18:11:18 -0500
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <upek2m$1njh1$1@dont-email.me>
References: <updjh6$1houp$1@dont-email.me>
<upecqg$62s$1@nnrp.usenet.blueworldhosting.com>
<upegbn$lb6$1@nnrp.usenet.blueworldhosting.com>
<CoAuN.139678$taff.137839@fx41.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 31 Jan 2024 23:11:19 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="7175c76ef4e498173ad44e09e1a80c8d";
logging-data="1822241"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+m3qjd3KI5dWpguAo+IHO5cbyBW3UvlyY="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:gRCjtGpk+A9bRfBCYVZHqbrwclU=
In-Reply-To: <CoAuN.139678$taff.137839@fx41.iad>
Content-Language: en-US
 by: Big Al - Wed, 31 Jan 2024 23:11 UTC

On 1/31/24 06:07 PM, Nic wrote:
> On 1/31/24 5:07 PM, Arti F. Idiot wrote:
>> On 1/31/24 2:07 PM, Arti F. Idiot wrote:
>>> On 1/31/24 6:55 AM, Big Al wrote:
>>>> I want to close a program gracefully, allowing it to save it's
>>>> settings properly.   Just as if I had done the "X" at the top.
>>>>
>>>> Everything I read seems to imply kill -15 or kill -s TERM will do it.
>>>>
>>>> I'm trying to shutdown Thunderbird during a backup script. When I
>>>> use the above, TB opens an messages I have read show back up as
>>>> unread, implying to me that it did not shutdown properly.
>>>
>>> I was curious about this too.  I did come across some Visual-Basic
>>> code for finding child windows/processes and killing them but it was
>>> for Win64.  Running 'thunderbird -h' shows some options for enabling
>>> remote control via either '--marionette' or '--remote-allow-hosts
>>> <hosts>'; perhaps there are some examples on some of the Mozilla
>>> sites.  I think if you could force either an acct re-sync or a switch
>>> to offline mode that may then allow a clean(er) shutdown via kill(1).
>>
>> A possible solution:  install the xdotools package then run
>>
>> $ xdotool search --onlyvisible --name thunderbird key ctrl+q
>>
>> Running 'xdotools search --name thunderbird' a second time doesn't
>> list any leftover windows so perhaps the running of CTRL+Q (same as
>> File >> Quit) in the main visible window is doing a clean shutdown? If
>> you are wanting to do this remotely, ie. ssh into host and shut down
>> TB, you might need to specify a desktop # or similar.
> Ctl+Q It shuts down TB in an instant, and I don't have xdotool installed.
I need to do it in a shell script. xdotool if I read it right, will
simulate those keystrokes, giving me a way to exit the program from my
shell script.
--
Linux Mint 21.2 Cinnamon
Al

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor