Restart Perl Application upon KDE Restart

J

Josef Moellers

Under KDE, certain applications register with ksmserver to be restarted
at the next startup, e.g. when I exit without closing firefox,
thunderbird, kate, they are all restarted (more or less successful) when
I relogin.

They are remembered in ~/.kde/share/config/ksmserverrc

Is there a way (e.g. using Net::DBus) to have a perl script restarted? I
doubt that I can just edit ~/.kde/share/config/ksmserverrc.

Thanks,

Josef
 
G

George Mpouras

define you script here

/etc/rc.local

or better converted to linux service

vi /etc/init.d/myscript
sub stop {...}
sub start {...}
sub status {...}
sub reload {...}
sysv-rc-conf --level 345 myscript on
 
G

George Mpouras

you could also start your script like

nohup /usr/local/myscript.pl 2> /var/log/myscript.log 1>&2 &
 
J

Josef Moellers

George, I don't think that's what the OP wants. If you read the post
you'll see


So I think what's required is some way to register a Perl application
with KDE such that if it is shut down ungracefully (i.e. by the system
rather than the user) then KDE will know to restart it.

Exactly. I *do* know that it's somehow ksmserver's responsibility and
the applications that are running (and would therefore be eligible for
restart) are recorded in said ~/.kde/share/config/ksmserverrc, but I
doubt that I can just modify that file without telling ksmserver!
It seems that he also wants some "snapshot" capability which will allow
KDE to apply some logic to the restart; in the case of the browser this
means opening the pages that were open at the point of shutdown. What
that might mean in the case of the Perl application I couldn't say.

I think it would be OK to just restart the application. Restoring the
application's internal state might be the application's responsibility,
e.g. by storing it in an rc file in the user's home directory.
That said, I have no idea what the answer is.

Thanks anyway.

Josef
 
B

Bjoern Hoehrmann

* Ben Morrow wrote in comp.lang.perl.misc:
Well, strictly speaking CTE isn't valid on Usenet, so it's just a
meaningless header...

<http://tools.ietf.org/html/rfc5536>:

The MIME header fields MIME-Version, Content-Type, Content-Transfer-
Encoding, Content-Disposition, and Content-Language are used in
Netnews articles in the same circumstances and with the same meanings
as those specified in [RFC2045], [RFC2183], and [RFC3282], with the
added restrictions detailed above in Section 2.2.
 
P

Peter J. Holzer

Well, strictly speaking CTE isn't valid on Usenet, so it's just a
meaningless header...

RFC 5536, section 2.3:

| 2.3. MIME Conformance
|
| User agents MUST meet the definition of MIME conformance in [RFC2049]
| and MUST also support [RFC2231].

RFC 2049, section 2:

| 2. MIME Conformance
[...]
| A mail user agent that is MIME-conformant MUST:
[...]
| (2) Recognize the Content-Transfer-Encoding header field
| and decode all received data encoded by either quoted-
| printable or base64 implementations. The identity
| transformations 7bit, 8bit, and binary must also be
| recognized.

hp
 
I

Ivan Shmakov

[Cross-posting to and setting
Followup-To: there.]
It may not be valid for 1036, but it is certainly valid for 5536.
Unencoded ISO 8859-1 isn't valid for either.

Nowadays, I'd assume that every other newsreader out there is
going to either support the full range of charsets, whether
encoded or not, or to have little to no MIME support whatsoever.

Thus, the issue is rather the RFCs' failure to document the
existing practice, and not some incompliance. (Even though
unencoded data in general may clash with the NNTP provision that
any non-ASCII data transferred should be in UTF-8.)

But the whole point is moot, as "7bit" ISO-8859-1 is just a
fancy name for ASCII, which is valid since well before MIME.
 
A

Adam H. Kerman

Ivan Shmakov said:
[Cross-posting to and setting
Followup-To: there.]
It may not be valid for 1036, but it is certainly valid for 5536.
Unencoded ISO 8859-1 isn't valid for either.

Nowadays, I'd assume that every other newsreader out there is
going to either support the full range of charsets, whether
encoded or not, or to have little to no MIME support whatsoever.

Thus, the issue is rather the RFCs' failure to document the
existing practice, and not some incompliance. (Even though
unencoded data in general may clash with the NNTP provision that
any non-ASCII data transferred should be in UTF-8.)

But the whole point is moot, as "7bit" ISO-8859-1 is just a
fancy name for ASCII, which is valid since well before MIME.

Here I was, innocently reading news.software.readers, when I came across
this crosspost written by a self-declared topic moderator. I don't read
this newsgroup looking for redirected flames and arguments from another
newsgroup, so this isn't appreciated.

Furthermore, coming into the middle of this snark fest, I have no idea
who said what as "Ivan Shamkov" doesn't trouble himself with the niceties
of matching quoting levels in the body of the level with quoting levels
in attribution ilnes. According to "Ivan", "Shmuel" and "Ben" both wrote
quotes at the same quoting level.

Nor is "Ivan" aware of the concept of an unindented left margin, even for
quote characters indicating quoting level.

No followup to my article would be on topic anywhere but in a revenge froup
for "Ivan", so I've directed followups to the correct newsgroup.
 
A

Adam H. Kerman

Shmuel (Seymour J.) Metz said:
on 07/21/2013 at 05:13 PM, Ben Morrow <[email protected]> said:
It may not be valid for 1036, but it is certainly valid for 5536.
Unencoded ISO 8859-1 isn't valid for either.

The mechanism indicated in the Content-Transfer-Encoding header of 7bit
or 8bit is used with unencoded data, whereas quoted-printable or base64
is used with data encoded in the named mechanism. I have no idea why you
believe an author couldn't post an article to Usenet, the body of which
consists of unencoded Latin-1 characters, without violating syntax.

In any event, I agree with Ben and continue my boycott of MIME on
Usenet, not that anyone cares. The syntax of the CTE header, which is
used to indicate a type of unencoded data OR a mechanism of encoding,
is ungrammatical to my ear.
 
I

Ivan Shmakov

[Cross-posting to and setting
Followup-To: there. Adding on a second
though.]

[...]
In any event, I agree with Ben and continue my boycott of MIME on
Usenet, not that anyone cares.

Personally, I don't care about non-MIME articles, as long as
they're pure-ASCII. The only issues with forgoing MIME
completely I'm aware of are:

* pure-ASCII is simply not enough for the majority (90% or so)
of the world population; (this isn't a problem should Usenet
be though of as a kind of pure-English sect; but it isn't);

* use a non-compliant newsreader to quote MIME-compliant
messages, and havoc will ensue.
The syntax of the CTE header, which is used to indicate a type of
unencoded data

Is it?
 
A

Adam H. Kerman

This quote level in attribution does not match the quote level for the
quoted remarks written by me.
[Cross-posting to and setting
Followup-To: there. Adding on a second
though.]

Not playing followup games. If you think this discussion is off topic,
why did YOU post a followup to it in this newsgroup?
[...]
In any event, I agree with Ben and continue my boycott of MIME on
Usenet, not that anyone cares.
Personally, I don't care about non-MIME articles, as long as
they're pure-ASCII. The only issues with forgoing MIME
completely I'm aware of are:
* pure-ASCII is simply not enough for the majority (90% or so)
of the world population; (this isn't a problem should Usenet
be though of as a kind of pure-English sect; but it isn't);
* use a non-compliant newsreader to quote MIME-compliant
messages, and havoc will ensue.

My newsreader expects me to add headers, if necessary. If I must quote
an article with non-ASCII characters, I cut them. Typically, this happens
when I encounter articles written by Google Groups users to which
non-plain-text characters have been added (like non-breaking spaces).
Not to mention, Google Groups implements MIME badly.

If I absolutely must quote the 8-bit character, I add MIME headers to
declare the character set. Otherwise my articles are pure ASCII.

Yes, Ivan, with a literal read, it is used to indicate unencoded data
type despite the header's name, according to RFC 2045 Section 6.2:
Content-Transfer-Encodings Semantics

. . . Three transformations are currently defined: identity,
the "quoted-printable" encoding, and the "base64" encoding.
The domains are "binary", "8bit" and "7bit".

The Content-Transfer-Encoding values "7bit", "8bit", and
"binary" all mean that the identity (i.e. NO) encoding
transformation has been performed. As such, they serve simply
as indicators of the domain of the body data, and provide
useful information about the sort of encoding that might be
needed for transmission in a given transport system. . . .
 
I

Ivan Shmakov

[...]
If you think this discussion is off topic, why did YOU
post a followup to it in this newsgroup?

Because it's a well-established part of the netiquette.

Yet another way to keep the subscribers of the (irrelevant)
group the conversation is being moved from is to send a separate
followup to it, announcing the followup posted [1].

Those still interested in the discussion are encouraged to
subscribe to either or
(Which I will post my followups to this
thread to, if any, from now on. And sorry for the noise.)

[1]
 
A

Adam H. Kerman

Followup posted to comp.lang.perl.misc as that's where the thread is. I can't
think of anything ruder than changing newsgroups in the middle of a thread
so that the reader sees only some of the articles.

I continue to object to your attribution lines and your refusal to use
correct quoting levels so the reader can readily tell who said what.
[...]
[Cross-posting to and setting
Followup-To: there. Adding on a second
though.]
If you think this discussion is off topic, why did YOU
... And when Followup-To: is then ignored, is the expectation
that two wrongs will make a right? Or is a failure of one
poster to behave is a license to do so for everyone else?

Setting Followup-To is a suggestion, not a directive. The author of the
followup is still responsible for determining where to post.
Because it's a well-established part of the netiquette (which,
IIRC, you've been pointed at before): when moving a conversation
to another newsgroup, keep the subscribers of the former one
informed. One simple way to do it is as follows: add the
relevant groups to Newsgroups:, copy the result to Followup-To:,
remove the irrelevant ones from the latter (only.)
Yet another way is to send a separate followup to the irrelevant
newsgroup, which is what I'm going to do for this response.

There is no well-established part of netiquette that "Ivan Shmakov" has
either the role or responsibility to act as topic censor in any unmoderated
newsgroup. Please provide a list of names of anyone who has ever asked you
to moderate an unmoderated newsgroup.
[...]
My newsreader expects me to add headers, if necessary. If I must
quote an article with non-ASCII characters, I cut them. Typically,
this happens when I encounter articles written by Google Groups users
to which non-plain-text characters have been added (like non-breaking
spaces).
... Which reminds me of the thing I've used to call the
"American Usenet" attitude.

The A in ASCII stands for American.

It might have been useful in the 1960's to have included Chinese
characters or even to include all charactes used by languages that
use Latin characters, but coding space was extremely limited and most
characters in use by others got left out.

However, I don't see what your anti-American sentiment has to do with
what I wrote. I commented that Google Groups creates articles with
non-plain-text characters, which under no circumstances belong in
Usenet articles, no matter what language they were written in. I cut
such characters from quotes, which then allows me to post a followup in
nothing but ASCII.

I don't know why you would have a problem with that, but you're quite a
strange bird.
Naturally, I wouldn't expect one participating in
or
to find a non-MIME newsreader all that
convenient.

Why not? My newsreader provides default headers for articles. All anyone
would have to do is add the necessary MIME headers to the default set.
Then I'd post in compliant MIME if I really needed to declare a character
set.

I like the flexibility. Nothing about this newsreader requires the author
to post in ASCII. The newsreader uses an outside program as text editor
in the composer anyway, so the author would simply use a text editor
appropriate for his own use.
 
R

Rainer Weikusat

Adam H. Kerman said:
Followup posted to comp.lang.perl.misc as that's where the thread is. I can't
think of anything ruder than changing newsgroups in the middle of a thread
so that the reader sees only some of the articles.

The assumption that 'the reader' necessarily enjoyed the fact that he
went looking a for something Perl-related but found another instance
of this tripe instead is wrong.
 
P

Peter J. Holzer

[Fup2 poster. This is off-topic here and I'm not going to try to find
out where it is on-topic]

Followup posted to comp.lang.perl.misc as that's where the thread is. I can't
think of anything ruder than changing newsgroups in the middle of a thread
so that the reader sees only some of the articles.

I consider it very rude that you continue to try to push this thread
into a group where it is clearly off-topic.
There is no well-established part of netiquette that "Ivan Shmakov" has
either the role or responsibility to act as topic censor in any unmoderated
newsgroup. Please provide a list of names of anyone who has ever asked you
to moderate an unmoderated newsgroup.

Neither has anyone appointed you moderator of the groups you are trying
to "protect". Just stop it.

hp
 
A

Adam H. Kerman

The assumption that 'the reader' necessarily enjoyed the fact that he
went looking a for something Perl-related but found another instance
of this tripe instead is wrong.

Do you know how to score a thread whose Subject is Content-Transfer-Encoding
and clearly not Perl related?

I wasn't speaking for you. I'm the reader in question. I didn't want to
see Ivan's portions of the thread in news.software.readers, and I'm not
posting followups as directed by Ivan.
 
A

Adam H. Kerman

Peter J. Holzer said:
[Fup2 poster. This is off-topic here and I'm not going to try to find
out where it is on-topic]
I consider it very rude that you continue to try to push this thread
into a group where it is clearly off-topic.

It was topic drift here.
Neither has anyone appointed you moderator of the groups you are trying
to "protect". Just stop it.

I simply chose not to follow Ivan's re-direction. I get to do that.
I'm the author.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top