LinuxMCE Forums

General => Users => Topic started by: JaseP on September 05, 2012, 03:51:15 pm

Title: Konsole item in computing menu,... help please...
Post by: JaseP on September 05, 2012, 03:51:15 pm
Over the weekend,... I had created a menu item in the computing screen for the konsole terminal emulator. After a bit of fussing with it and figuring it out, I got it to the point where it would launch the konsole application, but it would only flash on the screen for a split second and "disappear" underneath the onscreen orbiter. I could access it only if I switched to the KDE desktop. The reason I created it, in the first place, was to not have to drop out to the KDE desktop to get a virtual terminal (or have to switch ttys).

I'm pretty sure I got the WM_CLASS correct,... And I tried it a couple of different ways,... So, if anyone has any tips or pointers, suggestions, etc... I'd appreciate it.
Title: Re: Konsole item in computing menu,... help please...
Post by: JaseP on September 05, 2012, 04:36:39 pm
I think I may have found the problem,... There may be a a unique quirk of konsole that it does not resolve its WM_CLASS name properly. I may have to use Gnome-terminal...

Title: Re: Konsole item in computing menu,... help please...
Post by: l3mce on September 05, 2012, 04:38:57 pm
Tschak can help you with this.
Title: Re: Konsole item in computing menu,... help please...
Post by: tschak909 on September 06, 2012, 02:01:01 am
dcerouter_1030881:/usr/src/LinuxMCE-1004/src/Game_Player# wmctrl -l -x
0x03800047 -1 Plasma.Plasma         dcerouter plasma-desktop
0x0380006f -1 Plasma.Plasma         dcerouter plasma-desktop
0x04600023  0 konsole.Konsole       dcerouter linuxmce : bash
0x01200001  3 pluto-xine-playback-window.pluto-xine-playback-window        N/A pluto-xine-playback-window
0x0160000d  2 Orbiter.Orbiter             N/A OrbiterGL
0x0220000d  2 Photo_Screen_Saver.Photo_Screen_Saver        N/A PlutoGalleryViewer

according to this, WM_CLASS is console, WM_NAME is Konsole, making the window class field, konsole.Konsole

-Thom
Title: Re: Konsole item in computing menu,... help please...
Post by: JaseP on September 06, 2012, 02:56:13 am
Thanks,... I ended up going with gnome-terminal,... as I read some stuff about konsole not resolving its WM_CLASS right,... from 8.04 up to 12.04... I think I had even tried konsole.Konsole at some point last night before getting tired & giving up...

Gnome-terminal works, though, including tabs and even transparency after editing the default profile... Plus I actually like it better. But thanks for the help, anyway.
Title: Re: Konsole item in computing menu,... help please...
Post by: l3mce on September 06, 2012, 03:42:15 am
I think the point is... yer doing it wrong.

Anything can be wrapped... you are just trying to pop something up OVER the display, rather than wrapping it into its own window within the UI.


Again... ask tschak how to do this correctly. We are not adding gnome terminal because it is easier... make konsole.Konsole work. I will be proud of you.
Title: Re: Konsole item in computing menu,... help please...
Post by: JaseP on September 06, 2012, 06:35:23 pm
Wasn't trying to get you to add a feature...

I just wanted an on-screen terminal app for (just) myself, because I prefer that to tty switching or dropping out to KDE for something simple as runing a command... If someone else wants it, I'll be happy to document it.

Anyway, I'll also be happy to figure out getting Konsole working, ... especially figuring out if it was bone-headed mistake of mine, or a (real) problem with KDE...



Title: Re: Konsole item in computing menu,... help please...
Post by: JaseP on September 07, 2012, 08:30:38 am
Well,... I did a sanity check, and it's not anything I did...

There's a major incompatibility with the way KDE brings up its core apps and the Computing Class (where the DCE ruter cedes input control to the app)... Dolphin does the same thing as KDE... dives straight under the "Pluto desktop"...

I was able to install Thunar and Nautilus just fine,... and both called up fine from Gnome-terminal. Thunar is nice, in that it displays prominently that you're running as root (which can "result in damage to your system"), while Nautilus likes to take over the desktop if you don't use the --no-desktop switch...

I'll double-check Thunar as a Computing app to be safe, but I am pretty sure of the outcome ... I'm sure it'll be fine, where KDE apps aren't ...

PS: I am not trying to add these apps as a Feature... I understand full well that the computing class bypasses the normal control by the DCE router over input... I was NOT looking to get a wrapper together... Please understand that. This was intended, from the beginning, to be a HACK. I just wanted to clarify...

That said,... I don't know how deep the trouble goes ... Just to KDE and its plasma layer,... or all the way to QT.
Title: Re: Konsole item in computing menu,... help please...
Post by: l3mce on September 07, 2012, 10:03:00 am
JaseP...


I WANT this feature. I mentioned it a long time ago, and tschak told me exactly how to do it.

You are doing it wrong. It isn't a bug, it isn't a specific version... it is your implementation. We can wrap ANYTHING. You aren't implementing it into the UI, you are trying to overlay it on TOP of the UI.

Do it right. Learn how to do it right. Implement it.

You are trying to run Thunar and Nautilus, and evidently Dolpin, as root (terrifically stupid idea for the record). If you insist on doing this you should open them as the user, with kdesudo... but... really... you just shouldn't do this. Look at how firefox is opened as a user, and kdesudo from there. What you are doing is disavowed by the host OS's, and what you are encountering is not a bug, but an attempt to adhere to this fundamental requirement.

This is a huge security problem... which is why it is not working properly. If you just want to run everything filesystem/internet related as root... just install windows.
Title: Re: Konsole item in computing menu,... help please...
Post by: JaseP on September 07, 2012, 04:47:15 pm
I'm trying to respond without sounding like a big giant [expletive deleted], but there's no good way (equally my personality as other reasons)... So, I'll just try to keep it short.

I had a very brief look at the the Mozilla.sh... I haven't figured out the whole thing, I'll keep looking, but I can't promise anything.

What I'm doing is just a nasty hack for my own purposes. I didn't build the Computing Class, I'm just using it. The "broken" apps  (KDE's Konsole & Dolphin) DO run... just hidden in the background,... not a very good security measure, if that's the reason they're not running right. The non-KDE apps run without any restriction. The security holes are way bigger than a file browser and a terminal running that way for a few minutes... & are an architecture issue that's definitely not my fault.

I have more ideas about this,... But that's a topic for another thread & probably something more of a wish list for 1204.
Title: Re: Konsole item in computing menu,... help please...
Post by: l3mce on September 07, 2012, 05:25:23 pm
Then I misunderstood part of the problem if it is still running in the background. I thought you said it was closing.

I understand you "just want it for your personal reasons". Really I do. I could write it at this point. I very much want it... I had just forgotten about that want.

What I am trying, very hard, to do... is to get you to actually do something. Something that will benefit everyone, and get your feet wet understanding HOW all of this works.

Why should we be motivated to help you implement a hack when you are not motivated to implement it for real? It is not one of the "hard" things to do. You are very enthusiastic. You are very clever. You could be a valuable asset. I believe this, which is probably why we butt heads so often. You have a good potential to help the project and yourself learning this architecture.


But you are stubborn as a mule and absolutely REFUSE to learn. You keep treating LMCE like a desktop. Like it is a strange version of Gnome. It isn't. You drive me nuts... you really do. Can't you just do this ONE thing, the right way? I find myself really wanting this feature, and refusing to do it myself, because it is YOURS to contribute. Please.
Title: Re: Konsole item in computing menu,... help please...
Post by: JaseP on September 07, 2012, 07:33:01 pm
Ok... I'll do it,...

But I want to do it with Guake...
http://guake.org/
That'll give the potential (maybe) to have it drop down over top of a running Media director, regardless of what's running underneath.  You can tell me if that's feasible. But otherwise, I think it should be intercepting the keyboard like the Firefox wrapper.

I'd like it to be able to be called up with a hot-key over-top any running OSD Orbiter running on an MD (e.g.: during media playback). That might give you the ability to manually issue live commands, such as DCE router commands to a running device (like the Xine Player).

I've found some of the development stuff in the Wiki, know that a device has to be created, etc,... but I need to have some kind of starting place,...

So,... I have questions;
  1) What scripts, wiki entries and files should I be looking at first (Mozilla.sh comes to mind for a starting place)?
  2) Could it be restricted to certain users, and if so, set to su (or kdesudo) to the running user if authorized? & What examples should I look at to figure that out?
  3) If it can be given a hot key to launch, where are those defined, and where/what should I be looking at to get started?
  4) Can it be set to always be on top (meaning are you alright with that, not necessarily how is that done, I assume wmctrl would be used)?

Please keep in mind I don't know C, C++, PHP, Ruby, etc. ... but I can shell script adequately. 
Title: Re: Konsole item in computing menu,... help please...
Post by: l3mce on September 07, 2012, 08:53:13 pm
He who writes the code makes the rules.

I would like to see this done without installing anything... but it's your thing.

You can, actually, set transparency of the native virtual terminal, so it could be brought up like the video menu, overlain/minimized as desired. You don't need guake to do this. You could just pop it up with a button... sort of like the media grid. Wouldn't that be cool? We already install so much. Unlike the browser... which will stop your media event and move to this... however you will have to keep things like myth from taking character input...

Title: Re: Konsole item in computing menu,... help please...
Post by: l3mce on September 07, 2012, 10:01:40 pm
I can see it now...

(http://i45.tinypic.com/34xncr6.jpg)
Title: Re: Konsole item in computing menu,... help please...
Post by: golgoj4 on September 07, 2012, 10:15:57 pm
Ok... I'll do it,...

But I want to do it with Guake...
http://guake.org/
That'll give the potential (maybe) to have it drop down over top of a running Media director, regardless of what's running underneath.  You can tell me if that's feasible. But otherwise, I think it should be intercepting the keyboard like the Firefox wrapper.

I'd like it to be able to be called up with a hot-key over-top any running OSD Orbiter running on an MD (e.g.: during media playback). That might give you the ability to manually issue live commands, such as DCE router commands to a running device (like the Xine Player).

I've found some of the development stuff in the Wiki, know that a device has to be created, etc,... but I need to have some kind of starting place,...

So,... I have questions;
  1) What scripts, wiki entries and files should I be looking at first (Mozilla.sh comes to mind for a starting place)?
  2) Could it be restricted to certain users, and if so, set to su (or kdesudo) to the running user if authorized? & What examples should I look at to figure that out?
  3) If it can be given a hot key to launch, where are those defined, and where/what should I be looking at to get started?
  4) Can it be set to always be on top (meaning are you alright with that, not necessarily how is that done, I assume wmctrl would be used)?

Please keep in mind I don't know C, C++, PHP, Ruby, etc. ... but I can shell script adequately. 


keep on the path, dont let not knowing c#, c++, stop you. After all, you only have to learn it once. and if it comes down to it, ill help you write the c++ device.

-golgoj4
Title: Re: Konsole item in computing menu,... help please...
Post by: JaseP on September 08, 2012, 04:06:38 am
Thank you...

And XTerm it is... I hadn't realized it had a transparency setting,.. never bothered to use it...
Title: Re: Konsole item in computing menu,... help please...
Post by: JaseP on September 10, 2012, 05:22:31 am
Trying to get my head around the user management stuff in the terminal.

The object is to put together what I need to make this launch without being root by default... With least amount of additions or changes to the system,...

The su command works fine to get me to into my admin account (net install, but I don't know if that makes a I checked /etc/passswd just to be sure... ).

On the MDs, using su for the same user gets me to the sambahelper user... I checked /etc/passswd just to be sure... and yes,... it looks as though there are no real user accounts set up on the MDs, which makes sense ... Root level commands aren't honored when logged in as sambahelper,... which I expected.

That leads me to questions:
1) The core creates users with the names; pluto_[user names first entered on setup],... Are these "true" Linux user accounts in the traditional sense (or close to it), or some sort of services process user, like for MythTV, etc?

2) What would be the preferred method for this thing working on MDs?;
     a) Do not create any users,... default to sambahelper for ordinary users, but root for admin after supplying password (Set password as system Admins?)...
     b) Set up user "secondary" accounts with names derived from LinuxMCE, putting only admins on Sudoers list ("home" being their account dir on the core),...
     c) Set up Admins with "secondary" accounts only from LinuxMCE, otherwise as b, above...
     d) No user additions,...but create 2 options, sambahelper with no root authority, ... or root after supplying system admin's password,...

3) On Core,... same as above? or only just the admin...?

I'm inclined to think that the easiest thing would be #2(c) from above, universally, on MDs and the Core (I'm assuming a hybrid core here). But not use the LinuxMCE user accounts themselves, just a parallel set of accounts. Actually, 2(d) would be easiest, at least as far as MDs are concerned. But I'm inclined to think 2(c) would be more useful from the standpoint of using this as an admin tool.

Please let me know what you think.
Title: Re: Konsole item in computing menu,... help please...
Post by: l3mce on September 11, 2012, 09:35:41 am
Glad to see progress!

Now the second thing I want to get across.

Upload soon and upload often. This way we can collaborate. We can, as a community, help each other. You can choose to keep, or ignore any code changes/recommendations... but this way it is easier for us to communicate.

svn.linuxmce.org

Create a new ticket, and attach what you are working on.
:)
Title: Re: Konsole item in computing menu,... help please...
Post by: JaseP on September 11, 2012, 03:57:04 pm
Thanks,...

What I've decided is that the setup script needs to create a single user on each MD (named for the Moon[n] of that MD,... Like; Moon[n]_xtermuser), and give that user rights on the sudoers list on each MD so as not to interfere with any accounts currently used by the system.

I might have some prelim test script work done by the end of this weekend. Just a "hard-coded" launcher script, maybe a "hard-coded" user setup script as well... Full scripts will have to include sql queries to the database to get the necessary system information to do an automated setup. So, I have to learn that.

I don't know what to do about the tty terminals,... I think, though, that it should be a separate, optional piece to secure them... It doesn't make sense to limit user authority on a windowed xterm, and leave the the ability to get a tty as root (by default) hanging in the wind with a simple Alt-Ctrl-F[n]. It should be theoretically possible to limit local access to tty's while allowing access through ssh from the server. From what I've read, ssh-ing into a machine that's had its local tty access restricted is not affected, since authentication happens before hand, and that mechanism bypasses the normal restrictions imposed in the /etc/securetty file... but that'll be something to experiment with. If it's a separate piece to secure the tty's, it gives the admin the decision on how much to restrict the system, based on their own requirements. It would be a simple process to "undo" the tty access restriction by replacing the /etc/securetty file with the original, should someone need to reverse it. Future refinements could allow the admin to decide WHICH MDs to restrict in this way...

Otherwise, it should be simple to cause xterm to launch as a particular user. All that's left is to create a script that sets up the users on each MD (including a hybrid Core's on-screen Orbiter), sets the limited user environment, xterm configuration, sudo permissions for them, create a device profile for the "app" (script really) that launches xterm -ls, and make some sort of change to the main menu to assign/reserve it a hotkey. ... Oh, and eventually, to create a mechanism for turning this on (& configuring?!) it in the Web Admin,... Turns out getting xterm to launch in a more secure way is the easy part,... Devil's in the details...

There are two paths for user configuration that I can take,... the easier one being to require the user to set the password for the Moon[n]_xtermuser for each MD on first login with xterm... The second is to pre-define it,... but that would (eventually) require a Web Admin config screen... I think I'll take the easy road for now. If pre-configuration is desirable, that could be a ver. 2.0 thing.

One question remains,... I have a net installed 1004 system...

By default, if I drop to a tty on my Core, I'm presented with a login prompt that allows me to logins as the original user I created with the Kubuntu install. Does the DVD install create such a user,... or does it default to a password-less root like the MDs have??

Oops,... I realized I have a second question,... It came up while I was researching xterm use with ssh, and might (though unlikely) impact some aspect of how this would work...

Is ssh forwarding allowed on the LinuxMCE system by default?

Title: Re: Konsole item in computing menu,... help please...
Post by: Marie.O on September 11, 2012, 04:09:08 pm
Why do you want to create a new user on each MD?

We already create users named pluto_<Name-of-user>. At the moment we disable terminal login (bei specifying /bin/false as the shell) for these users, as the default password is the <Name-of-user>, but instead of creating new users, I would see if you can re-use these users.
Title: Re: Konsole item in computing menu,... help please...
Post by: JaseP on September 11, 2012, 04:31:34 pm
I didn't see them on the list of user accounts when I checked the /etc/passwd file on the MD. I did notice them when I did the same on the Core. But, I'll check again (tonight, maybe)... Maybe I missed/overlooked them...

If they are only accessible by ssh-ing to the Core,... I'd have to use ssh forwarding to go from the MD, to the Core and back to the MD, adding a layer of complication. Plus,... when using xterm -ls, I don't know if the minimal user environment that I would need to define would interfere with anything set in those user accounts (which, given my luck, it would).

Title: Re: Konsole item in computing menu,... help please...
Post by: Marie.O on September 11, 2012, 04:39:39 pm
We are using NIS. Each user that is available on the core is available throughout the MDs.
Title: Re: Konsole item in computing menu,... help please...
Post by: JaseP on September 11, 2012, 04:47:39 pm
Alright, I didn't know that. Thanks. I'll have to take a look at that and how it affects launching xterm with with or without login support (e.g. there are certain xterm options that are not compatible with one another, like; xterm -ls and xterm -e, so I need to look at and understand NIS, and how it works, better)...
Title: Re: Konsole item in computing menu,... help please...
Post by: tschak909 on September 11, 2012, 08:09:39 pm
This is why it is absolutely important to study the system. 9 times out of 10, pluto already thought of it.

NIS replicates configuration files (passwd, group, etc.)so that this data is consistent between the systems, even when changes are done.

Also, when logging into a moon, it is important for now that this is done as root, as there is an ssh key which allows this to happen automatically.

-Thom
Title: Re: Konsole item in computing menu,... help please...
Post by: JaseP on September 11, 2012, 10:21:33 pm
Hmmm,...

I'm thinking of a solution based on remote forwarding from the Core to the MD, and ssh-ing back to the MD (or even another MD),... But, I haven't thought it through enough to explain it correctly or figure out if it will even work... And I don't think it will resolve the issue of trying not to run a graphical terminal as root without password.

I'll keep working on it...
Title: Re: Konsole item in computing menu,... help please...
Post by: JaseP on September 12, 2012, 05:45:42 am
Exploring options & Follow-up question:

I've determined that NIS and local user logins can coexist on a system,... Especially, on a PXE boot the biggest issue is how to map the local user "/home" account properly with NFS. Not simple, but certainly less convoluted than what I was considering in my previous post...

Is everyone so attached to NIS login for what would be, essentially, a bolt-on addition/convenience that you would reject a "dummy" local user account, considering that might be the least amount of change to the system and more easily removable?!

I'm not all about the easy way, over the right way, but this looks like an area where to do it, the easy way gets it done, while the right way ends up standing in line (in que, for the Brits,... ) waiting to cash a check...
Title: Re: Konsole item in computing menu,... help please...
Post by: Marie.O on September 12, 2012, 06:37:10 am
Use NIS.

Don't bolt on, do it right. Takes longer, but you do learn stuff.
Title: Re: Konsole item in computing menu,... help please...
Post by: JaseP on September 12, 2012, 09:25:42 pm
When you say that it is important that all logins are as root,... does this have to do with key file ownership?
Title: Re: Konsole item in computing menu,... help please...
Post by: tschak909 on September 12, 2012, 09:34:52 pm
This has to do with the fact that currently the public key for connecting to the other moons is in /root/.ssh …

Lots of things need to be privilege deescalated from root, this is an artifact of this.

-Thom
Title: Re: Konsole item in computing menu,... help please...
Post by: JaseP on September 12, 2012, 10:33:06 pm
So, there's no way under NIS to allow unprivileged logins from the moons under the current setup,... hmmm,..

Would switching around the NIS key file ownership/location situation break other things, under the current setup?
Title: Re: Konsole item in computing menu,... help please...
Post by: tschak909 on September 12, 2012, 10:36:11 pm
If you look at NIS (aka YP), all it is used for, is to replicate various system configuration files between machines and to keep them in sync.

-Thom
Title: Re: Konsole item in computing menu,... help please...
Post by: Marie.O on September 12, 2012, 10:49:36 pm
Setup another private public key pair for the pluto_xxxx users, and you have the ability to connect to any of the moons.
Title: Re: Konsole item in computing menu,... help please...
Post by: JaseP on September 12, 2012, 11:03:54 pm
Another as in additional or as in replacement?
Title: Re: Konsole item in computing menu,... help please...
Post by: JaseP on September 14, 2012, 04:33:57 pm
Can someone point me to the scripts that touch NIS user setup in the system?

I'm interested in looking at the scripts involved in setup/installation and post-setup user creation/deletion...
I've looked at/through the SVN,...

http://svn.linuxmce.org/svn/branches/LinuxMCE-1004/

... and I can't find any scripts/source code/etc for it... Lot's of stuff there,... I don't know where to look. I'm lost.

Thanks.
Title: Re: Konsole item in computing menu,... help please...
Post by: Marie.O on September 14, 2012, 04:38:32 pm
look in src/BootScripts

and I meant additional private/public pair. atm we only have one for the user root.
Title: Re: Konsole item in computing menu,... help please...
Post by: JaseP on September 14, 2012, 11:20:51 pm
Thanks,...

Looks like the bulk of what I'm going to be needing to examine is in SetupUsers_Homes.sh and the templates subdirectory, particularly nis-client.template... correct?! Right track?!



Title: Re: Konsole item in computing menu,... help please...
Post by: Marie.O on September 15, 2012, 12:04:59 am
I would like at everything that remotely contains the word users in the filename in /usr/pluto/bin and try to understand what each does.
Title: Re: Konsole item in computing menu,... help please...
Post by: JaseP on September 15, 2012, 01:16:55 am
Thanks,...


Posde, you have any "special" concerns within the /usr/pluto/bin directory?!

OK there are only 4...
RemoveUser.sh
SetupUsers.sh
SetupUsers_Homes.sh, &
generate_users_voicemenu.pl

Am I missing anything?!
Title: Re: Konsole item in computing menu,... help please...
Post by: Marie.O on September 15, 2012, 10:01:37 am
I had a spelling error. My brain wanted to write "look", my fingers preferred "like"