Reply
Thread Tools
Posts: 28 | Thanked: 1 time | Joined on Jul 2007
#1
Just thought I should share my experience, in the hope that others might see this and avoid my mistake.

It seems obvious in hindsight, but I put "sudo gainroot" in /home/user/.profile, because every time I used xterm, I wanted root access.

Unfortunately, something at the end of the boot process must use a shell, and it can't run as root, because with this change the N800 halts its boot when the progress bar is fully right.

Yeah, I know, it seems obvious now, but I didn't think the change through, and kept re-doing it after a reflash (reflash, install xterm, gainroot, start adding other stuff, and it would be fine until I rebooted). I wasted lots of time.
 
Posts: 3,401 | Thanked: 1,255 times | Joined on Nov 2005 @ London, UK
#2
Or maybe check if the session is interactive and only then gainroot - I don't think $TERM is defined for non-interactive sessions/logins. And isn't .login executed only by interactive logins? Could depend on the shell though.
 
Posts: 3,401 | Thanked: 1,255 times | Joined on Nov 2005 @ London, UK
#3
/home/user/.profile will be executed three times during the boot process (at least on my 4.2007 N800) and each time TERM will be set to "linux" but when logging in interactively via xterm, TERM will be set to xterm so the easy solution is to check $TERM and if it's set to xterm call sudo gainroot.
 
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#4
Originally Posted by sping View Post
I put "sudo gainroot" in /home/user/.profile, because every time I used xterm, I wanted root access.
It is a bit like having a house with front door leading directly to your bedroom :-)

You can shoot yourself in the foot quite easily and in many unexpected ways while being always root. What about creating just one letter alias to sudo gainroot in your .profile (or .bashrc if .profile reads it)?
Code:
alias r='sugo gainroot'
then you can just type r + enter
__________________
Newbies click here before posting. Thanks.

If you really need to PM me with troubleshooting question please consider posting it to the forum instead. It is OK to PM me a link to such post then. Thank you.

Last edited by fanoush; 2007-08-13 at 14:31.
 
gigabites's Avatar
Posts: 122 | Thanked: 21 times | Joined on Sep 2006
#5
Originally Posted by fanoush View Post
What about creating just one letter alias to sudo gainroot in your .profile (or .bashrc if .profile reads it)?
Code:
alias r='sugo gainroot'
then you can just type r + enter
how do you do that if you don't have a /home/user/.profile?

obviously I'm not cli savvy.
thanks
 
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#6
Originally Posted by gigabites View Post
how do you do that if you don't have a /home/user/.profile?
then create it, run this in xterm (as ordinary user)
Code:
echo 'alias r="sudo gainroot"' >>/home/user/.profile
better use cut and paste, it is double quotes inside single quotes

you will need to close and reopen osso-xterm (the advanced one) or reboot for the definition to take effect
__________________
Newbies click here before posting. Thanks.

If you really need to PM me with troubleshooting question please consider posting it to the forum instead. It is OK to PM me a link to such post then. Thank you.
 
Posts: 8 | Thanked: 1 time | Joined on Aug 2007
#7
Originally Posted by fanoush View Post
you will need to close and reopen osso-xterm (the advanced one) or reboot for the definition to take effect
or run
Code:
source /home/user/.profile
 
Reply


 
Forum Jump


All times are GMT. The time now is 03:42.