On Thu, Sep 24, 2015 at 2:23 AM, Laurent Bercot <ska-skaw...@skarnet.org> wrote: > On 24/09/2015 02:55, Colin Booth wrote: >> rc scripts are easy peasy: figure out dependency order, write >> oneshots. The only one that was an issue is the udev script, and I >> solved that by running udev as a oneshot, then running udev stop, then >> firing off the logrun udev. > > > Gah. One of the main objectives of s6-rc is precisely to cleanly > handle early services such as udev. You should be able to run udevd > as a longrun as soon as you need it; what problems did you encounter? > udev was easy, the other stuff that the Debian udev init script does after starting udev was less so. At least, it wasn't suitable as a longrun, and making it a oneshot explicitly removes the benefit of a process supervisor. Udev is still the first daemon that runs, it just runs twice on my system: one in a one-shot that calls the debian init script, and one in a longrun. Like I said, it's purely from a desire to not re-invent the wheel and use the packaged scripts as much as possible. > >> I can send you my (almost) 100% functional Debian rcS stuff >> replacement stuff that I use to run one of my systems. If you can >> figure out why the acpid keyboard hooks don't work after start, that'd >> be great. > > > I'm very interested in any examples of scripts that work with a > "traditional" rc system and don't with s6-rc. It's the exact kind of > data I need to polish the system and make it suitable as a drop-in > replacement. > Here are the few issues that I've noticed so far: * The acpi translation stuff doesn't do some step properly and breaks the sleep button on my laptop. It definitely makes it into the sleep script but doesn't have the correct privileges so nothing happens. Manually running pm-suspend as root works, hence the confusion. I got it to work once after re-running some of the oneshots, so it's probably an ordering problem where either Debian got it wrong but there's a race that they happen to get lucky with (unlikely) or I mis-read something and have a dependency order backwards (more likely). * The above mentioned issue where `/etc/init.d/udev' script isn't suitable as a oneshot (it starts a daemon) but also isn't suitable as a direct translation into a longrun since it does a pile of work after udev is up. I'm sure that a longrun or a longrun+follow-on oneshot can be written to do this right, I haven't had time to do it. * One of the Debian initscripts (mountall.sh) causes a Debain system with sysvinit installed but running with s6-svscan powers down the system! It tests to see if a pipe called initctl is not present in /run (which it won't be, since we're not running sysvinit) and tests to see if `update-rc.d' is present (which it will be, since sysvinit-core is installed). Assuming both tests pass, it fires SIGUSR1 at pid 1. USR1 tells sysvinit to close and re-open the control pipe, but tells s6-svscan to terminate in poweroff mode. Avoiding running this script leaves a few mounts untouched (/boot), and a few mounts with incorrect permissions (/run is 1640 or something, and owned by nobody:nogroup). * If you tear your system down past a certain point and then bring it back, you end up deleting the s6-* control files. Fixable by making a bootmisc.sh ./down file that re-seeds the flag files or by updating the bootclean.sh script to never try to clear /run, regardless of flag files. Avoidable if you simply don't stop your lowest-level initialization bundle. There are merits and flaws to both solutions.
I think that's it. They are all solvable with different levels of annoyance. My goal originally had been to do the minimum of work needed to run s6-rc as a drop-in replacement and barring those four things it was just a case of writing a bunch of up and down scripts. Once I'm finished moving and hopefully have a little more time in the evenings, I'm going to try and solve those in a minimally invasive way, but that won't be until next week at the earliest. Cheers! -- "If the doors of perception were cleansed every thing would appear to man as it is, infinite. For man has closed himself up, till he sees all things thru' narrow chinks of his cavern." -- William Blake