supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* Installing on Centos
@ 2013-05-07  9:30 Peter Hickman
  2013-05-07 10:56 ` Alex Efros
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Hickman @ 2013-05-07  9:30 UTC (permalink / raw)
  To: supervision

[-- Attachment #1: Type: text/plain, Size: 621 bytes --]

I've installed runit on a Centos 5.8 box thus

wget http://smarden.org/runit/runit-2.1.1.tar.gz
tar zxf runit-2.1.1.tar.gz
(cd admin/runit-2.1.1; ./package/install; ./package/install-man)

No problem with that (so far) but when I compare it to my Ubuntu 10.04
installation I seem to be missing things like

1) /etc/sv and /etc/service
2) When is ps ax it does not appear to be running anywhere...
3) The sv command only seems to be available to root, unlike on Ubunto
where other accounts can access it

Have I missed a step in the installation somewhere. Googling produces too
many results and not a lot of information.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Installing on Centos
  2013-05-07  9:30 Installing on Centos Peter Hickman
@ 2013-05-07 10:56 ` Alex Efros
  2013-05-07 11:17   ` Peter Hickman
  0 siblings, 1 reply; 9+ messages in thread
From: Alex Efros @ 2013-05-07 10:56 UTC (permalink / raw)
  To: supervision

Hi!

On Tue, May 07, 2013 at 10:30:15AM +0100, Peter Hickman wrote:
> No problem with that (so far) but when I compare it to my Ubuntu 10.04
> installation I seem to be missing things like

I didn't installed runit from source for years, so I may be wrong, but:

> 1) /etc/sv and /etc/service

Runit doesn't hardcoded to use some predefined directory, you can put your
services in any directory you like - /service or /etc/sv - you choose.
So, neither of these directories created automatically when installing
runit - you've to create them yourself. Some linux distributives when
creating packages for runit make this decision instead of you and
preconfigure runit in some way, which include creating such directories.

> 2) When is ps ax it does not appear to be running anywhere...

That's because you didn't started it, I suppose. :)

> 3) The sv command only seems to be available to root, unlike on Ubunto
> where other accounts can access it

Check your $PATH, different distributives configure it in different ways -
some include */sbin/ directories in $PATH for non-root users, others don't.
Same for /usr/local/{bin,sbin}/. Check where your runit's binaries was
installed and is that directory included in non-root's $PATH.

-- 
			WBR, Alex.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Installing on Centos
  2013-05-07 10:56 ` Alex Efros
@ 2013-05-07 11:17   ` Peter Hickman
  2013-05-07 17:47     ` Joshua Timberman
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Hickman @ 2013-05-07 11:17 UTC (permalink / raw)
  To: supervision

[-- Attachment #1: Type: text/plain, Size: 246 bytes --]

Thanks that a place to start at least. The problem for me is that all our
previous installs were from a chef script and things just magically worked.
The scripts borked on Centos and I have to try and work out how the working
system got tat way.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Installing on Centos
  2013-05-07 11:17   ` Peter Hickman
@ 2013-05-07 17:47     ` Joshua Timberman
  2013-05-09 13:03       ` Peter Hickman
  0 siblings, 1 reply; 9+ messages in thread
From: Joshua Timberman @ 2013-05-07 17:47 UTC (permalink / raw)
  To: Peter Hickman; +Cc: <supervision@list.skarnet.org>

Hi Peter,

On May 7, 2013, at 5:17 AM, Peter Hickman <peterhickman386@googlemail.com>
 wrote:

> Thanks that a place to start at least. The problem for me is that all our
> previous installs were from a chef script and things just magically worked.
> The scripts borked on Centos and I have to try and work out how the working
> system got tat way.

The Chef cookbook for runit builds an RPM for you, from this repo:

https://github.com/imeyer/runit-rpm

No one seems interested in getting runit into RHEL family platforms in any official capacity (e.g., EPEL), unfortunately. I'd love a better solution for this, but alas, this is the "best" solution for now.

If you're having trouble with the Chef recipe[0] on CentOS, please provide more information like the version of the runit cookbook you're using, and debug log output from chef-client/chef-solo. I'm happy to help off-list, too.

Cheers,
Joshua Timberman | Opscode, Inc.
Twitter/GitHub: jtimberman


[0]: Pedantically, Chef recipes are not simply "scripts" :). A great explanation about how they work is here: 

http://erik.hollensbe.org/2013/03/16/the-chef-resource-run-queue/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Installing on Centos
  2013-05-07 17:47     ` Joshua Timberman
@ 2013-05-09 13:03       ` Peter Hickman
  2013-05-09 14:49         ` Charlie Brady
  2013-05-09 15:37         ` Joshua Timberman
  0 siblings, 2 replies; 9+ messages in thread
From: Peter Hickman @ 2013-05-09 13:03 UTC (permalink / raw)
  Cc: <supervision@list.skarnet.org>

[-- Attachment #1: Type: text/plain, Size: 827 bytes --]

All our chef scripts were written with ubuntu 10.04 in mind and we had not
correctly separated the os dependencies from the application deployment.
Then we had to deploy to Centos :)

So our chef scripts broke in all sorts of interesting ways. I don't ascribe
this to a problem with chef when it could so easily be our scripts being
badly written so don't worry about chef.

However we need to get runit working on Centos regardless so we have hacked
up some scripts to do this.

Runit installs fine, or at least without error but things are not working
out.

For instance there is no /etc/init.d/runsvdir or similar. The truth be told
there isn't one on Ubuntu either but some how Ubuntu is managing to start
up "runsvdir -P /etc/service" without any problem. So one question would be
how to get this to happen on Centos 5.8?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Installing on Centos
  2013-05-09 13:03       ` Peter Hickman
@ 2013-05-09 14:49         ` Charlie Brady
  2013-05-09 15:05           ` Peter Hickman
  2013-05-09 15:37         ` Joshua Timberman
  1 sibling, 1 reply; 9+ messages in thread
From: Charlie Brady @ 2013-05-09 14:49 UTC (permalink / raw)
  To: Peter Hickman; +Cc: <supervision@list.skarnet.org>


On Thu, 9 May 2013, Peter Hickman wrote:

> However we need to get runit working on Centos regardless so we have hacked
> up some scripts to do this.
> 
> Runit installs fine, or at least without error but things are not working
> out.
> 
> For instance there is no /etc/init.d/runsvdir or similar. The truth be told
> there isn't one on Ubuntu either but some how Ubuntu is managing to start
> up "runsvdir -P /etc/service" without any problem. So one question would be
> how to get this to happen on Centos 5.8?

Add /etc/init/runit.conf:

# runit - start runit supervisors
#
# This task runs the runit start script, which runs runsvdir

start on runlevel [345]

stop on runlevel [!$RUNLEVEL]

task

export RUNLEVEL
console output
exec /etc/runit/2 $RUNLEVEL




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Installing on Centos
  2013-05-09 14:49         ` Charlie Brady
@ 2013-05-09 15:05           ` Peter Hickman
  2013-05-09 15:08             ` Charlie Brady
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Hickman @ 2013-05-09 15:05 UTC (permalink / raw)
  To: Charlie Brady; +Cc: <supervision@list.skarnet.org>

[-- Attachment #1: Type: text/plain, Size: 806 bytes --]

Thanks but it would seem that Centos 5.8 does not have an /etc/init
directory only an /etc/init.d

But thanks to your hint I have found the command that does the work

# cat runsvdir-start
#!/bin/sh

PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin

exec env - PATH=$PATH \
runsvdir -P /etc/service 'log:
...........................................................................................................................................................................................................................................................................................................................................................................................................'

Now all I need to do is turn this into an init.d script

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Installing on Centos
  2013-05-09 15:05           ` Peter Hickman
@ 2013-05-09 15:08             ` Charlie Brady
  0 siblings, 0 replies; 9+ messages in thread
From: Charlie Brady @ 2013-05-09 15:08 UTC (permalink / raw)
  To: Peter Hickman; +Cc: <supervision@list.skarnet.org>


On Thu, 9 May 2013, Peter Hickman wrote:

> Thanks but it would seem that Centos 5.8 does not have an /etc/init
> directory only an /etc/init.d

Sorry, my bad. I was thinking of rhel6/centos6.

> 
> But thanks to your hint I have found the command that does the work
> 
> # cat runsvdir-start
> #!/bin/sh
> 
> PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin
> 
> exec env - PATH=$PATH \
> runsvdir -P /etc/service 'log:
> ...........................................................................................................................................................................................................................................................................................................................................................................................................'
> 
> Now all I need to do is turn this into an init.d script

You can add this in /etc/inittab:

sv:345:respawn:/etc/runit/2


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Installing on Centos
  2013-05-09 13:03       ` Peter Hickman
  2013-05-09 14:49         ` Charlie Brady
@ 2013-05-09 15:37         ` Joshua Timberman
  1 sibling, 0 replies; 9+ messages in thread
From: Joshua Timberman @ 2013-05-09 15:37 UTC (permalink / raw)
  To: Peter Hickman; +Cc: <supervision@list.skarnet.org>

[-- Attachment #1: Type: text/plain, Size: 692 bytes --]

On Thursday, May 9, 2013 at 7:03, Peter Hickman wrote:
> All our chef scripts were written with ubuntu 10.04 in mind and we had not
> correctly separated the os dependencies from the application deployment.
> Then we had to deploy to Centos :)
> 
> 

Opscode's runit cookbook supports CentOS (and other EL family distros) first class now, in version 1.0 and higher of the cookbook. It is a complete installation solution via the default recipe, and the runit_service resource is a fully developed feature complete service resource. 

http://ckbk.it/runit

I'm biased of course since I wrote the code, but I think this is the best way to manage runit if you're using chef already. 

-Joshua 


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-05-09 15:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-07  9:30 Installing on Centos Peter Hickman
2013-05-07 10:56 ` Alex Efros
2013-05-07 11:17   ` Peter Hickman
2013-05-07 17:47     ` Joshua Timberman
2013-05-09 13:03       ` Peter Hickman
2013-05-09 14:49         ` Charlie Brady
2013-05-09 15:05           ` Peter Hickman
2013-05-09 15:08             ` Charlie Brady
2013-05-09 15:37         ` Joshua Timberman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).