Re: Problem with s6-softlimit -c

2016-12-01 Thread Laurent Bercot

Well, there's no output on the console and no logs - after it does its
thing it just hangs, doesn't execute the next program.

This:
s6-softlimit -c 204800 this_binary_desnt_exist

also hangs.


 That's weird. What is the state of the process after it hangs?
(S, R, D or something else?)

--
 Laurent



Re: How to trap ctrl-alt-del?

2016-12-01 Thread Jean Louis
On Thu, Dec 01, 2016 at 06:15:48PM +, Laurent Bercot wrote:
> > The s6-poweroff is for root user, and I have users who wish to
> > poweroff, and I don't want to give them sudo rights to power off the
> > computer. That is why I am searching for simple solution.
> 
>  Create a "poweroff" group.
>  Add all the users you want to that group.
>  chown root:poweroff /bin/s6-poweroff
>  chmod 4750 /bin/s6-poweroff
> 
>  Now, all users in the group "poweroff" have the right to call
> s6-poweroff. They don't have any other privileges.
> 
> --
>  Laurent

Thank you much.

Jean


Re: How to trap ctrl-alt-del?

2016-12-01 Thread Laurent Bercot

The s6-poweroff is for root user, and I have users who wish to
poweroff, and I don't want to give them sudo rights to power off the
computer. That is why I am searching for simple solution.


 Create a "poweroff" group.
 Add all the users you want to that group.
 chown root:poweroff /bin/s6-poweroff
 chmod 4750 /bin/s6-poweroff

 Now, all users in the group "poweroff" have the right to call
s6-poweroff. They don't have any other privileges.

--
 Laurent



Re: GNU Emacs now runs in foreground

2016-12-01 Thread Jean Louis
On Thu, Dec 01, 2016 at 12:54:38PM -0500, Steve Litt wrote:
> On Thu, 1 Dec 2016 20:48:37 +0300
> Jean Louis  wrote:
> 
> > On Thu, Dec 01, 2016 at 12:41:18PM -0500, Steve Litt wrote:
> > > > 
> > > > Just before some time, emacs --daemon, would go into background,
> > > > so it was not feasible to control it with s6 scripts. Now
> > > > developers changed it, and it is possible to invoke multiple
> > > > instances by name, and still keep the daemon in foreground. In
> > > > that mode there is no interface to editor. Clients that access
> > > > the editor, show the interface.  
> > > 
> > > Fascinating! How do emacs clients communicate with the emacs daemon?
> > > Sockets?
> > > 
> > > How many other user programs might be used as daemons. What an
> > > interesting idea! For some reason, mplayer pops into my mind.  
> > 
> > I have a strange feeling that you are joking...
> 
> Not at all. You know mplayer can interact via a FIFO.
> 
> Seriously, I'm not joking. I'm always interested in new ways to use my
> computer.

By the way, interesting book there.

Back to topic. When emacs is daemon on my side, I start it before the
X, so I can even restart X, buffers are in memory. And I start editor
simply faster. It is huge, but it gives me everything I need. Actually
it is not an editor, more kind of environment of various tools.

Org Mode is one of good ways of writing text, that may be exported as
books, with the contents, and all. Add the front page and back page,
and you get professional typeset book without the external
service. Tip for you as author. http://orgmode.org it is built in.

Jean


Re: GNU Emacs now runs in foreground

2016-12-01 Thread Steve Litt
On Thu, 1 Dec 2016 20:48:37 +0300
Jean Louis  wrote:

> On Thu, Dec 01, 2016 at 12:41:18PM -0500, Steve Litt wrote:
> > > 
> > > Just before some time, emacs --daemon, would go into background,
> > > so it was not feasible to control it with s6 scripts. Now
> > > developers changed it, and it is possible to invoke multiple
> > > instances by name, and still keep the daemon in foreground. In
> > > that mode there is no interface to editor. Clients that access
> > > the editor, show the interface.  
> > 
> > Fascinating! How do emacs clients communicate with the emacs daemon?
> > Sockets?
> > 
> > How many other user programs might be used as daemons. What an
> > interesting idea! For some reason, mplayer pops into my mind.  
> 
> I have a strange feeling that you are joking...

Not at all. You know mplayer can interact via a FIFO.

Seriously, I'm not joking. I'm always interested in new ways to use my
computer.

SteveT



-- 
SteveT

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


Re: GNU Emacs now runs in foreground

2016-12-01 Thread Jean Louis
On Thu, Dec 01, 2016 at 12:41:18PM -0500, Steve Litt wrote:
> > 
> > Just before some time, emacs --daemon, would go into background, so it
> > was not feasible to control it with s6 scripts. Now developers changed
> > it, and it is possible to invoke multiple instances by name, and still
> > keep the daemon in foreground. In that mode there is no interface to
> > editor. Clients that access the editor, show the interface.
> 
> Fascinating! How do emacs clients communicate with the emacs daemon?
> Sockets?
> 
> How many other user programs might be used as daemons. What an
> interesting idea! For some reason, mplayer pops into my mind.

I have a strange feeling that you are joking...


Re: GNU Emacs now runs in foreground

2016-12-01 Thread Steve Litt
On Thu, 1 Dec 2016 20:28:46 +0300
Jean Louis  wrote:

> On Thu, Dec 01, 2016 at 12:05:31PM -0500, Steve Litt wrote:

> > OK, I'll byte.
> > 
> > I thought emacs was an editor that a human runs in the foreground to
> > edit files, so my reaction to this was "of course it runs in the
> > foreground!"
> > 
> > What am I missing?  
> 
> You are right, it is hard to figure out the context. That is for s6
> services, I am invoking editor as daemon, so that it may be accessed
> later by need.
> 
> Buffers remain in memory, and so the IRC, Jabber chat, various
> documents from which I yank parts of texts into emails, registers, the
> programming languages are invoked within the editor, and shells and
> other tools. Invoking single editor each time is a bit slower, than
> invoking it as client that accesses the daemon. And that way, all the
> goodies would be lost by each new invocation. Some people have
> multiple buffers over multiple days.
> 
> Just before some time, emacs --daemon, would go into background, so it
> was not feasible to control it with s6 scripts. Now developers changed
> it, and it is possible to invoke multiple instances by name, and still
> keep the daemon in foreground. In that mode there is no interface to
> editor. Clients that access the editor, show the interface.

Fascinating! How do emacs clients communicate with the emacs daemon?
Sockets?

How many other user programs might be used as daemons. What an
interesting idea! For some reason, mplayer pops into my mind.

Thanks!
 
SteveT

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


Re: GNU Emacs now runs in foreground

2016-12-01 Thread Steve Litt
On Thu, 1 Dec 2016 11:18:29 +0300
Jean Louis  wrote:

> The GNU Emacs now has got a new option:
> 
> emacs --new-daemon=NAME
> 
> that is running emacs daemon in foreground, obviously someone reacted
> since last time I wrote to the emacs mailing list. It is in the
> development version or git.

OK, I'll byte.

I thought emacs was an editor that a human runs in the foreground to
edit files, so my reaction to this was "of course it runs in the
foreground!"

What am I missing?

Thanks,
 
SteveT

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


Re: How to trap ctrl-alt-del?

2016-12-01 Thread Jean Louis
OK that is correct, I need to configure acpid, for power off.

And I will leave defaults of reboot with ctrl-alt-del

The s6-poweroff is for root user, and I have users who wish to
poweroff, and I don't want to give them sudo rights to power off the
computer. That is why I am searching for simple solution.

Jean

On Thu, Dec 01, 2016 at 07:33:16PM +0800, Casper Ti. Vector wrote:
> Setting `kernel.ctrl-alt-del' to 0 just makes C-A-D send SIGINT to PID 1
> (instead of triggering a hard reboot).  If you want to make SIGINT
> trigger a grace shutdown, you can modify the SIGINT handler in the
> `service/.s6-svscan' directory.
> 
> But I personally do not think changing signal semantics (which is
> already a mess [1]) is the way to go; instead, I recommend using
> s6-poweroff(8) from s6-linux-init if you are already using that package.
> 
> If you machine is ACPI-enabled, you can also configure acpid to spawn
> s6-poweroff(8) when the power button is pressed, so you may push the
> button to power off your machine.
> 
> [1]  2:mss:1377:201608:hiocpcghpahbaiedeihc>.
> 
> On Thu, Dec 01, 2016 at 02:06:50PM +0300, Jean Louis wrote:
> > What exactly should I change or do, that simply does power off?
> 
> -- 
> My current OpenPGP key:
> RSA4096/0x227E8CAAB7AA186C (expires: 2020.10.19)
> 7077 7781 B859 5166 AE07 0286 227E 8CAA B7AA 186C
> 


Re: How to trap ctrl-alt-del?

2016-12-01 Thread Casper Ti. Vector
Setting `kernel.ctrl-alt-del' to 0 just makes C-A-D send SIGINT to PID 1
(instead of triggering a hard reboot).  If you want to make SIGINT
trigger a grace shutdown, you can modify the SIGINT handler in the
`service/.s6-svscan' directory.

But I personally do not think changing signal semantics (which is
already a mess [1]) is the way to go; instead, I recommend using
s6-poweroff(8) from s6-linux-init if you are already using that package.

If you machine is ACPI-enabled, you can also configure acpid to spawn
s6-poweroff(8) when the power button is pressed, so you may push the
button to power off your machine.

[1] .

On Thu, Dec 01, 2016 at 02:06:50PM +0300, Jean Louis wrote:
> What exactly should I change or do, that simply does power off?

-- 
My current OpenPGP key:
RSA4096/0x227E8CAAB7AA186C (expires: 2020.10.19)
7077 7781 B859 5166 AE07 0286 227E 8CAA B7AA 186C



Re: How to trap ctrl-alt-del?

2016-12-01 Thread Jean Louis
Thank you much. I have figured out that I had to change kernel
parameter to be:

kernel.ctrl-alt-del = 0

and now I see that ctrl-alt-del reboots, it is by default.

What exactly should I change or do, that is simply does power off?



On Sat, Nov 26, 2016 at 10:36:22PM +0800, Casper Ti. Vector wrote:
> Try s6-linux-init [1]; you can modify the scripts in the `.s6-svscan'
> directory according to your requirements.
> 
> [1] .
> 
> On Sat, Nov 26, 2016 at 03:10:32PM +0300, Jean Louis wrote:
> > Now I wonder how to practically implement the -s option, should I just
> > give it something like "sudo s6-poweroff"?
> 
> -- 
> My current OpenPGP key:
> RSA4096/0x227E8CAAB7AA186C (expires: 2020.10.19)
> 7077 7781 B859 5166 AE07 0286 227E 8CAA B7AA 186C
> 


GNU Emacs now runs in foreground

2016-12-01 Thread Jean Louis
The GNU Emacs now has got a new option:

emacs --new-daemon=NAME

that is running emacs daemon in foreground, obviously someone reacted
since last time I wrote to the emacs mailing list. It is in the
development version or git.

http://savannah.gnu.org/projects/emacs/

That is great news for those who use s6-rc and wish to run emacs.

No need any more for tricks with "screen" like below:

#!/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/perl5/bin:/home/data1/protected/bin:/bin:/usr/bin:/opt/texlive/2015/bin/x86_64-linux:/opt/jdk/bin:/opt/qt4/bin:/opt/qt5/bin"
 }
backtick -n LC_ALL { echo "en_US.UTF-8" }
/usr/bin/screen -l -S emacs -D -m --
/usr/bin/emacs --user admin --chdir /home/data1/protected

Jean Louis