Re: How can I preserve TMPDIR environment in screen?

2017-07-16 Thread Jean Louis
Hello Mark,

Thank you much, that solves it for me. I will use
(setenv in Emacs.

Jean

On Sun, Jul 16, 2017 at 09:50:49PM +0100, Mark Diekhans wrote:
> 
> It's not screen, it's the kernel because screen is sgid,
> for security reasons
> 
> You can have your .emacs reset TMPDIR or have a wrapper script
> that does this.
> 
> Jean Louis  writes:
> > Hello,
> > 
> > I am using screen in following peculiar manner, down below.
> > 
> > And I am trying to test it to change the TMPDIR variable.
> > 
> > $ env SOMETHING=OK TMPDIR=/var/tmp/ screen -l -S emacs -D -m -- emacs
> > 
> > So that above does not work, the TMPDIR is not preserved. I can then
> > test it in Emacs with (getenv "TMPDIR") it is nil.
> > 
> > But SOMETHING is "OK".
> > 
> > Can I understand why is screen deleting my TMPDIR? I need it.
> > 
> > Jean Louis
> > 
> > 
> > #!/bin/execlineb -P
> > if { s6-test -d /home/data1/protected/Work }
> > s6-setuidgid admin
> > backtick -n HOME { homeof admin }
> > backtick -n PATH { echo 
> > "/home/data1/protected/Programming/perl5/bin:/home/data1/protected/bin:/home/data1/protected/bin/rcd:/home/data1/protected/.local/bin:/home/data1/protected/bin:/home/data1/protected/perl5/bin:/home/data1/protected/bin:/home/data1/protected/bin/rcd:/home/data1/protected/.local/bin:/usr/local/bin:/bin:/usr/bin:/opt/texlive/2015/bin/x86_64-linux:/opt/jdk/bin:/opt/qt4/bin:/opt/qt5/bin:/usr/libexec:/opt/rakudo-star-2016.07/bin:/opt/rakudo-star-2016.07/share/perl6/site/bin:/home/data1/protected/Programming/git/fgallery:/usr/libexec:/opt/rakudo-star-2016.07/bin:/opt/rakudo-star-2016.07/share/perl6/site/bin:/home/data1/protected/Programming/git/fgallery"
> >  }
> > backtick -n MAILDIR { echo "/home/data1/protected/Maildir" }
> > backtick -n LC_ALL { echo "en_US.UTF-8" }
> > backtick -n TMPDIR { echo "/home/data1/protected/tmp" }
> > /usr/bin/screen -l -S emacs -D -m --
> > /usr/bin/emacs --user admin --chdir /home/data1/protected
> > 
> > ___
> > screen-users mailing list
> > screen-us...@gnu.org
> > https://lists.gnu.org/mailman/listinfo/screen-users


How to set TMPDIR environment for user in s6-rc?

2017-07-16 Thread Jean Louis
Hello,

Whatever I do, I get all other environment variables in Emacs, but not
the TMPDIR. 

I get MAILDIR for example but not TMPDIR.

Is TMPDIR for some reason deleted?

Jean

/etc/s6-rc/services/admin:emacs file:

#!/bin/execlineb -P
if { s6-test -d /home/data1/protected/Work }
s6-setuidgid admin
backtick -n HOME { homeof admin }
backtick -n PATH { echo 
"/home/data1/protected/Programming/perl5/bin:/home/data1/protected/bin:/home/data1/protected/bin/rcd:/home/data1/protected/.local/bin:/home/data1/protected/bin:/home/data1/protected/perl5/bin:/home/data1/protected/bin:/home/data1/protected/bin/rcd:/home/data1/protected/.local/bin:/usr/local/bin:/bin:/usr/bin:/opt/texlive/2015/bin/x86_64-linux:/opt/jdk/bin:/opt/qt4/bin:/opt/qt5/bin:/usr/libexec:/opt/rakudo-star-2016.07/bin:/opt/rakudo-star-2016.07/share/perl6/site/bin:/home/data1/protected/Programming/git/fgallery:/usr/libexec:/opt/rakudo-star-2016.07/bin:/opt/rakudo-star-2016.07/share/perl6/site/bin:/home/data1/protected/Programming/git/fgallery"
 }
backtick -n MAILDIR { echo "/home/data1/protected/Maildir" }
backtick -n LC_ALL { echo "en_US.UTF-8" }
backtick -n TMPDIR { echo "/home/data1/protected/tmp" }
/usr/bin/screen -l -S emacs -D -m --
/usr/bin/emacs --user admin --chdir /home/data1/protected


Re: s6-svscanboot, how to exit?

2017-07-16 Thread Jean Louis
On Sun, Jul 16, 2017 at 02:00:17AM -0400, Steve Litt wrote:
> On Sat, 15 Jul 2017 18:53:44 +0300
> Jean Louis  wrote:
> 
> > Hello Jonathan,
> > 
> > On Sat, Jul 15, 2017 at 02:47:39PM +0100, Jonathan de Boyne Pollard
> > wrote:
> > > > Type=forking  
> > > 
> > > No.
> > >   
> > > > StandardOutput=tty  
> > > 
> > > No.
> > >   
> > > > RemainAfterExit=yes  
> > > 
> > > No.
> > >   
> > > > SysVStartPriority=99  
> > > 
> > > No.  
> > 
> > I know I know, I did not read the manuals on
> > systemd.
> 
> And why should you? You're using daemontools to
> escape as many processes as possible out of
> systemd's clutches, and there's nothing wrong
> with copying off stackexchange and letting the
> list know what worked. You're not expected to be
> a systemd expert.

I like simplicite of D.J. Bernstein, and s6 gives me
nice tools for each system without complexities,
in the D.J. Bernstein way.

It is long time ago that I found daemontools, it
was most natural. If I remember well it was even
packaged in Debian systems. init.d could not just
keep everything always running, daemontools could.

> > > You're a long-time daemontools user, you say.
> > > Why on Earth do you think that Type=forking is
> > > right?  
> > 
> > Because I don't think, I copied and it works, if
> > you did not tell me know, it would remain so for
> > years probably. I know I should be more
> > responsible, but I have placed before daemontools
> > in /etc/inittab and just forgot about it, I guess
> > that is wanted effect.
> 
> You don't really need to apologize. You apparently weren't completely
> correct, and it worked well enough to make it seem correct. And some
> guy comes on, gives you four "no"s without reasons, imply that you're
> falsely bragging about being a daemontools user, and then gives you one
> of those "why on earth" type things.

Of course I have seen that, and I don't mind, it
is just my way of handling communication.

You know how people come into fights? When
explaining about the methods of communication
instead of the subject of communication.

So I try to avoid speaking of methods, as it does
not bring much -- but rather of subjects.

> > I don't think really, and I tried the one-shot
> > method too, but that was not the problem that I
> > was not exiting.
> > 
> > This one I changed
> > 
> > RemainAfterExit=no
> > 
> > and now after systemd "start" it exits.
> > 
> > > Why on Earth do you think that svscan -- any
> > > svscan, from daemontools-encore svscan to
> > > s6-svscan -- forks and exits parent?  Or needs a
> > > TTY?  
> > 
> > You are right, I did not check enough.
> 
> I'm sure you *DIDN'T* think that, and you really don't owe this guy an
> explanation, because he's sure not here to help you.
> 
> Laurent's right. Go on a systemd list or IRC, tell them you need to
> spawn daemontools, tell them daemontools does not put itself in the
> background, and that you want it restarted if it stops. They'll tell
> you what to do. By the way, you might have to tell it to put /command
> on the $PATH. If you need that and you cannot get systemd to handle it,
> I'll give you a shellscript to get it done.

It is related to both, and more to this list I
guess, as people here will know more what is it
about. There would it be as conflict of interest,
just as here, but I guess more there... as a black
sheep in white sheep crowd.

I like reasoning behind daemontools, and Laurent's
reasoning, and that software just works.

The daemontools and now s6 supervision is simply
running 3 tiny web servers accepting the leads
through Nginx, and that is how wealth is created.

Jean


Re: s6-svscanboot, how to exit?

2017-07-16 Thread Steve Litt
On Sat, 15 Jul 2017 18:53:44 +0300
Jean Louis  wrote:

> Hello Jonathan,
> 
> On Sat, Jul 15, 2017 at 02:47:39PM +0100, Jonathan de Boyne Pollard
> wrote:
> > > Type=forking  
> > 
> > No.
> >   
> > > StandardOutput=tty  
> > 
> > No.
> >   
> > > RemainAfterExit=yes  
> > 
> > No.
> >   
> > > SysVStartPriority=99  
> > 
> > No.  
> 
> I know I know, I did not read the manuals on
> systemd.

And why should you? You're using daemontools to escape as many
processes as possible out of systemd's clutches, and there's nothing
wrong with copying off stackexchange and letting the list know what
worked. You're not expected to be a systemd expert.

> 
> > You're a long-time daemontools user, you say.
> > Why on Earth do you think that Type=forking is
> > right?  
> 
> Because I don't think, I copied and it works, if
> you did not tell me know, it would remain so for
> years probably. I know I should be more
> responsible, but I have placed before daemontools
> in /etc/inittab and just forgot about it, I guess
> that is wanted effect.

You don't really need to apologize. You apparently weren't completely
correct, and it worked well enough to make it seem correct. And some
guy comes on, gives you four "no"s without reasons, imply that you're
falsely bragging about being a daemontools user, and then gives you one
of those "why on earth" type things.

Louis, ignore the guy. His motivation obviously isn't to help. And if
he again asks "why on earth did you think "Type=forking" is right?",
just tell him that for all you knew, that meant it's the type of
software that systemd must fork because it doesn't fork itself. That's
just as plausible.

And when he asks...


> 
> > Why on Earth do you think that good daemons fork
> > and exit parent?  

the answer is that you didn't.

> 
> I don't think really, and I tried the one-shot
> method too, but that was not the problem that I
> was not exiting.
> 
> This one I changed
> 
> RemainAfterExit=no
> 
> and now after systemd "start" it exits.
> 
> > Why on Earth do you think that svscan -- any
> > svscan, from daemontools-encore svscan to
> > s6-svscan -- forks and exits parent?  Or needs a
> > TTY?  
> 
> You are right, I did not check enough.

I'm sure you *DIDN'T* think that, and you really don't owe this guy an
explanation, because he's sure not here to help you.

Laurent's right. Go on a systemd list or IRC, tell them you need to
spawn daemontools, tell them daemontools does not put itself in the
background, and that you want it restarted if it stops. They'll tell
you what to do. By the way, you might have to tell it to put /command
on the $PATH. If you need that and you cannot get systemd to handle it,
I'll give you a shellscript to get it done.
 
SteveT

Steve Litt 
July 2017 featured book: Quit Joblessness: Start Your Own Business
http://www.troubleshooters.com/startbiz