Sometimes I’m not really sure what I am doing, aside from trying to break things. On a weird thought the other day, I dug into the /etc/inittab file on my one machine running Arch Linux, and substituted Midnight Commander for the first agetty command there.
After all, you can swap that out for mingetty or *getty or any other “login manager,” so why not a regular application like I normally use? Couldn’t that take the place of an autostart from the bash prompt?
Well, I’m not really sure what I was expecting to happen, but what I got was an instance of mc running in tty1, and because I had tagged that line with the “respawn” flag, it simply rolled back into place every time I tried to quit out of it.
How quaint, I thought. A permanent file manager with the press of ALT+F1. But it was running as root, and so my next thought was to trigger mc the same way I trigger X at boot, with this line.
c3:2345:respawn:/bin/su kmandla -l -c "/bin/bash --login -c /usr/bin/mc"
I put that in c3 and commented out c1, because mc was landing in tty1 no matter which line started it. And because I usually only run two tty’s at a time anyway.
And got roughly the right results: mc running as the regular user in tty1. Every time I tried to exit, it simply started up again.
How about two? I thought. But adding another program just created havoc. If I added htop and mc, they both tried to compete for that first “tty”, and just made a mess out of the screen.
Well, I thought, the obvious solution here is to start screen and then let both of them live inside that marvelous program.
But screen wasn’t having any of that business, crashing rather loudly, rather quickly and quite repeatedly — which triggered the respawn warning and an admonishment from the system.
I tried swapping “respawn” for both “wait” and “once,” but then the only message was a refusal from screen — that it “couldn’t find /dev/console,” and was giving up.
At which point I gave up as well. I don’t know what I intended to achieve with this, and I don’t even know what I could expect to achieve with it. But perhaps sometime in the future this will come in handy.
Which is why I make a note of it here. Because that’s what this blog is for.