Re: s6-svscanboot, how to exit?

2017-07-14 Thread Steve Litt
On Fri, 14 Jul 2017 22:29:04 +0300
Jean Louis  wrote:

> 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

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.

SteveT

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


Re: s6-svscanboot, how to exit?

2017-07-14 Thread Laurent Bercot

* http://jdebp.eu./FGA/inittab-is-history.html


 Eh, I should have known you had a svscan-under-systemd example
on your site, Jonathan. ;)

--
 Laurent



Re: s6-svscanboot, how to exit?

2017-07-14 Thread Brett Neumeier
On Fri, Jul 14, 2017 at 10:58 AM, Laurent Bercot <
ska-supervis...@skarnet.org> wrote:

> Do you have example settings for systemd to start s6-svscan?
>>
> ​[..]​
>
>  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.
>

​I do! -- because I'm using s6 for process supervision on centos 7, which
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​
cut here


-- 
Brett Neumeier (bneume...@gmail.com)


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 Steve Litt
On Fri, 14 Jul 2017 13:14:36 +
"Laurent Bercot"  wrote:

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

 
SteveT

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


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 Laurent Bercot

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