Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

If I have not seen so far it is because I stood in giant's footsteps.


devel / comp.unix.shell / Re: What shell is used by a script launched from the GUI (Linux > Debian > Mate)?

SubjectAuthor
* What shell is used by a script launched from the GUI (Linux > DebianOttavio Caruso
+* What shell is used by a script launched from the GUI (Linux >Ottavio Caruso
|`- What shell is used by a script launched from the GUI (Linux > Debian > Mate)?Joerg Mertens
+- What shell is used by a script launched from the GUI (Linux > DebianKenny McCormack
+* What shell is used by a script launched from the GUI (Linux > Debian > Mate)?Keith Thompson
|`* What shell is used by a script launched from the GUI (Linux >Ottavio Caruso
| `- What shell is used by a script launched from the GUI (Linux > Debian > Mate)?Keith Thompson
+* What shell is used by a script launched from the GUI (Linux >Jim Jackson
|`* What shell is used by a script launched from the GUI (Linux >Kenny McCormack
| +* What shell is used by a script launched from the GUI (Linux >Jim Jackson
| |`* What shell is used by a script launched from the GUI (Linux >Kenny McCormack
| | `- What shell is used by a script launched from the GUI (Linux >Jim Jackson
| `- What shell is used by a script launched from the GUI (Linux >Kaz Kylheku
`- What shell is used by a script launched from the GUI (Linux >David W. Hodgins

1
What shell is used by a script launched from the GUI (Linux > Debian > Mate)?

<uaagkm$3k760$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6484&group=comp.unix.shell#6484

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ottavio2006-usenet2012@yahoo.com (Ottavio Caruso)
Newsgroups: comp.unix.shell
Subject: What shell is used by a script launched from the GUI (Linux > Debian
> Mate)?
Date: Tue, 1 Aug 2023 08:44:04 +0000
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <uaagkm$3k760$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 1 Aug 2023 08:44:06 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="a992c37c73e7fc0a6072d9397f8a5223";
logging-data="3808448"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/31kQuVjynD82IxB0Kpijkx3Zkye9/xJo="
User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101
Firefox/102.0
Cancel-Lock: sha1:6MLyFNLTUdbEXnYdTfrDV+xi95Q=
X-No-Archive: Yes
Content-Language: en-GB
 by: Ottavio Caruso - Tue, 1 Aug 2023 08:44 UTC

I have a few scripts which refuse to do anything if I put the shebang on
the first line, example:

#!/bin/sh
redshift -P -O 3200

(sh is aliased to dash)

This works if launched from the command line, but not if run as a
startup script any time I log in the GUI (Mate on Debian).

It works either way if I remove the shebang. And this is for most custom
scripts that I add to mate-session-properties:
https://manpages.debian.org/testing/mate-session-manager/mate-session-properties.1.en.html

What's going on in here?

--
Ottavio Caruso

Re: What shell is used by a script launched from the GUI (Linux > Debian > Mate)?

<uad36n$25v$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6493&group=comp.unix.shell#6493

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ottavio2006-usenet2012@yahoo.com (Ottavio Caruso)
Newsgroups: comp.unix.shell
Subject: Re: What shell is used by a script launched from the GUI (Linux >
Debian > Mate)?
Date: Wed, 2 Aug 2023 08:13:11 +0000
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <uad36n$25v$1@dont-email.me>
References: <uaagkm$3k760$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 2 Aug 2023 08:13:12 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4f8b3e180c0b54dc40673d7645070927";
logging-data="2239"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18yIko/7inu0QpyDqq8H1QZsYRRxKdcoYM="
User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101
Firefox/102.0
Cancel-Lock: sha1:bMzMk0Z8784VeONqwGVtok+7l8w=
X-No-Archive: Yes
Content-Language: en-GB
In-Reply-To: <uaagkm$3k760$1@dont-email.me>
 by: Ottavio Caruso - Wed, 2 Aug 2023 08:13 UTC

Am 01/08/2023 um 08:44 schrieb Ottavio Caruso:
> I have a few scripts which refuse to do anything if I put the shebang on
> the first line, example:
>
> #!/bin/sh
> redshift -P -O 3200
>
> (sh is aliased to dash)
>
> This works if launched from the command line, but not if run as a
> startup script any time I log in the GUI (Mate on Debian).
>
> It works either way if I remove the shebang. And this is for most custom
> scripts that I add to mate-session-properties:
> https://manpages.debian.org/testing/mate-session-manager/mate-session-properties.1.en.html
>
> What's going on in here?
>
>
>

Anybody? Please!

--
Ottavio Caruso

Re: What shell is used by a script launched from the GUI (Linux > Debian > Mate)?

<uad9ma$31qnd$1@news.xmission.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6494&group=comp.unix.shell#6494

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.shell
Subject: Re: What shell is used by a script launched from the GUI (Linux > Debian
> Mate)?
Date: Wed, 2 Aug 2023 10:03:54 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <uad9ma$31qnd$1@news.xmission.com>
References: <uaagkm$3k760$1@dont-email.me>
Injection-Date: Wed, 2 Aug 2023 10:03:54 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="3205869"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Wed, 2 Aug 2023 10:03 UTC

In article <uaagkm$3k760$1@dont-email.me>,
Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> wrote:
>I have a few scripts which refuse to do anything if I put the shebang on
>the first line, example:
>
>#!/bin/sh
>redshift -P -O 3200
>
>(sh is aliased to dash)
>
>This works if launched from the command line, but not if run as a
>startup script any time I log in the GUI (Mate on Debian).
>
>It works either way if I remove the shebang. And this is for most custom
>scripts that I add to mate-session-properties:

I suppose the obvious question is: Why do you care? If it (whatever "it"
is) works w/o the shebang, why do you pursue making it work with it?

Note that your followup makes this sound pretty urgent, but it sounds
pretty academic to me.

--
The motto of the GOP "base": You can't *be* a billionaire, but at least you
can vote like one.

Re: What shell is used by a script launched from the GUI (Linux > Debian > Mate)?

<87il9xpxgq.fsf@joerg-mertens.dialin.t-online.de>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6495&group=comp.unix.shell#6495

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: joerg-mertens@t-online.de (Joerg Mertens)
Newsgroups: comp.unix.shell
Subject: Re: What shell is used by a script launched from the GUI (Linux > Debian > Mate)?
Date: Wed, 02 Aug 2023 12:09:25 +0200
Organization: privat
Lines: 35
Message-ID: <87il9xpxgq.fsf@joerg-mertens.dialin.t-online.de>
References: <uaagkm$3k760$1@dont-email.me> <uad36n$25v$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="f5242e2481d70d7219203d563bd57770";
logging-data="28980"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/nFZ0XA6u/i1jNMmuChk9gvMZr1NYdHXg="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (berkeley-unix)
Cancel-Lock: sha1:6VG53oInSM5KwAadogBTyK7O8vs=
sha1:LHfFu8rb8WKPTIWUJOGstHIaFPo=
 by: Joerg Mertens - Wed, 2 Aug 2023 10:09 UTC

Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> writes:

> Am 01/08/2023 um 08:44 schrieb Ottavio Caruso:
>> I have a few scripts which refuse to do anything if I put the shebang
>> on the first line, example: #!/bin/sh redshift -P -O 3200

Calling it this way the shell searches for the redshift program in its
PATH environment variable. Now the environment of the GUI could be
different from your environment, from which you start it interactively.
Have you tried calling the redshift program with its full path instead?

>> (sh is aliased to dash) This works if launched from the command line,
>> but not if run as a startup script any time I log in the GUI (Mate on
>> Debian). It works either way if I remove the shebang. And this is
>> for most custom scripts that I add to mate-session-properties:
>> https://manpages.debian.org/testing/mate-session-manager/mate-session-properties.1.en.html
>> What's going on in here?

One possibility to find out these things is writing output lines in your
startup script, like:

echo "Startup: PATH=$PATH"

Or to find out the running shell you could try:

echo "Startup: Processes which match shell PID" ps | grep $$

I don't know where output from your startup script is written to, so if
you're not sure you can redirect it to a file, e.g.

echo "PATH=$PATH" >/tmp/startup.out

HTH

Joerg

Re: What shell is used by a script launched from the GUI (Linux > Debian > Mate)?

<87ttthlpom.fsf@nosuchdomain.example.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6496&group=comp.unix.shell#6496

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.unix.shell
Subject: Re: What shell is used by a script launched from the GUI (Linux > Debian > Mate)?
Date: Wed, 02 Aug 2023 03:11:05 -0700
Organization: None to speak of
Lines: 38
Message-ID: <87ttthlpom.fsf@nosuchdomain.example.com>
References: <uaagkm$3k760$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="ccf7dbef32ea6c91e84b9ae6a4dccdde";
logging-data="29742"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Rd9MgJ62UPu6Owvzlah2i"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:NM5gl4zOnTEv23uL/EqixBceWoU=
sha1:Bq2rhEJMu2ZsLANUUeOMurprjzg=
 by: Keith Thompson - Wed, 2 Aug 2023 10:11 UTC

Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> writes:
> I have a few scripts which refuse to do anything if I put the shebang
> on the first line, example:
>
> #!/bin/sh
> redshift -P -O 3200
>
> (sh is aliased to dash)
>
> This works if launched from the command line, but not if run as a
> startup script any time I log in the GUI (Mate on Debian).
>
> It works either way if I remove the shebang. And this is for most
> custom scripts that I add to mate-session-properties:
> https://manpages.debian.org/testing/mate-session-manager/mate-session-properties.1.en.html
>
> What's going on in here?

How exactly does it not work? Does it just do nothing, with no error
message?

Have you set execute permission (chmod +x) on the script file?

Try adding some debugging statements to your script, for example:

#!/bin/sh
echo "$0 invoking redshift at $(date)" >> $HOME/redshift.log
echo "PATH=$PATH" >> $HOME/redshift.log
type redshift >> $HOME/redshift.log 2>&1
redshift -P -O 3200
echo "After redshift, status=$?" >> $HOME/redshift.log

Does it create $HOME/redshift.log ?

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

Re: What shell is used by a script launched from the GUI (Linux > Debian > Mate)?

<uadl5j$30vv$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6497&group=comp.unix.shell#6497

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ottavio2006-usenet2012@yahoo.com (Ottavio Caruso)
Newsgroups: comp.unix.shell
Subject: Re: What shell is used by a script launched from the GUI (Linux >
Debian > Mate)?
Date: Wed, 2 Aug 2023 13:19:46 +0000
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <uadl5j$30vv$1@dont-email.me>
References: <uaagkm$3k760$1@dont-email.me>
<87ttthlpom.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 2 Aug 2023 13:19:48 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4f8b3e180c0b54dc40673d7645070927";
logging-data="99327"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18BMVzP2HGQz6POr1AvZeklTD2Rxc5dQ40="
User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101
Firefox/102.0
Cancel-Lock: sha1:qA5CCb2R1mpIzkFugtf39bguWxc=
Content-Language: en-GB
X-No-Archive: Yes
In-Reply-To: <87ttthlpom.fsf@nosuchdomain.example.com>
 by: Ottavio Caruso - Wed, 2 Aug 2023 13:19 UTC

Am 02/08/2023 um 10:11 schrieb Keith Thompson:
> Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> writes:
>> I have a few scripts which refuse to do anything if I put the shebang
>> on the first line, example:
>>
>> #!/bin/sh
>> redshift -P -O 3200
>>
>> (sh is aliased to dash)
>>
>> This works if launched from the command line, but not if run as a
>> startup script any time I log in the GUI (Mate on Debian).
>>
>> It works either way if I remove the shebang. And this is for most
>> custom scripts that I add to mate-session-properties:
>> https://manpages.debian.org/testing/mate-session-manager/mate-session-properties.1.en.html
>>
>> What's going on in here?
>
> How exactly does it not work? Does it just do nothing, with no error
> message?
>
> Have you set execute permission (chmod +x) on the script file?
>
> Try adding some debugging statements to your script, for example:
>
> #!/bin/sh
> echo "$0 invoking redshift at $(date)" >> $HOME/redshift.log
> echo "PATH=$PATH" >> $HOME/redshift.log
> type redshift >> $HOME/redshift.log 2>&1
> redshift -P -O 3200
> echo "After redshift, status=$?" >> $HOME/redshift.log
>
> Does it create $HOME/redshift.log ?
>

Yes (launched from logging out and logging in Mate):

$ cat redshift.log
/home/oc/opt/bin/redshift invoking redshift at Wed 2 Aug 14:17:16 BST 2023
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/sbin:/usr/sbin:/sbin
redshift is /usr/bin/redshift
After redshift, status=0

--
Ottavio Caruso

Re: What shell is used by a script launched from the GUI (Linux > Debian > Mate)?

<slrnuckpcj.3ci.jj@iridium.wf32df>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6500&group=comp.unix.shell#6500

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jj@franjam.org.uk (Jim Jackson)
Newsgroups: comp.unix.shell
Subject: Re: What shell is used by a script launched from the GUI (Linux >
Debian > Mate)?
Date: Wed, 2 Aug 2023 14:17:55 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <slrnuckpcj.3ci.jj@iridium.wf32df>
References: <uaagkm$3k760$1@dont-email.me>
Injection-Date: Wed, 2 Aug 2023 14:17:55 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="8a448955ec9d8e91d8c3f8908037557b";
logging-data="121675"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Lw6E9z7egxJm1eHE9yhOTT+KVGowOCSk="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:jbJ3AnEMCt3r5zKLFoRV9opnrbc=
 by: Jim Jackson - Wed, 2 Aug 2023 14:17 UTC

On 2023-08-01, Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> wrote:
> I have a few scripts which refuse to do anything if I put the shebang on
> the first line, example:
>
> #!/bin/sh
> redshift -P -O 3200
>
> (sh is aliased to dash)
>
> This works if launched from the command line, but not if run as a
> startup script any time I log in the GUI (Mate on Debian).

use the full path name to the executable e.g.

/home/me/bin/redshift ...etc

redshift is probably not in one of the directories listed in the PATH
variable.
>
> It works either way if I remove the shebang. And this is for most custom
> scripts that I add to mate-session-properties:
> https://manpages.debian.org/testing/mate-session-manager/mate-session-properties.1.en.html
>
> What's going on in here?
>
>
>

Re: What shell is used by a script launched from the GUI (Linux > Debian > Mate)?

<uadop5$321kk$1@news.xmission.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6501&group=comp.unix.shell#6501

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.shell
Subject: Re: What shell is used by a script launched from the GUI (Linux >
Debian > Mate)?
Date: Wed, 2 Aug 2023 14:21:25 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <uadop5$321kk$1@news.xmission.com>
References: <uaagkm$3k760$1@dont-email.me> <slrnuckpcj.3ci.jj@iridium.wf32df>
Injection-Date: Wed, 2 Aug 2023 14:21:25 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="3212948"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Wed, 2 Aug 2023 14:21 UTC

In article <slrnuckpcj.3ci.jj@iridium.wf32df>,
Jim Jackson <jj@franjam.org.uk> wrote:
>On 2023-08-01, Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> wrote:
>> I have a few scripts which refuse to do anything if I put the shebang on
>> the first line, example:
>>
>> #!/bin/sh
>> redshift -P -O 3200
>>
>> (sh is aliased to dash)
>>
>> This works if launched from the command line, but not if run as a
>> startup script any time I log in the GUI (Mate on Debian).
>
>use the full path name to the executable e.g.
>
> /home/me/bin/redshift ...etc
>
>redshift is probably not in one of the directories listed in the PATH
>variable.

Your response makes no sense, given the complete history of OP's posts on
this thread.

BTW, I absolutely hate the "Use full paths" mantra as the solution to all
problems. It is a band-aid at best.

--
The randomly chosen signature file that would have appeared here is more than 4
lines long. As such, it violates one or more Usenet RFCs. In order to remain
in compliance with said RFCs, the actual sig can be found at the following URL:
http://user.xmission.com/~gazelle/Sigs/DanQuayle

Re: What shell is used by a script launched from the GUI (Linux > Debian > Mate)?

<op.18173xmxa3w0dxdave@hodgins.homeip.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6504&group=comp.unix.shell#6504

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dwhodgins@nomail.afraid.org (David W. Hodgins)
Newsgroups: comp.unix.shell
Subject: Re: What shell is used by a script launched from the GUI (Linux >
Debian > Mate)?
Date: Wed, 02 Aug 2023 13:27:23 -0400
Organization: A noiseless patient Spider
Lines: 70
Message-ID: <op.18173xmxa3w0dxdave@hodgins.homeip.net>
References: <uaagkm$3k760$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="c7a856c921aabb591c3314cc166313da";
logging-data="213000"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/rf5xGwgpzdZh0VqDeJTIU1ws77ap0X88="
User-Agent: Opera Mail/12.16 (Linux)
Cancel-Lock: sha1:nwsUY6/X6VblQetBwwYpSwInRYs=
 by: David W. Hodgins - Wed, 2 Aug 2023 17:27 UTC

On Tue, 01 Aug 2023 04:44:04 -0400, Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> wrote:

> I have a few scripts which refuse to do anything if I put the shebang on
> the first line, example:
>
> #!/bin/sh
> redshift -P -O 3200
>
> (sh is aliased to dash)
>
> This works if launched from the command line, but not if run as a
> startup script any time I log in the GUI (Mate on Debian).
>
> It works either way if I remove the shebang. And this is for most custom
> scripts that I add to mate-session-properties:
> https://manpages.debian.org/testing/mate-session-manager/mate-session-properties.1.en.html
>
> What's going on in here?

How is the script being invoked?

In the case of redshift, which I use, it fails if the gui is not running
already. As I prefer using run level 3, I've set up a script to start it.
The script is started after login by systemd.

$ cat /etc/xdg/systemd/user/redshift-gtk.service
[Unit]
Description=Redshift display colour temperature adjustment (GUI)
Documentation=http://jonls.dk/redshift/
After=display-manager.service
Conflicts=redshift.service

[Service]
ExecStart=/usr/local/bin/redshift-gtk
Restart=always
RestartSec=15

[Install]
WantedBy=default.target

That way it works no matter which desktop environment I start, and I don't
run into problems with more than one copy trying to start.

$ systemctl --user status redshift-gtk.service
● redshift-gtk.service - Redshift display colour temperature adjustment (GUI)
Loaded: loaded (/etc/xdg/systemd/user/redshift-gtk.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2023-07-30 12:04:31 EDT; 3 days ago
Docs: http://jonls.dk/redshift/
Main PID: 6667 (redshift-gtk)
Tasks: 5 (limit: 19118)
Memory: 19.2M
CPU: 20.721s
CGroup: /user.slice/user-500.slice/user@500.service/redshift-gtk.service
├─6667 /bin/bash /usr/local/bin/redshift-gtk
├─6684 /usr/bin/python3 /usr/bin/redshift-gtk
└─6685 /usr/bin/redshift -v

$ cat /usr/local/bin/redshift-gtk
#!/bin/bash
/usr/bin/sleep 20
/usr/bin/redshift-gtk

The sleep 20 gives me enough time to enter my ssh pass phrase and the startx
command.

Even with using systemd and the auto restart, it will fail if I take too long
as systemd will stop trying after too many failed attempts. If that happens, I
just manually run "systemctl --user start redshift-gtk.service".

Regards, Dave Hodgins

Re: What shell is used by a script launched from the GUI (Linux > Debian > Mate)?

<slrnucl8bp.3ci.jj@iridium.wf32df>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6505&group=comp.unix.shell#6505

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jj@franjam.org.uk (Jim Jackson)
Newsgroups: comp.unix.shell
Subject: Re: What shell is used by a script launched from the GUI (Linux >
Debian > Mate)?
Date: Wed, 2 Aug 2023 18:33:29 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <slrnucl8bp.3ci.jj@iridium.wf32df>
References: <uaagkm$3k760$1@dont-email.me>
<slrnuckpcj.3ci.jj@iridium.wf32df> <uadop5$321kk$1@news.xmission.com>
Injection-Date: Wed, 2 Aug 2023 18:33:29 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="8a448955ec9d8e91d8c3f8908037557b";
logging-data="242298"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18w5DdkbF3BNPGnz9pgFi6mKtge5nfLds0="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:bQVttU9r/J9Qc3jBQUD6XZOzhAA=
 by: Jim Jackson - Wed, 2 Aug 2023 18:33 UTC

On 2023-08-02, Kenny McCormack <gazelle@shell.xmission.com> wrote:
> In article <slrnuckpcj.3ci.jj@iridium.wf32df>,
> Jim Jackson <jj@franjam.org.uk> wrote:
>>On 2023-08-01, Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> wrote:
>>> I have a few scripts which refuse to do anything if I put the shebang on
>>> the first line, example:
>>>
>>> #!/bin/sh
>>> redshift -P -O 3200
>>>
>>> (sh is aliased to dash)
>>>
>>> This works if launched from the command line, but not if run as a
>>> startup script any time I log in the GUI (Mate on Debian).
>>
>>use the full path name to the executable e.g.
>>
>> /home/me/bin/redshift ...etc
>>
>>redshift is probably not in one of the directories listed in the PATH
>>variable.
>
> Your response makes no sense, given the complete history of OP's posts on
> this thread.
>
> BTW, I absolutely hate the "Use full paths" mantra as the solution to all
> problems. It is a band-aid at best.

Is it?

I agree for system utilities - get the default PATH right. But for
executables in users home space or in non-usual-system places, then I
believe the advice is valid.

Re: What shell is used by a script launched from the GUI (Linux > Debian > Mate)?

<87leetl0sq.fsf@nosuchdomain.example.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6506&group=comp.unix.shell#6506

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.unix.shell
Subject: Re: What shell is used by a script launched from the GUI (Linux > Debian > Mate)?
Date: Wed, 02 Aug 2023 12:08:37 -0700
Organization: None to speak of
Lines: 64
Message-ID: <87leetl0sq.fsf@nosuchdomain.example.com>
References: <uaagkm$3k760$1@dont-email.me>
<87ttthlpom.fsf@nosuchdomain.example.com>
<uadl5j$30vv$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="ccf7dbef32ea6c91e84b9ae6a4dccdde";
logging-data="246056"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ntavVjUKRUhyw3BxI85Of"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:c3ksBDHFohgfEqAbukcyYG/aTdc=
sha1:3LRh8HK9hTX1ZtSOuAiQj8oBaYA=
 by: Keith Thompson - Wed, 2 Aug 2023 19:08 UTC

Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> writes:
> Am 02/08/2023 um 10:11 schrieb Keith Thompson:
>> Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> writes:
>>> I have a few scripts which refuse to do anything if I put the shebang
>>> on the first line, example:
>>>
>>> #!/bin/sh
>>> redshift -P -O 3200
>>>
>>> (sh is aliased to dash)
>>>
>>> This works if launched from the command line, but not if run as a
>>> startup script any time I log in the GUI (Mate on Debian).
>>>
>>> It works either way if I remove the shebang. And this is for most
>>> custom scripts that I add to mate-session-properties:
>>> https://manpages.debian.org/testing/mate-session-manager/mate-session-properties.1.en.html
>>>
>>> What's going on in here?
>> How exactly does it not work? Does it just do nothing, with no
>> error message?

You didn't answer that.

>> Have you set execute permission (chmod +x) on the script file?

You didn't answer that either.

>> Try adding some debugging statements to your script, for example:
>> #!/bin/sh
>> echo "$0 invoking redshift at $(date)" >> $HOME/redshift.log
>> echo "PATH=$PATH" >> $HOME/redshift.log
>> type redshift >> $HOME/redshift.log 2>&1
>> redshift -P -O 3200
>> echo "After redshift, status=$?" >> $HOME/redshift.log
>> Does it create $HOME/redshift.log ?
>>
>
> Yes (launched from logging out and logging in Mate):
>
> $ cat redshift.log
> /home/oc/opt/bin/redshift invoking redshift at Wed 2 Aug 14:17:16 BST 2023
> PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/sbin:/usr/sbin:/sbin
> redshift is /usr/bin/redshift
> After redshift, status=0

That indicates that the redshift command is being invoked and completes
successfully. So what's the problem?

You said the script behaves differently when invoked from the command
line vs. being invoked on startup, but you've only shown us the log from
a single invocation, and you haven't told us how you invoked it.

Apparently your script is named "/home/oc/opt/bin/redshift".
If /home/oc/opt/bin is in your $PATH before /usr/bin, then the
script will invoke itself recursively, and will likely die when
it runs out of memory. We don't have enough information to know
whether that's the problem, but I suggest giving your script a
different name, perhaps "redshift-wrapper".

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

Re: What shell is used by a script launched from the GUI (Linux > Debian > Mate)?

<uaf0bn$32m8b$1@news.xmission.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6508&group=comp.unix.shell#6508

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.shell
Subject: Re: What shell is used by a script launched from the GUI (Linux >
Debian > Mate)?
Date: Thu, 3 Aug 2023 01:36:55 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <uaf0bn$32m8b$1@news.xmission.com>
References: <uaagkm$3k760$1@dont-email.me> <slrnuckpcj.3ci.jj@iridium.wf32df> <uadop5$321kk$1@news.xmission.com> <slrnucl8bp.3ci.jj@iridium.wf32df>
Injection-Date: Thu, 3 Aug 2023 01:36:55 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="3234059"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Thu, 3 Aug 2023 01:36 UTC

In article <slrnucl8bp.3ci.jj@iridium.wf32df>,
Jim Jackson <jj@franjam.org.uk> wrote:
....
>I agree for system utilities - get the default PATH right. But for
>executables in users home space or in non-usual-system places, then I
>believe the advice is valid.

I know you do.

--
I've been watching cat videos on YouTube. More content and closer to
the truth than anything on Fox.

Re: What shell is used by a script launched from the GUI (Linux > Debian > Mate)?

<20230802184917.374@kylheku.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6509&group=comp.unix.shell#6509

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-4973@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.shell
Subject: Re: What shell is used by a script launched from the GUI (Linux >
Debian > Mate)?
Date: Thu, 3 Aug 2023 01:53:25 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <20230802184917.374@kylheku.com>
References: <uaagkm$3k760$1@dont-email.me>
<slrnuckpcj.3ci.jj@iridium.wf32df> <uadop5$321kk$1@news.xmission.com>
Injection-Date: Thu, 3 Aug 2023 01:53:25 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f577c4f42aa1f569bd3a056883839435";
logging-data="508766"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+XxxaeYnRXnC6z+3QERMQ8olAFQOsZgeg="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:qiXB+hNenOhIqnkS7z+76Zvoqa8=
 by: Kaz Kylheku - Thu, 3 Aug 2023 01:53 UTC

On 2023-08-02, Kenny McCormack <gazelle@shell.xmission.com> wrote:
> BTW, I absolutely hate the "Use full paths" mantra as the solution to all
> problems. It is a band-aid at best.

So, like, I guess you're not using containers like all the other
children.

/me ducks under table.

Re: What shell is used by a script launched from the GUI (Linux > Debian > Mate)?

<slrnucq9kn.cti.jj@iridium.wf32df>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6523&group=comp.unix.shell#6523

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jj@franjam.org.uk (Jim Jackson)
Newsgroups: comp.unix.shell
Subject: Re: What shell is used by a script launched from the GUI (Linux >
Debian > Mate)?
Date: Fri, 4 Aug 2023 16:25:59 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <slrnucq9kn.cti.jj@iridium.wf32df>
References: <uaagkm$3k760$1@dont-email.me>
<slrnuckpcj.3ci.jj@iridium.wf32df> <uadop5$321kk$1@news.xmission.com>
<slrnucl8bp.3ci.jj@iridium.wf32df> <uaf0bn$32m8b$1@news.xmission.com>
Injection-Date: Fri, 4 Aug 2023 16:25:59 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b9ae9c78f43f65f4ceb9efd1500d3e9c";
logging-data="1408948"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/YarUub+bu5SlDrKpeMCwQRu1bNzi7ujI="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:T2Yo16UA5nCsdDNUioSvQqg8DeE=
 by: Jim Jackson - Fri, 4 Aug 2023 16:25 UTC

On 2023-08-03, Kenny McCormack <gazelle@shell.xmission.com> wrote:
> In article <slrnucl8bp.3ci.jj@iridium.wf32df>,
> Jim Jackson <jj@franjam.org.uk> wrote:
> ...
>>I agree for system utilities - get the default PATH right. But for
>>executables in users home space or in non-usual-system places, then I
>>believe the advice is valid.
>
> I know you do.

Sigh. Ok I should have explicitly asked, but I'd actually appreciate
your view on the problem with that advice.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor