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

2017-10-23 Thread Jean Louis
On Mon, Oct 23, 2017 at 07:54:52AM +, Laurent Bercot wrote:
> > 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?
> 
>  Yes. But if you have compiled skalibs with --enable-slashpackage,
> then "make update" after "make install" will do that for you.
> The INSTALL file documents all the details.

That is good, now I can automate it easier. Thank
you.

Jean


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.


execlineb's import conflicts with ImageMagick

2017-10-22 Thread Jean Louis
The ImageMagick software has the "import" command
that is conflicting with "import" from execlineb
package.

Jean


Re: How to run s6-svscan in user space

2017-07-22 Thread Jean Louis
Thank you Colin.

First I made mistake not to make properly the
directories, and then the file dependencies was
there empty. When I remove the file, it started
working.

Jean

On Sat, Jul 22, 2017 at 10:21:52PM +, Colin Booth wrote:
> On Sat, Jul 22, 2017 at 12:52:45PM +0300, Jean Louis wrote:
> > 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
> Not actually necessary unless you're using s6-rc. ./type files are used
> in the pre-compiled s6-rc source to tell s6-rc-compile how to treat a
> service. The base s6 supervisory system ignores those files.
> > 
> > 
> > and I can run s6-svscan in the dir just fine. But
> > it does not run the ./run file.
> Are you running s6-svscan against ~/Programming/services/ or
> ~/Programming/services/cron? If you're doing the latter it won't work
> because s6-svscan expects to see service dirs within its target.
> > 
> > It is all in user space. If I run ./run from
> > command line, it works.
> > 
> > What do I miss?
> I'm guessing an incorrect target for s6-svscan, but you'll have to
> answer that for me.
> > 
> > Jean
> Cheers!
> -Colin


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  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-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 03:00:10PM -0500, Brett Neumeier wrote:
> use systemd as init. (I'm also using s6/s6-rc/s6-linux-init on my own
> built-from-source distribution, and prefer it *enormously*, btw).
> 
> What I have is:
> 
> cut here
> ​[Unit]
> Description=s6-svscan
> 
> [Service]
> Type=simple
> Environment=PATH=/opt/s6/bin:/sbin:/bin:/usr/sbin:/usr/bin
> ExecStart=/var/s6scandir/.s6-svscanboot
> Restart=always
> 
> [Install]
> WantedBy=multi-user.target​

I have that one. Thanks.

But i need .s6-svscanboot, can you show me?

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
> 


Re: s6-svscanboot, how to exit?

2017-07-14 Thread Jean Louis
On Fri, Jul 14, 2017 at 01:14:36PM +, Laurent Bercot wrote:
>  You don't, if you want it supervised. If you want to launch s6-svscan
> under systemd, you should write a proper unit file for it, so systemd
> can manage it as one of its services.

Well I made rc-local.service that is running
rc.local

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

Do you have example settings for systemd to start
s6-svscan?

Jean


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: A dumb question

2017-05-02 Thread Jean Louis
On Tue, May 02, 2017 at 09:34:52AM +, Laurent Bercot wrote:
>  systemd, on the other hand, hasn't left the maternity hospital - but
> how could it? it's such a fragile baby, it needs constant attention,
> it can barely leave the incubator. If you ask me, it should never have
> left the womb in the first place. :-Þ

Ha hhahaha


Re: [announce] skarnet.org Spring 2017 release

2017-03-28 Thread Jean Louis
By the way, I have upgraded, without control, I see it is working well
and fine on a reboot.

On Tue, Mar 28, 2017 at 12:27:28PM +, Laurent Bercot wrote:
> >  * s6-2.5.0.0
> > --
>  And obviously I forgot to mention the important change for users:
> s6-svstat can now print programmatically parsable output, via a new
> "-o field" option (and shortcuts for common fields). This feature was
> asked for a long time ago.
> 
> --
>  Laurent
> 


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


Re: Need help with redirfd, to s6-echo

2016-12-30 Thread Jean Louis
Thank you, good to know.

Even I have re-worked it into lisp in the meantime. I will do next
time with execlineb.

Jean

On Fri, Dec 30, 2016 at 04:55:40PM +, Laurent Bercot wrote:
> > if { redirfd -u 1 /proc/sys/fs/binfmt_misc/register s6-echo
> > ':CLISP1:E::cl::/usr/bin/clisp:' }
> 
>  ' is not a special character to execline, so it gets written as is.
> Remove the single quotes around your strings, or replace them with
> double quotes.
> 
> --
>  Laurent

/etc/s6-rc/service/enable-lisp:

/usr/bin/clisp /etc/system-lisp/enable-lisp.lisp

and /etc/system-lisp/enable-lisp.lisp:

;;; Enables .cl .lisp and .fas files to be run by CLISP directly
;;; This file is used by /etc/s6-rc/services/enable-lisp/up

(defparameter register "/proc/sys/fs/binfmt_misc/register")
;;(setf register "/tmp/do")

;; TODO: which clisp
(with-open-file (stream register
:direction :output
:if-does-not-exist :error)
(princ ":CLISP1:E::cl::/usr/bin/clisp:" stream)
(princ ":CLISP2:E::lisp::/usr/bin/clisp:" stream)
(princ ":CLISP3:E::fas::/usr/bin/clisp:" stream))


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: nosh per-user service management

2016-12-10 Thread Jean Louis
On Thu, Dec 08, 2016 at 03:41:01PM +, Jonathan de Boyne Pollard wrote:
> Jean Louis:
> > 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?
> 
> In this system, there is a per-user service manager, that manages services
> run by the user.  All of the processes live outwith any of the user's login
> sessions.  Each user has a place in xyr home directory where xe can define
> service bundles for services and targets.  The per-user service manager
> works from those service bundles.

I have understood that difference, thank you. I am just assuming that
systemd may be configured in same manner.

The system I am building now is anyway pretty much oriented for one
user only. So not that I personally have need for user leverl
services, or for system I am preparing for others.

Those other services that are or shall be started by user, I am simply
starting in startup files, like application daemon, mcron
https://www.gnu.org/software/mcron/ -- or http server relating to user
space only, all this is 1-2 startup files, and they are not
supervised. 

> And the configuration import subsystem tries to set up an initial set of
> per-user service bundles for each "real" user.  This setup now includes
> emacs in that new mode, albeit that I have no way to test it in operation,
> not having the bleeding edge version of emacs.

I am always using the latest, git clone -b master
git://git.sv.gnu.org/emacs.git from
http://savannah.gnu.org/projects/emacs/

It requires some environment variables, so using GNU Emacs as daemon
in userspace would require at least proper $HOME, $PATH, then $LC_ALL
on GNU/Linux system. And I am still not using the new version, I still
use the screen version.

It would require other variables for programming languages, like if
Perl is used within GNU Emacs, it requires $PERL5LIB or $PERL_UNICODE
and so on. 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. If someone
programs in GNU Guile scheme implementation, that person may need
$GUILE_LOAD_PATH, and if it is not available in Emacs run by system
supervision, it becomes unusable.

Jean Louis


Re: Adding capability control into the `run' script comparison page

2016-12-07 Thread Jean Louis
On Wed, Dec 07, 2016 at 09:14:00AM +, Jonathan de Boyne Pollard wrote:
> Casper Ti. Vector:
> 
> > But I do think the capability argument has its validity: chainloading
> > is, at this time, not well known to normal users, which is why many
> > systemd supporters compulsorily identify cgroup support with systemd
> > with few people opposing. Therefore I suggest to add some examples of
> > capacility control (eg. one example for ulimit, plus one example for
> > cgroup) into the comparison page, or an independent page.
> > 
> Such "systemd supporters" don't actually know systemd.
> 
> * http://jdebp.eu./FGA/linux-control-groups-are-not-jobs.html
> 
> To anyone running the service manager and bundles from nosh version 1.28 or
> later on Linux:  You are encouraged to look at your control group hierarchy,
> with a tool like "systemd-cgls /", with the "cgroup" field of the ps
> command, or by simply listing your /sys/fs/cgroup/ hierarchy.  You are in
> for an interesting surprise.

I have ready your article, and understand it.

Please be more detailed, I am interested, but due to not using
systemd, I ahve nothing in /sys/fs/cgroup

What is the interesting surprise, explained?

Jean


Re: GNU Emacs now runs in foreground

2016-12-06 Thread Jean Louis
On Tue, Dec 06, 2016 at 10:44:11AM -0500, Steve Litt wrote:
> I think I can live without GNOME, so for me this is no problem at all. I
> think a lot of people on this list can live without GNOME.

No GNOME here, no KDE, no such things, just to confirm, I am best
without it.

> Dbus isn't part of my world, and when software tries to make dbus part
> of my world, I tend to ditch that software. Dbus is a traffic circle
> allowing everything to talk to everything else, addressing allowing.
> It's a system-wide global variable on steroids.

I would like to kick it out, if I could, I just don't know how. 

> To me, Linux is and should remain a DIY accessible OS, and that
> requires shunning all things FreeDesktop.Org.

That was made by corporations for corporations and their
interests. They don't do anything in my specific interest. Like who
said I need ~/Desktop? I don't need it. But applications are creating
it automatically. Who says I want to keep ~/Video ~/Music and such? Or
that I want to open files with xdg-open? That type of control of how
commands shall be executed and what directories/folders shall users
have on their systems, I have tried to escape back in 1999, when I
switched from Windows. And now we see the same pattern.

Jean Louis


Re: djbwares version 4

2016-12-06 Thread Jean Louis
Now I get it. When marking with the mouse, I did not mark the ending /

On Tue, Dec 06, 2016 at 01:18:14PM +, Jonathan de Boyne Pollard wrote:
> Jonathan de Boyne Pollard:
> 
> > In celebration of the forthcoming leap second, djbwares is now at
> > version 4.
> > 
> > * http://jdebp.eu./Softwares/djbwares/
> > * http://jdebp.info./Softwares/djbwares/
> > 
> Jean Louis:
> 
> > http://jdebp.info./Softwares/djbwares
> > 
> > is not working: "access denied" and I instinctively tried that one
> > first, as to avoid .eu (even it makes no sense).
> > 
> 
> You should have just tried the URL that I gave to you, without your changing
> it to something different.
> 
> Ironically, Bernstein publicfile is part of the package at hand, and this is
> the documented behaviour of publicfile, in its original Bernstein manual:
> 
> > A request for http://v/f refers to the file named ./v/f inside the root
> directory hierarchy, if f does not end with a slash.
> 
> > httpd will refuse to read a file if the file [...] is anything other than
> a regular file: a directory, socket, device, etc.
> 
> publicfile isn't going to let you read the WWW server's directories directly
> with URL tricks.  You attempt that in vain.  (-:  For *not* trying to trick
> the WWW server, and simply reading the blurb and the download instructions,
> just use the actual URL that I gave.
> 


Re: djbwares version 4

2016-12-06 Thread Jean Louis
On Mon, Dec 05, 2016 at 10:49:20PM +, Jonathan de Boyne Pollard wrote:
> In celebration of the forthcoming leap second, djbwares is now at version 4.
> 
> * http://jdebp.eu./Softwares/djbwares/
> * http://jdebp.info./Softwares/djbwares/

http://jdebp.info./Softwares/djbwares

is not working: "access denied" and I instinctively tried that one
first, as to avoid .eu (even it makes no sense).


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  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: GNU Emacs now runs in foreground

2016-12-01 Thread Jean Louis
On Thu, Dec 01, 2016 at 12:05:31PM -0500, Steve Litt wrote:
> 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?

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.

Jean


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 


Re: How to trap ctrl-alt-del?

2016-11-25 Thread Jean Louis
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: How to redirect to /run/uncaught-logs/current?

2016-11-02 Thread Jean Louis
Thank you Colin.

On Wed, Nov 02, 2016 at 02:25:05PM -0700, Colin Booth wrote:
> On Wed, Nov 2, 2016 at 11:54 AM, Jean Louis  wrote:
> > And here is what I wish and don't know how to handle yet:
> >
> > I have acpid, and I wish that output from acpid is going to
> > /run/uncaught-logs/current, and I have it like this, and I get on boot
> > screen, the messages:
> >
> > acpid: starting up with netlink and the input layer, and such other
> > messages. What should I do to bring it to the logs? I have tried
> > various options.
> >
> > #!/bin/execlineb -P
> > #redirfd -wnb 1 /run/service/s6-svscan-log/fifo
> > fdmove -c 2 1
> > /usr/sbin/acpid -fl
> Check to see where the stdout and stderr for the s6-supervise managing
> acpid are pointing. They should be pointed at
> /run/service/s6-svscan-log/fifo which has been inherited from
> s6-svscan.

Do I understand well, the stdout and stderr are inherited from script
to script in s6-rc/services?

Basically, if I change something in a previous script, it is being
inherited by acpid script?

> if you're using s6-linux-init-maker, try regenerating your stage1
> script with the -r option to s6-linux-init-maker, which force
> redirects stdout and stderr from your stage2 script to the catch-all
> logger.

That makes me not see anything on screen, is it? I wish to see
some basic messages on screen, to know what is being fired, at which
moment, for later settings or tuning.

I have no distribution, all the system is made from sources, and in
future, it must be possible to re-run it (almost) automatically by
using some programming language. I can do this when I finish tuning.

Jean



How to redirect to /run/uncaught-logs/current?

2016-11-02 Thread Jean Louis
Hello,

I am following instructions from:
http://skarnet.org/software/s6-rc/faq.html "Switching from another
service manager", so I have first implemented start/stops in up/down,
from rc.d and init.d scripts. And now I am converting what has to be
done into the execlineb small scripts up/down or "run"s.

I have figured out how to update the database, and replace it, and
that is how I am debugging what I am doing.

There are things that I wish to share, and something to ask.

Laurent has helped me to understand how to implement user run emacs as
daemon. I am using (server-start) in ~/.emacs and service
/etc/s6-rc/services/admin:emacs with the run as following, and it is
working pretty well. It is being activated when encrypted partition is
there, it has directory "Work". I can then start emacsclient without
problems, and whenever it crushes, it is again there. Using emacs
--daemon was not good idea.

#!/bin/execlineb -P
if { s6-test -d /home/data1/protected/Work }
s6-setuidgid admin
backtick -n HOME { homeof admin }
/usr/bin/screen -S emacs -D -m --
/usr/bin/emacs --user admin --chdir /home/data1/protected

I am also starting a postgresql database, only when the encrypted
database directory is there, and it is working pretty well.

#!/bin/execlineb -P
if { s6-test -d /home/data1/database/postgresql/9.6 }
if { s6-test -d /run/postgresql }
background { s6-echo "Starting PostgreSQL Database" }
s6-setuidgid postgres
backtick -n HOME { homeof postgres }
/usr/bin/postgres -D /home/data1/database/postgresql/9.6

And here is what I wish and don't know how to handle yet:

I have acpid, and I wish that output from acpid is going to
/run/uncaught-logs/current, and I have it like this, and I get on boot
screen, the messages:

acpid: starting up with netlink and the input layer, and such other
messages. What should I do to bring it to the logs? I have tried
various options.

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

And I have question on udevd, I am running it like this, as I found a
working script on Github:

#!/bin/execlineb -P

fdmove -c 2 1
background -d {
fdmove 1 3
loopwhilex -o 1
ifelse { udevadm control --reload-rules } { echo }
foreground { sleep 1 }
exit 1
}
fdclose 3
unexport !
udevd

However, the above script is not writing anything into
/run/uncaught-logs/current -- am I doing something wrong?

I appreciate example of other people running udevd.

Then the handling of eth0, I have it like this:

redirfd -wnb 1 /run/service/s6-svscan-log/fifo
foreground { /sbin/ifconfig eth0 up }
exec -c
/sbin/ifconfig eth0 10.0.0.1 up


and I get this on screen, it is possibly stderr,

[   8.238909] :05:00.0: Missing Free firmware 

I am not concerned about firmware, I just wish to redirect that output
to /run/uncaught-logs/current.

I am appreciating your advises on how to make this happen, as I am
learning. And I do read every command in documentation, and certainly
I don't catch all definitions well.

Further, I would like to implement on the source based GNU/Linux
system here, the /etc/execline-shell and /etc/execline-startup, where
are those scripts? I have searched all skarnet packages, and could not
find it yet. I would like some examples from other people.

It would be good that people using skarnet tools, s6-rc services,
publish their services onto git or Internet, so that it becomes
reusable for others to set up the system.

Thank you,
Jean Louis


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!