Micro Core and GNU screen Fix

I finally got around to trying my own GNU screen extension in Micro Core. Same result (fail) as the one in the repository. This is because of the way the permissions are set for /dev/tty1. This is something which the development team could address so that ttys are spawned with appropriate permissions in both Tiny Core (which worked for me) as well as Micro Core (which didn’t).

Suggestions were made in the TCL forums that users could exit the shell and then sign back in. This requires that a password first be set for the $USER (whether tc or whatever the user sets via the user cheatcode) and that a user have access to the box to log out and log back in, or even to use the noautologin cheatcode (which would require that to be set in menu.lst as a default if the user doesn’t have direct access and needs a reboot). Since it’s headless and I don’t have direct access so I’m accessing via ssh, I wanted to get this working so that I wouldn’t have to do any of that.

Here’s my own work-around, pending any changes to inittab and /dev/tty* permissions by the development team. Should work with the extension from the repository just as it did for mine (I didn’t see how the repo version was compiled but I presume it was with screen’s defaults).

After making sure /dev/tty1 was owned by a group $USER (either tc or whatever user= is set to) is in (staff for TCL/MCL, even though I’d prefer a separate group, such as tty, for this — what’s the point in being a “multi-user” system if everything is set up for group staff), I chmod’ed /dev/tty1 to g+rw and I was then able to use /dev/tty1 for screen’s /dev/pts/* (which are owned by $USER.staff while screen is running). This can be done on  the fly or set via /opt/bootlocal.sh so it happens during each subsequent boot. Now screen works and it didn’t require logging out and back in, etc., or making changes to the way {Tiny,Micro}Core boots. Should work similarly if ownership is set to $USER (tc or user= cheatcode, adjust the following accordingly) and then mode set u+rw.

Just add to /opt/bootlocal.sh:

chown root.staff /dev/tty1
chmod g+rw /dev/tty1

or

chown tc.staff /dev/tty1
chmod u+rw /dev/tty1

Note: I’m not too gung ho about having to take additional steps to use an app like this. I also won’t vouch there aren’t any potential security issues arising from my suggestions, especially since Tiny/Micro Core have wide-open sudo privileges and (as I mentioned above) nearly everything is set up so group staff owns so much. If your work/use requires some degree or assurance of security, you might want to consider another distro which has more security features  — including logging (which Tiny and Micro Core don’t have) and more available default groups and less cowboy use of sudo privileges — set up and working by default.

UPDATE: Thanks to maro for yet another way to get around the issue by editing /root/.profile so that /dev/tty1 is chown’ed by $TCUSER.staff. Perhaps the development team will address this so there won’t be any need for remastering or making changes via bootlocal.sh or filetool in the future.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: