Re: execline-2.3.0.3 failes with ./configure --prefix=

2017-10-22 Thread Jean Louis
On Mon, Oct 23, 2017 at 04:39:38AM +, Laurent Bercot wrote:
> 
> > ./configure --prefix=/package/admin/$(basename `pwd`)
> 
>  If you're using slashpackage, don't use --prefix.
>  Use --enable-slashpackage instead.

If I understand it well, I am supposed to make the
symlinks myself from /package/prog/skalibs-2.6.0.2
to /package/prog/skalibs right?

Jean

exec ./tools/install.sh -D -m 644 src/include/skalibs/unixonacid.h 
/package/prog/skalibs-2.6.0.2/include/skalibs/unixonacid.h
exec ./tools/install.sh -D -m 644 src/include/skalibs/webipc.h 
/package/prog/skalibs-2.6.0.2/include/skalibs/webipc.h
 root [ /sources/skarnet.org/skalibs-2.6.0.2 ]# cd ^C
 root [ /sources/skarnet.org/skalibs-2.6.0.2 ]# cd ..
 root [ /sources/skarnet.org ]# cd execline-2.3.0.3
 root [ /sources/skarnet.org/execline-2.3.0.3 ]# ./configure 
--enable-slashpackage
checking for C compiler...
  ... gcc
checking whether C compiler works... 
  ... yes
checking target system type...
  ... x86_64-unknown-linux-gnu
./configure: error: /package/prog/skalibs/sysdeps is not a valid sysdeps 
directory
 root [ /sources/skarnet.org/execline-2.3.0.3 ]# 


Re: execlineb's import conflicts with ImageMagick

2017-10-22 Thread Jean Louis
On Sun, Oct 22, 2017 at 09:32:30PM +, Charles Duffy wrote:
> Given as GraphicsMagick moves "import" to a subcommand ("gm import"), you
> might consider using it to avoid any conflict.

Thank you for the input. I do not use
GraphicsMagick (yet), and I have just tried
installing skarnet tools into /usr/bin then I
found the conflict as I used --prefix, now I am
back to install it directly, later I will switch
to slashpackage.

I am using this Lisp script to simply install all
tools by:

install-s6.lisp skalibs-2.6.0.2.tar.gz etc.

as all s6 tools are consistent, it simply works.

(unless *args* (quit))

(setf files *args*)

(defun remove-tar.gz (file)
  (substring file 0 (search ".tar.gz" file)))

(dolist (file files)
  (let* ((command1 (format nil "tar xf ~A" file))
 (command3 (format nil "cd ~A && ./configure && make && make install" 
(remove-tar.gz file
(shell command1)
(shell command3)))

> > The ImageMagick software has the "import" command
> > that is conflicting with "import" from execlineb
> > package.
> >
> > Jean


Re: execlineb's import conflicts with ImageMagick

2017-10-22 Thread Jean Louis
Alright, thank you, that is solved.

On Sun, Oct 22, 2017 at 07:06:13PM -0300, Guillermo wrote:
> Hello,
> 
> 2017-10-22 18:01 GMT-03:00 Jean Louis:
> >
> > The ImageMagick software has the "import" command
> > that is conflicting with "import" from execlineb
> > package.
> 
> This is known, see the 'execline-2.3.0.0' section of this announcement:
> 
> * https://www.skarnet.org/cgi-bin/archive.cgi?2:msp:1687:blbgbjnpebcmhkmelgjd
> 
> G.


How to run s6-svscan in user space

2017-07-22 Thread Jean Louis
Hello,

I have these files:

~/Programming/services/cron

cron/run: executable

#!/bin/execlineb -P
/home/data1/protected/bin/lisp 
/home/data1/protected/Programming/git/RCDBusiness/lib/lisp/cron/cron.lisp

cron/type:

longrun


and I can run s6-svscan in the dir just fine. But
it does not run the ./run file.

It is all in user space. If I run ./run from
command line, it works.

What do I miss?

Jean


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 <bugs@gnu.support> 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 <bugs@gnu.support> 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-15 Thread Jean Louis
On Sat, Jul 15, 2017 at 12:55:59PM -0300, Guillermo wrote:
> 2017-07-14 13:00 GMT-03:00 Jean Louis:
> >
> > However, the VPS servers don't have much option
> > left to me, I can install my own system with s6,
> > or I can use the ready Debian, Ubuntu and similar.
> 
> OK, quick summary if you are stuck with systemd but want the least
> possible interaction with it, and a supervised s6-svscan process.
> Untested because I don't have access to a systemd machine and am not
> planning to, but it is what I would try.

Thank you, good to know!

Jean


Re: s6-svscanboot, how to exit?

2017-07-15 Thread Jean Louis
On Sat, Jul 15, 2017 at 09:45:51AM +, Laurent Bercot wrote:
> > and if I write: service s6 start (after stop), I
> > can see I am still bound to console, which is for
> > me as user not so clear why. For example nginx
> > releases me back to console.
> 
>  This is now a systemd question, and you should get help with
> systemd user groups, not here; but I see two things that seem
> incorrect in your service definition. I don't think "Type=forking"
> is correct, because s6-svscan doesn't fork; you probably want
> "Type=simple". And "StandardOutput=tty" looks suspicious.
> 
> --
>  Laurent

Yes, you are right, thank you for the notice.

I guess when search engines catch "systemd" words
in this mailing list, there will be more attention
on s6 tools.

In my offices, in few rooms, s6 is running on
computers. But on remote VPS, no, due to not being
available in "popular" distributions.

Jean



Re: s6-svscanboot, how to exit?

2017-07-15 Thread Jean Louis
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.

> 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.

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

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.

Now I have it better and simpler, after reading
your references, but .path is not required in
separate file (I guess):

cat s6.service
[Unit]
Description=S6 Supervision
ConditionPathExists=/service

[Service]
ExecStart=/command/s6-svscan /service
Restart=always
RemainAfterExit=no

[Install]
WantedBy=multi-user.target

and start/stop stuff works with systemd.

Thanks much!

Jean


Re: s6-svscanboot, how to exit?

2017-07-15 Thread Jean Louis
On Fri, Jul 14, 2017 at 05:51:01PM -0400, Steve Litt wrote:
> So you can either do it like you are now, and if s6svscanboot goes down
> your whole supervision tree goes down and stays down, or you can make a
> systemd unit file for s6 and run it from there, and if s6-svscanboot
> goes down it will come right back up. You can probably experiment at
> home with a Debian virtual machine host to get just the right unit file
> and how to tell it to run itself.

As for me is just important to run 3 http daemons
under Nginx, now I made it simpler, after
recommendations from this list, I have

/etc/systemd/system/s6.service:

[Unit]
Description=S6 Supervision
ConditionPathExists=/service

[Service]
Type=forking
ExecStart=/command/s6-svscan /service
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99

[Install]
WantedBy=multi-user.target


and if I write: service s6 start (after stop), I
can see I am still bound to console, which is for
me as user not so clear why. For example nginx
releases me back to console.

But I press C-c and daemons are running.

On reboot everything is fine and running too.

Jean


Re: s6-svscanboot, how to exit?

2017-07-15 Thread Jean Louis
On Fri, Jul 14, 2017 at 09:38:00PM +0100, Jonathan de Boyne Pollard wrote:
> Jean Louis:
> > Well I made rc-local.service
> 
> Do not do that.  Creating a two steps backwards compatibility mechanism, in
> order to run s6-svscan under systemd, is daft.
> 
> Jean Louis:
> > I just used recipe from stackexchange.com
> 
> You're not reading the right parts of Stack Exchange, obviously.
> 
> * https://askubuntu.com/a/700401/43344

I have in /etc/rc.local -- which I could as well
call as I wish, like s6-svscanboot, followin

#!/command/execlineb -P
/command/redirfd -r 0 /dev/null
/command/exec -c -a /command/s6-svscan
/command/s6-svscan -t0 /service

Then you suggest I could put it directly in
.service file, which I think is better idea, but
then how? I don't know.

I would again need to put some file name in
*.service file pointing either to rc.local or
whatever I wish to call that script.

I will certainly rename it to s6.service

Jean


Re: s6-svscanboot, how to exit?

2017-07-14 Thread Jean Louis
On Fri, Jul 14, 2017 at 02:31:28PM -0400, Steve Litt wrote:
> >   If you're fine with it not being supervised and insist on launching
> > s6-svscanboot from /etc/rc.local, then you want to enclose all its
> > commands in a "background { }" block, which is execline's equivalent
> > of the shell's &.
> 
> Or, from sysvinit, you can put it as a respawn in /etc/inittab, so that
> s6svscanboot itself is supervised, by sysvinit.

On that new Debian VPS that I ordered with Digital
Ocean, there is no /etc/inittab and I don't know
nothing much about systemd, so I just used recipe
from stackexchange.com

Jean


Re: s6-svscanboot, how to exit?

2017-07-14 Thread Jean Louis
Hello Laurent,

I see that as a principle, and I support it.

However, the VPS servers don't have much option
left to me, I can install my own system with s6,
or I can use the ready Debian, Ubuntu and similar.

Anyway, right now it works, even if it starts, and
I interrupt it, it continues working due to
supervisor probably.

I just switched from daemontools which I used for
years to s6 software as it is maintained, even I
never had problems with daemontools, it just
works like s6.

Jean

On Fri, Jul 14, 2017 at 03:58:43PM +, Laurent Bercot wrote:
> > Do you have example settings for systemd to
> > start s6-svscan?
> 
>  I don't, sorry. I never bothered to learn the
> syntax, and I kinda omitted systemd from the
> https://skarnet.org/software/s6/s6-svscan-not-1.html
> page on purpose.
> 
>  But I'm sure somebody somewhere has such an example, and if not, it
> really shouldn't be too hard, because it's a very simple service.
> 
> --
>  Laurent
> 


s6-svscanboot, how to exit?

2017-07-14 Thread Jean Louis
Hello,

I have used daemontools for years and svscanboot
from rc.local

Now I have set rc.local to be started from
systemd, as it is on server, as I need only
supervision.

And I see the example script s6-svscanboot in s6
package.

I use it so as below. 

rc.local:

#!/command/execlineb -P
/command/redirfd -r 0 /dev/null
/command/exec -c -a /command/s6-svscan
/command/s6-svscan -t0 /service

The script does not "exist". That means when I do

sudo service rc-local stop

it stops, and when I do

sudo service rc-local start

it is then hanging, or running, it is fine, but I
would like to exit back to shell on such run.

Adding & on end of line is not helping.

How do I make it execute and exit back to shell?

Jean


Re: s6 as a systemd alternative

2017-06-26 Thread Jean Louis
On Mon, Jun 26, 2017 at 04:02:47PM +0200, Istvan Szukacs wrote:
> Hi,
> 
> I have a crazy question about s6. Would it be possible to make systemd
> compatible? This question might sound stupid at first but here is the
> reasoning:
> 
> - we have services with systemd service files already
> (/etc/systemd/system/*.service, etc.)
> - the previous alternatives all failed to gain traction because there was
> too much effort to change systems around to use them (
> https://www.tecmint.com/best-linux-init-systems/) and the linux platform is
> very fragmented
> - there is already too much effort went into systemd that would be hard to
> duplicate
> 
> Questions:
> 
> - is there anybody interested in such project?
> - is this feasible to do?

I am user of s6 for reason of simplicity and to avoid trouble of
systemd.

While not being developer, maybe it could be possible to have s6 run
systemd as a service and systemd to run s6 as a service, with
modifications, but I think, it will be better to hit oneself with hard
rock to the head, it would be more pleasure.

Jean


Re: s6 talk at FOSDEM 2017: video

2017-02-06 Thread Jean Louis
On Mon, Feb 06, 2017 at 02:40:35PM -0500, Steve Litt wrote:
> come with plenty of examples and enough redundancy that even the most
> unfamiliar can understand exactly what you're talking about.

If I may interfere, s6 supervision is not quite adequate for most
unfamiliar, and you are also not in that group.

And video looks like there was just 15 minutes time frame to explain
most important points.

Jean


Re: s6-ftrigrd: fatal: unable to flush asyncout: Broken pipe

2017-01-08 Thread Jean Louis
Thank you.

I will let you know by next reboots how it works (not to turn off now
and reboot on the low, solar powered battery).

Jean

On Sun, Jan 08, 2017 at 09:58:35AM +, Laurent Bercot wrote:
> > redirfd -wnb 1 /run/service/s6-svscan-log/fifo
> > redirfd -wnb 2 /run/service/s6-svscan-log/fifo
> 
>  You shouldn't need to do that: acpid -d will log to its stderr, which,
> by default, is your supervision tree's stderr, which already is
> /run/service/s6-svscan-log/fifo if you start your supervision tree
> similar to the way s6-linux-init does.
> 
>  Just have "fdmove -c 2 1 /usr/sbin/acpid -d" in your run script and
> you'll be fine. Please try that and see if your problem persists.
> 
> --
>  Laurent
> 


s6-ftrigrd: fatal: unable to flush asyncout: Broken pipe

2017-01-08 Thread Jean Louis
Hello,

I get the error

s6-ftrigrd: fatal: unable to flush asyncout: Broken pipe

I cannot know what is happening. Someone knows?

And I don't get it always, just sometimes. In the same time, I don't
see any output from acpid, and I see sometimes output from acpid,
sometimes not. Is my way of starting acpid, as below good one? I don't
need any output, but I do get it.

#!/bin/execlineb -P
redirfd -wnb 1 /run/service/s6-svscan-log/fifo
redirfd -wnb 2 /run/service/s6-svscan-log/fifo
/usr/sbin/acpid -d

Jean Louis


Need help with redirfd, to s6-echo

2016-12-30 Thread Jean Louis
I have this /etc/s6-rc/services/enable-lisp oneshot service, that I
wish to run on startup. It depends on mountfs where binfmt_misc file
system is mounted. It helps me run the executable lisp programs
directly.

This one gives me error:

if { redirfd -u 1 /proc/sys/fs/binfmt_misc/register s6-echo 
':CLISP1:E::cl::/usr/bin/clisp:' }
if { redirfd -u 1 /proc/sys/fs/binfmt_misc/register s6-echo 
':CLISP2:E::lisp::/usr/bin/clisp:' }
if { redirfd -u 1 /proc/sys/fs/binfmt_misc/register s6-echo 
':CLISP3:E::fas::/usr/bin/clisp:' }

unable to write to stdout: Invalid argument

while this one works perfectly in /etc/s6-rc/services/disable-interrupt/up

redirfd -u 1 /sys/firmware/acpi/interrupts/gpe06 s6-echo disable

I wish to echo those lines into register file. I am doing it wrong, but what?

Jean Louis


Re: nosh per-user service management

2016-12-12 Thread Jean Louis
I understand your point. But it is not practical, as it requires users
to become system administrators, which makes no sense. I am not
speaking of access rights in the operating system, but of the
knowledge and experience that is required by user to set such a
service.

While it may be easy for you and for me too, it is certainly not easy
matter for users. That is why they are called "users", not
administrators. 

That is why, for users, we have /etc/skel, to give them files and
settings, how we, system administrators, think they shall be setup.

All my staff members are using GNU Emacs, but they certainly don't
know and will not think of command line options, they are interested
in editing only. So, setting a daemon, is not an option for any of
users I have. The practicality becomes impossible.

The option for users to set the supervised daemon services is always
there, they can install userbase daemontools or similar. If they know
how. So great majority do not know how. That is why they need help of
system administrators.

Jean

On Sun, Dec 11, 2016 at 06:18:13PM +, Jonathan de Boyne Pollard wrote:
> Jean Louis:
> 
> > So, placing user daemons into system supervision may not be the best
> > option, due to so many customization that have to be done for the user,
> > especially for GNU Emacs -- as one cannot know which programming
> > languages and their variables are required.
> > 
> 
> I just explained that these are *not* system-wide services, but per-user
> ones.  A user who is setting up environment variables for xyr own needs to
> run emacs as a service simply sets up environment variables for xyr own
> needs against the per-user service.  Indeed, I already showed how that is
> done.  Once again:
> 
> > Adjust its environment, if desired, in the conventional way
> > 
> >  $ system-control --user set-service-env emacs DISPLAY :15.2
> > 
> > or (if /usr/local/sbin is on one's path)
> > 
> >  $ rcctl set --user emacs DISPLAY :15.2
> 
> The idea that this is somehow difficult because one might have to set an
> environment variable named GUILE_LOAD_PATH in this way, is just plain wrong.
> This is just an envdir in a conventional place in a service directory.  It's
> actually easier to manipulate than a $HOME/.{z,}profile or a
> $HOME/.login_conf for setting such an environment variable so that one could
> spawn the daemon in an interactive login session.


Re: GNU Emacs now runs in foreground

2016-12-06 Thread Jean Louis
On Tue, Dec 06, 2016 at 10:40:20AM +0100, Martin "eto" Misuth wrote:
>   - mpd - the music player daemon - basically music player 
> - when spawned as it's own service outside of/before X it can keep music
>   playing even as you are tweaking you xorg.conf :)
> - can route music over fifos through network and make many amchines play
>   same music

I will try that one, when I figure out how to configure it.

>   - rxvt-unicode - uberterminal 
> - this thing can operate as normal xterm-like term (process per session),
>   or as daemon, when single process hosts all your terminals
> - benefits are increased new terminal startup speed (on my current box,
>   this is subsecond delay - helps when you treat terms as disposable
>   "surfaces"), and supposedly memory conservation, as lots of data is 
> shared
>   between the windows

I was always using rxvt, and now not any more. Just xterm. It is bound
to keys alt-ctrl-t and it quickly jumps up in front of me (maybe
because other terms are already running). And I like the loggin
feature, SVG screen dump and HTML dump. It is bloated, but working well.

>   - quassel - irc client
> - irc client core runs as headless daemon, client present interface
> - requires Qt and is quite heavy

If I use GNU Emacs, the erc IRC client is there, so no need for me.

> Many other things can be "adapted" to daemon, for example aria2c downloader
> supports xmlrpc interface. There is slew of bittorrent clients, that can be 
> run
> this way.

In user-space, I am using HTTP server, fetching emails from servers,
backup, and cron (using mcron in Guile).

> Regarding "major" problem 1., that of crashing, rxvt-unicode is most "felt" 
> when
> it trips over. Fortunately it is incredibly stable - I have crash it maybe one
> or two times in 7 years time frame, daily use. I usually have 10-100 open
> terminals per xsession.

Wow so many?

I have put in .bashrc:

# Logging of .bashrc opening
# file: terminalsopened.log is: chattr +a 
echo Terminal: `/bin/date +'%F-%T'` >> 
/home/data1/protected/tmp/terminalsopened.log 2> /dev/null

So that I get a lot of how many times I open a terminal. Since
2016-01-03, until today, 18,979 times, or some 1700+ times per month,
or 56 - 60 times per day.

Jean Louis


Re: How to trap ctrl-alt-del?

2016-12-05 Thread Jean Louis
Thank you. How could I forget simple permissions? Now I am using it
that way.

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
> 


Re: GNU Emacs now runs in foreground

2016-12-03 Thread Jean Louis
Hello Jonathan,

Now when I use s6, I don't want to switch, maybe on some other
computers I can test the nosh. It looks like good system, especially
if you start providing such solutions for various daemons.


On Sat, Dec 03, 2016 at 11:33:51AM +, Jonathan de Boyne Pollard wrote:
> Jean Louis:
> 
> > emacs --new-daemon=NAME
> > 
> 
> I have added a new per-user service for this to nosh, ready for version 1.30
> .  So one just has to start the per-user service manager
> 
> # system-control start user@jlouis.target
> 
> then start the emacs server
> 
> $ system-control --user start emacs
> 
> Adjust its environment, if desired, in the conventional way
> 
> $ system-control --user set-service-env emacs DISPLAY :15.2
> 
>or (if /usr/local/sbin is on one's path)
> 
> $ rcctl set --user emacs DISPLAY :15.2

I see about adjusting environment. I guess that may be good, only
DISPLAY should not be necessary, it is daemon, and I start it without
display, and later also GNU Emacs running on X can access it, but also
from a console.

If I understand it well, in your system, you define services, and then
the service may be marked for start by user? And then it runs on each
boot by user?

Jean


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: 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 <bugs@gnu.support> 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 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: 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] <http://skarnet.org/cgi-bin/archive.cgi?
> 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 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] <http://skarnet.org/software/s6-linux-init/>.
> 
> 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


Re: How to trap ctrl-alt-del?

2016-11-26 Thread Jean Louis
Now I wonder how to practically implement the -s option, should I just
give it something like "sudo s6-poweroff"?

On Fri, Nov 25, 2016 at 12:17:24PM +0300, Jean Louis wrote:
> Now I found a solution 
> http://www.mail-archive.com/supervision@list.skarnet.org/msg01038.html
> 
> Thank you 


How to trap ctrl-alt-del?

2016-11-25 Thread Jean Louis
While previously the ctrl-alt-del was trapped by SysV (or whatever),
so that system runs "halt", now when I have switched to s6-rc an
s6-tools, it is not. In fact, system immediately reboots, which is not
desired.

How may I trap ctrl-alt-del, and assign a function to it, so that
system nicely shuts down?

Jean Louis



Re: [announce] Release 0.2 of rc-shim

2016-11-13 Thread Jean Louis
Did you forget the link?

And s6 scripts, just taught me to think myself, so I have adapted
everything to work nicely on my system, and rc-shim should help me
then not to think... :-)

Jean

On Sun, Nov 13, 2016 at 11:58:26AM -0800, Avery Payne wrote:
> I'm pleased to announce the release of rc-shim v0.2, a small script that is
> useful for adding supervision to existing installations using SysV-styled rc
> scripts.  The script replaces existing /etc/init.d scripts with a shim that
> interfaces to a supervisor of your choice.  It should support any
> daemontools-alike supervisor.
> 
> 
> Since the 0.1 announcement, the following has changed:
> 
> * Fixed several bugs in the 0.1 version that affected starting, stopping,
> and reporting status.
> 
> * The "reload" option has been removed as it was not compliant with the LSB
> 3.1 standard for arguments accepted by rc scripts.  It has been replaced
> with a stub for "force-reload".  The "force-reload" option requires
> customization to be used correctly, and currently performs a no-op.  This is
> by design.
> 
> * The shim header was altered to make it minimally compliant with LSB 3.1
> specifications.  It should allow the shim to work with tools that alter
> runlevel settings.  So far it has been successfully tested with Debian's
> update-rc.d program.
> 
> * The shim now correctly sets up and tears down symlinks in the service scan
> directory with each start/stop.
> 
> * The shim now has the option to use asynchronous start.  This is a
> trade-off between verification that the supervisor has started, and the
> speed at which the shim processes a start request.  It is disabled by
> default, but can be controlled per-script or system-wide.  Enabling the
> option skips verification in return for speeding up a start request, making
> the assumption that the service scan process will take care of it.
> 
> * Added debugging output, which is disabled by default.  This is useful
> during the installation process to confirm that the shim is working
> correctly with your supervisor and daemon.  It is set on a per-script level.
> 
> 
> The following limitations still apply:
> 
> *  You will need to supply your own supervisor and run scripts for this to
> work.
> 
> * The run scripts must be organized into a set of definitions, a set of live
> run directories, and a set of symlinks in a service scan directory.
> 
> * The shim only supports starting a single daemon.  If you are replacing an
> rc script that starts multiple daemons, you will need to create a custom
> service scan directory and start that to emulate the behavior.
> 
> This script should still be considered experimental.  It continues to
> receive minor testing with a live system.  If you decide to test it, it is
> recommended that you simply rename your existing init.d scripts that you are
> replacing to allow for a rollback, should the shim not function correctly
> for your installation.  Future releases will have additional testing and
> incremental improvements. Suggestions are welcome.


Re: Any tool in s6, to check a mountpoint?

2016-11-02 Thread Jean Louis
Thank you for idea.

On Tue, Nov 01, 2016 at 11:18:14AM -0700, Colin Booth wrote:
> On Nov 1, 2016 9:54 AM,  wrote:
> >
> > Is there any tool in s6 that can check for a mountpoint? Or any other
> > method?
> >
> > Jean
> Does mountpoint from util-linux not work for you? I've done the following
> in the past:
> 
> foreground { if -n { mountpoint.$SOMEDIR } mount $SOMEDIR } prog...
> 
> There isn't anything in s6-linux-utils or s6-portable-utils to cover this,
> but the util-linux option is totally valid.
> 
> Cheers!