Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: gmc on May 09, 2013, 10:38:24 PM
-
Greetings,
When I try to boot up TCL 4.7.6 with boot option user=root, the system boots to the last screen before the desktop and displays the message:
login[xxx] : root login on 'tty1'
(where xxx=some number like 972 or 449) and with a rapid flickering screen and no actual place to login. Also the number xxx varies from one machine to another.
I have tried this on frugal installed TCL as well as CD boot from .ISO image. Three differnet computers all have the same behavior. Is it not possible to boot as root?
-
Logging in as root is bad practice.
The system utilities where therefore designed not to run from root.
Root's .profile does a login of the user= value. Since you made it root, it is looping.
-
@gerald_clark - Yes, I understand that loggin in as root is a bad practice. I'll get back to that in a minute.
It looked like it might be looping, glad to have that confirmed.
Now, as to my problem. I am legally blind and find it hard to perform certain tasks. I would like to open an editor like Beaver or a file manger like emelfm with root privileges without having to open a terminal, type sudo (program name), menimize the terminal, use the program, close the program and then close the terminal. I simply want to click on the wbar icon for the desired program and have it run with root privileges.
I have also noticed that when running the editor with root privileges that it does not retain settings or remember which files have been recently opened in user=TC shell. These are the two reasons I would like to boot to root.
So, is there some way to have single-click wbar icons for these programs with root privileges or is there a way to boot as root?
Thanks
-
1. Create a wbar entry that runs your program with su.
2. Backup your /root directory.
-
Can I edit an existing script and just add the 'su' to it?
Use beaver-gtk1 for an example.
The only info I found on search is related to on-demand installs and I don't have any of those. Details for on-boot wbar settings would be helpful.
Thanks
-
I would like to open an editor like Beaver or a file manger like emelfm with root privileges without having to open a terminal, type sudo (program name), menimize the terminal, use the program, close the program and then close the terminal.
sudo (program name)& exit
should automatically close the aterm.
-
Hi gmc
If you find the desktop menu system is usable, it might make more sense to setup a sub-menu called SudoApps
and populate it with apps you want to run as root. This way you could run those apps as root only when you really
need to instead of all the time. Here is a thread that explains how to set up the desktop files:
http://forum.tinycorelinux.net/index.php/topic,15107.msg86640.html#msg86640
Once you have created the desktop files, you can package them into a personal extension, copy the extension to
your tce directory, and add it to your onboot.lst. Though probably not necessary, it would be a good idea to create
a dependency file that contains a list of the tczs providing those apps.
-
FWIW, I think emelfm2 already has a second menu item to run it as root.
-
FWIW, I think emelfm2 already has a second menu item to run it as root.
Hi Lee - You are correct, both emelfm and beaver have these as sub-menu choices. I had not been aware of this as I had not been using the menu system. Thanks for pointing it out. This will help for the present. I'm still working on desktop icons for this purpose...
-
I would like to open an editor like Beaver or a file manger like emelfm with root privileges without having to open a terminal, type sudo (program name), menimize the terminal, use the program, close the program and then close the terminal.
sudo (program name)& exit
should automatically close the aterm.
Good tip! Thanks. I love learning these little tricks as I work my way through this new (for me) OS. The learning curve is steep but I'll get there...
-
1. Create a wbar entry that runs your program with su.
2. Backup your /root directory.
I tried using a couple of methods I found for wbar entries but can't get them to work. They did not involve using the /root directory. What method do you use that uses /root?
Thanks...
-
@Rich - I have spent considerable time trying out your ideas/links. Not having any success yet, but I sure am learning a lot. As Lee pointed out there are sub-menu items already for the programs I most need with root access rights. Now if I can just figure out how to get those sub-menu items iconized...
-
Settings of root user are stored in /root.
-
Settings of root user are stored in /root.
Ah so!
-
I would not know by reading the title of this thread, but, if your goal is to add a few personal icons then read on...
Everything in the Core series is dynamic. So every time X is started the icon file /usr/local/tce.icons is generated from the freedesktop items in the loaded extensions. Given such, one place to script add additional icons would be .X.d/ It is the directory to store additional scripts to run upon X invocation.
So make a tiny script call it sudoIcons
#!/bin/sh
append()
{
echo "$1" >> /usr/local/tce.icons
}
append "i: /usr/local/share/pixmaps/editor.png"
append "t: Sudo Editor"
append "c: exec sudo editor"
wbar.sh
Here I just copied the three lines for Editor and added sudo. You could use this tiny script and add additional 3 lines for other programs that you want sudo access. Just be sure to keep the three lines in the order of icon, title, and command. The last line must be wbar.sh to cause wbar to refresh thus displaying your new icons.
Don't forget to make the script executable.
chmod +x .X.d/sudoicons
Note however that doing such "hacks" cannot be supported by way of regular system administration, i.e., deleting one of such extensions.
-
I would not know by reading the title of this thread, but, if your goal is to add a few personal icons then read on...
I would not know it from the title either, but one thing led to another...
So make a tiny script call it sudoIcons
#!/bin/sh
append()
{
echo "$1" >> /usr/local/tce.icons
}
append "i: /usr/local/share/pixmaps/editor.png"
append "t: Sudo Editor"
append "c: exec sudo editor"
wbar.sh
Here I just copied the three lines for Editor and added sudo. You could use this tiny script and add additional 3 lines for other programs that you want sudo access. Just be sure to keep the three lines in the order of icon, title, and command. The last line must be wbar.sh to cause wbar to refresh thus displaying your new icons.
This is just what I needed! Thanks so much, it works fine. I no longer have any need or desire to log in as root at boot. And it is so simple (as compared to some of the wiki entries I was reading).
Don't forget to make the script executable.
chmod +x .X.d/sudoicons
Why make it executable? It runs when X starts without being made executable.
Thank you very, very much for the help, roberts.
And thanks so much to everyone that responded here. This is absolutely the best support forum I have ever encountered. I think TCL and I are going to have a long and productive relationship, thanks to all of you.