WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Solved] user=root strange boot problem  (Read 4946 times)

Offline gmc

  • Full Member
  • ***
  • Posts: 141
[Solved] user=root strange boot problem
« 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?
« Last Edit: May 15, 2013, 08:43:54 PM by gmc »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: user=root strange boot problem
« Reply #1 on: May 09, 2013, 10:45:16 PM »
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.

Offline gmc

  • Full Member
  • ***
  • Posts: 141
Re: user=root strange boot problem
« Reply #2 on: May 09, 2013, 11:43:57 PM »
@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
« Last Edit: May 12, 2013, 12:50:26 AM by gmc »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: user=root strange boot problem
« Reply #3 on: May 09, 2013, 11:48:02 PM »
1. Create a wbar entry that runs your program with su.
2. Backup your /root directory.

Offline gmc

  • Full Member
  • ***
  • Posts: 141
Re: user=root strange boot problem
« Reply #4 on: May 10, 2013, 12:09:05 AM »
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

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: user=root strange boot problem
« Reply #5 on: May 10, 2013, 04:34:32 AM »
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.

Code: [Select]
sudo (program name)& exitshould automatically close the aterm.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11630
Re: user=root strange boot problem
« Reply #6 on: May 10, 2013, 11:51:55 AM »
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.

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: user=root strange boot problem
« Reply #7 on: May 10, 2013, 02:33:55 PM »
FWIW, I think emelfm2 already has a second menu item to run it as root.
32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

Offline gmc

  • Full Member
  • ***
  • Posts: 141
Re: user=root strange boot problem
« Reply #8 on: May 12, 2013, 12:36:43 AM »
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...
« Last Edit: May 12, 2013, 12:39:25 AM by gmc »

Offline gmc

  • Full Member
  • ***
  • Posts: 141
Re: user=root strange boot problem
« Reply #9 on: May 12, 2013, 12:47:23 AM »
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.

Code: [Select]
sudo (program name)& exitshould 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...

Offline gmc

  • Full Member
  • ***
  • Posts: 141
Re: user=root strange boot problem
« Reply #10 on: May 12, 2013, 11:10:47 PM »
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...

Offline gmc

  • Full Member
  • ***
  • Posts: 141
Re: user=root strange boot problem
« Reply #11 on: May 12, 2013, 11:20:16 PM »
@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...

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: user=root strange boot problem
« Reply #12 on: May 12, 2013, 11:21:08 PM »
Settings of root user are stored in /root.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline gmc

  • Full Member
  • ***
  • Posts: 141
Re: user=root strange boot problem
« Reply #13 on: May 13, 2013, 12:02:25 AM »
Settings of root user are stored in /root.

Ah so!

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: user=root strange boot problem
« Reply #14 on: May 13, 2013, 02:40:26 AM »
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

Code: [Select]
#!/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.
10+ Years Contributing to Linux Open Source Projects.