Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 232572 - halt.sh should check for /dev/initctl when in vserver (openrc-0.2.5)
Summary: halt.sh should check for /dev/initctl when in vserver (openrc-0.2.5)
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High minor (vote)
Assignee: Gentoo VPS Team (OBSOLETE)
URL:
Whiteboard:
Keywords:
: 232716 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-07-21 15:23 UTC by Romain Riviere
Modified: 2008-07-25 19:51 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Adaptation of the baselayout-1.13.0 patch (openrc-initctl.patch,533 bytes, patch)
2008-07-21 15:30 UTC, Romain Riviere
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Romain Riviere 2008-07-21 15:23:02 UTC
When stopping a baselayout-2 vserver, we get this :

WARNING: could not determine runlevel - doing soft halt
  (it's better to use shutdown instead of halt from the command line)
shutdown: /dev/initctl: No such file or directory
init: /dev/initctl: No such file or directory
/usr/lib/util-vserver/vserver.stop: line 96: 11371 Killed                  "${NICE_CMD[@]}" "${CHBIND_CMD[@]}" "$_VSPACE" --enter "$S_CONTEXT" "${OPTS_VSPACE[@]}" -- "$_VTAG" --migrate "${OPTS_VTAG_ENTER[@]}" --silent -- $_VCONTEXT $SILENT_OPT --migrate --chroot --xid "$S_CONTEXT" -- "${INITCMD_STOP[@]}"

In openrc-0.2.5, halt.sh should check whether /dev/initctl exists.

A patch was submitted for baselayout-1.13.0 to correct the same problem (see below). A very similar patch could be made for openrc. I'll try to upload a suggestion soon.

Reproducible: Always

Steps to Reproduce:




Patch for baselayout-1.13.0 : 
http://people.linux-vserver.org/~hollow/baselayout-1.13.0-gentoo-init-style-fixes.patch
Comment 1 Romain Riviere 2008-07-21 15:30:54 UTC
Created attachment 161010 [details, diff]
Adaptation of the baselayout-1.13.0 patch

Here's my humble attempt at generating a patch for this particular problem. "Works for me" (tm) so far.
Comment 2 Benedikt Böhm (RETIRED) gentoo-dev 2008-07-22 08:54:10 UTC
if you halt from inside you need "halt -f", if you stop from outside make sure shutdown.sh is not overriden on sysvinit upgrade, openrc can do nothing here
Comment 3 Romain Riviere 2008-07-22 19:36:01 UTC
(In reply to comment #2)
> if you halt from inside you need "halt -f", if you stop from outside make sure
> shutdown.sh is not overriden on sysvinit upgrade, openrc can do nothing here

My shutdown.sh is still the one from sysvinit, however I'm not too sure about this inside/outside thing. I am stopping the vserver from the outside, but it is running the scripts in its own context, and calling halt.sh as part of the shutdown process if I get this right.
It seems to me that either shutdown.sh shouldn't be called in the case of a vserver, or maybe it should be called directly with -f. Either way, isn't this openrc's halt.sh decision ?
Comment 4 Benedikt Böhm (RETIRED) gentoo-dev 2008-07-23 10:30:11 UTC
*** Bug 232716 has been marked as a duplicate of this bug. ***
Comment 5 Benedikt Böhm (RETIRED) gentoo-dev 2008-07-23 10:30:58 UTC
which init style are you using? (/etc/vservers/foo/apps/init/style)
Comment 6 Matthias Sch. 2008-07-23 13:29:49 UTC
sorry... gentoo style!
Comment 7 Romain Riviere 2008-07-23 17:33:32 UTC
Same for me by the way : gentoo style all the way.
Comment 8 Benedikt Böhm (RETIRED) gentoo-dev 2008-07-24 07:36:41 UTC
i guess this got broken with the sysvinit upgrade, please try to run the following command on the host:

/usr/lib/util-vserver/distributions/gentoo/initpost /etc/vservers/foo /usr/lib/util-vserver/util-vserver-vars

this should fix shutdown problems, otherwise reopen this bug
Comment 9 Romain Riviere 2008-07-24 16:58:49 UTC
(In reply to comment #8)
> i guess this got broken with the sysvinit upgrade, please try to run the
> following command on the host:
> 
> /usr/lib/util-vserver/distributions/gentoo/initpost /etc/vservers/foo
> /usr/lib/util-vserver/util-vserver-vars
> 
> this should fix shutdown problems, otherwise reopen this bug

Brilliant ! That did it, thanks :-)
There are a few "mkdir" that don't go to /dev/null in the script though, but that's cosmetic.

More importantly though, does this mean that sysvinit should never be emerged (even updated) inside a vserver ? Unless I missed it and/or did something wrong, I could not have known that beforehand.
Comment 10 Benedikt Böhm (RETIRED) gentoo-dev 2008-07-25 14:06:59 UTC
(In reply to comment #9)
> More importantly though, does this mean that sysvinit should never be emerged
> (even updated) inside a vserver?

no, it means you should not replace shutdown.sh/reboot.sh during etc-update
Comment 11 Romain Riviere 2008-07-25 19:51:48 UTC
(In reply to comment #10)
> (In reply to comment #9)
> > More importantly though, does this mean that sysvinit should never be emerged
> > (even updated) inside a vserver?
> 
> no, it means you should not replace shutdown.sh/reboot.sh during etc-update

Point taken.
Yet, seeing how openrc already makes decisions on what to do based on whether it's running inside a VServer or not, why not let it decide *NOT* to run shutdown.sh in case of a VServer ?
I thought one of the advantages of baselayout-2 / openrc was that we wouldn't need a baselayout-vserver anymore. What's the point if we have to overwrite stuff from sysvinit ?