On Tue, Jan 22, 2019 at 07:16:43PM +0000, Dmitry Bogatov wrote:

Hi,

> > (Alternatively, the getty run scripts could start with something like this:
> >
> > [ -c /dev/ttyX ] || rm /etc/service/getty-ttyX
> >
> > and /etc/runit/1 could re-create these symlinks, just to be absolutely sure.
> >
> > I don't like this approach; there is too much going on automatically.)
> 
> I believe I found quite decent solution. Take a look at `bugfix/914788'
> branch.

Thanks for looking into this!

I believe instead of

rm /etc/service/getty-@TTY@

you should do

rm "$(pwd)"

because then it won't matter what the service is called and where the
runsvdir root is (/etc/service or somewhere else).

Also, this seems redundant:

#!/usr/bin/env /lib/runit/invoke-run

why not just "#!/lib/runit/invoke-run"?

While invoke-run, as an interpreter, is an original idea, I'd make it a
scriptlet a run script can source via ". /lib/runit/invoke-run". Then it
wouldn't be necessary to export all variables the configuration sets and
thereby clutter the environment of the daemon.

The envdir bit could be handled by a construct like

if [ -z "$1" ]; then
        SVDIR="$(dirname $(readlink -f "$0")"
        if [ -e "$SVDIR/conf" ]; then
                exec chpst -e "$SVDIR/conf" -- "$0" "envdir-done"
fi

(But then /etc/default/foo would have to take precedence over sv/foo/conf,
because the /etc/default/foo variables would be lost during the exec since
we want to avoid exporting them.)

> Please,
> 
>  * build it (it will build runit-2.1.2-22, sorry for version havoc)
>  * install bin:runit
>  * install bin:getty-run
>  * write "yes" into /etc/getty-tty1/conf/GIVE_UP_ON_MISSING_TTY file

While this would work, it doesn't improve my situation: you're making me
jump through hoops to get sensible behaviour. Creating these files isn't
less effort than deleting the getty services on installation, so it just
adds complexity and abstraction with no real benefit.

I still think the postinst modification I suggested (not installing getty
services for non-existing tty devices) would be the cleanest solution.

AndrĂ¡s

-- 
            No pixels were harmed in the creation of this program.

Reply via email to