supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* endless loop at stage 2 of runit of run scripts of each service directories.
@ 2008-08-11  6:28 Amrish Purohit
  2008-08-11 14:13 ` Charlie Brady
  0 siblings, 1 reply; 4+ messages in thread
From: Amrish Purohit @ 2008-08-11  6:28 UTC (permalink / raw)
  To: supervision

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

hi all,

  i am using fedora distribution. i want to deploy runit on my 
distribution. i have following changes in my distribution.
mkdir /etc/runit/services
in this directory i have created directories for service cpuspeed, getty 
and bash prompt to emulate runlevel 1 of sys V init.
ls /etc/runit/services
cpuspeed  getty1 getty2 getty3 getty4 getty5 bash
in each directory i have created a run script and a supervise directory.
ls  services/cpuspeed
run  supervise
here is the format of run script
---------------------------------------
#!/bin/bash
exec /etc/rc.d/init.d/cpuspeed start
-------------------------------------------
like this i have prepared other directories getty and bash
supervise directory contains following empty files
control  lock  ok  pid  stat  status

now it is turn of scripts 1 and 2
in script /etc/runit/1
#!/bin/bash
PATH=/command:/bin:/sbin:/usr/bin:/usr/sbin
export PATH
/etc/rc.sysinit
-----------------------------------------------
in script /etc/runit/2
#!/bin/bash
PATH=/command:/bin:/sbin:/usr/bin:/usr/sbin
export PATH
runsvdir -P /var/services
----------------------------------------------
ln -s /etc/runit/runlevels/runlevel1 /var/services
/etc/runit/runlevels directory contains directory of runlevel1 runlevel2
in directory runlevel1 there is link to services directories described 
above,
at kernel command line i have changed init=/sbin/runit

Problem:
======
      as the system starts up, stage 1 starts nicely and rc.sysinit 
scripts does it works.
but problem occurs at stage2 . In stage2 run scripts of each services 
directories executes in infinite loop and i cannot get the bash shell.
at time of bash script, error is " no job control ". here is endless 
loop of run scripts of each service directories. i have navigated web but
i cannot get any help.

Please help me fix this problem. so i can simulate each runlevel.
regds
Amrish Purohit

[-- Attachment #2: Type: text/plain, Size: 38 bytes --]

Scanned by Cyberoam AV Scanning Engine

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

* Re: endless loop at stage 2 of runit of run scripts of each service directories.
  2008-08-11  6:28 endless loop at stage 2 of runit of run scripts of each service directories Amrish Purohit
@ 2008-08-11 14:13 ` Charlie Brady
  2008-08-12  5:32   ` Amrish Purohit
  0 siblings, 1 reply; 4+ messages in thread
From: Charlie Brady @ 2008-08-11 14:13 UTC (permalink / raw)
  To: Amrish Purohit; +Cc: supervision


On Mon, 11 Aug 2008, Amrish Purohit wrote:

> here is the format of run script
> ---------------------------------------
> #!/bin/bash
> exec /etc/rc.d/init.d/cpuspeed start

Doing that will always get you into trouble. init.d scripts are always 
designed to terminate quickly. That's exactly the opposite of what you 
want. Any program which you exec from a supervise run script is expected 
to keep running until you send it a signal asking for it to stop.

You will need to look through /etc/rc.d/init.d/cpuspeed and find out what 
commands it calls, and find a way to call the same command in a way where 
the command will not terminate (e.g. don't run it in the background, or 
run it with an argument which tells it to run in the foreground).

[Try:

exec /usr/sbin/cpuspeed

Or just use a symlink to /usr/sbin/cpuspeed as your /service/cpuspeed/run.
]



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

* Re: endless loop at stage 2 of runit of run scripts of each service directories.
  2008-08-11 14:13 ` Charlie Brady
@ 2008-08-12  5:32   ` Amrish Purohit
  2008-08-12 13:01     ` Charlie Brady
  0 siblings, 1 reply; 4+ messages in thread
From: Amrish Purohit @ 2008-08-12  5:32 UTC (permalink / raw)
  To: Charlie Brady; +Cc: supervision

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

Charlie Brady,
                      Thanks for  your kind suggestion.This help me a 
lot. i think this matter is not described in runit webpage.
currently i am working on runit to customize it on fedora. we should 
make effort for proper documentation so any one may not get any confusion.

Thanks again
Amrish Purohit
Charlie Brady wrote:
>
> On Mon, 11 Aug 2008, Amrish Purohit wrote:
>
>> here is the format of run script
>> ---------------------------------------
>> #!/bin/bash
>> exec /etc/rc.d/init.d/cpuspeed start
>
> Doing that will always get you into trouble. init.d scripts are always 
> designed to terminate quickly. That's exactly the opposite of what you 
> want. Any program which you exec from a supervise run script is 
> expected to keep running until you send it a signal asking for it to 
> stop.
>
> You will need to look through /etc/rc.d/init.d/cpuspeed and find out 
> what commands it calls, and find a way to call the same command in a 
> way where the command will not terminate (e.g. don't run it in the 
> background, or run it with an argument which tells it to run in the 
> foreground).
>
> [Try:
>
> exec /usr/sbin/cpuspeed
>
> Or just use a symlink to /usr/sbin/cpuspeed as your 
> /service/cpuspeed/run.
> ]
>

[-- Attachment #2: Type: text/plain, Size: 38 bytes --]

Scanned by Cyberoam AV Scanning Engine

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

* Re: endless loop at stage 2 of runit of run scripts of each service directories.
  2008-08-12  5:32   ` Amrish Purohit
@ 2008-08-12 13:01     ` Charlie Brady
  0 siblings, 0 replies; 4+ messages in thread
From: Charlie Brady @ 2008-08-12 13:01 UTC (permalink / raw)
  To: Amrish Purohit; +Cc: supervision


On Tue, 12 Aug 2008, Amrish Purohit wrote:

>                     Thanks for  your kind suggestion.This help me a lot. i 
> think this matter is not described in runit webpage.
> currently i am working on runit to customize it on fedora.

Try

http://opensourcethis.com/fedora-fast-boot-using-runit.html
http://www.gotidea.net/Linux/bootfast.html
http://fedorafastboot.wiki.sourceforge.net/



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

end of thread, other threads:[~2008-08-12 13:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-11  6:28 endless loop at stage 2 of runit of run scripts of each service directories Amrish Purohit
2008-08-11 14:13 ` Charlie Brady
2008-08-12  5:32   ` Amrish Purohit
2008-08-12 13:01     ` Charlie Brady

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