maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Root vs sudo gainroot (https://talk.maemo.org/showthread.php?t=68151)

Rob1n 2011-01-11 08:38

Re: Root vs sudo gainroot
 
Quote:

Originally Posted by mdziaf (Post 916965)
However, if I close and reopen Xterminal, and type in
Code:

root
no password prompt was given. but doing an apt-get install would give "unable to lock the admin directory"

Is it actually changing user? Do you get the # prompt instead of the $ prompt?

mdziaf 2011-01-11 09:26

Re: Root vs sudo gainroot
 
Quote:

Originally Posted by Rob1n (Post 917605)
Is it actually changing user? Do you get the # prompt instead of the $ prompt?

I did get the # prompt instead of the $ sign last time I tried it.

Rob1n 2011-01-11 10:26

Re: Root vs sudo gainroot
 
Quote:

Originally Posted by mdziaf (Post 917628)
I did get the # prompt instead of the $ sign last time I tried it.

Okay, so that's working at least.

The "sudo gainroot" shouldn't be asking for a password though, so the next thing to do is check whether the sudoers entry is correct - what's the result of running (as root) the following?:
Code:

grep gainroot /etc/sudoers.d/01sudo
As for the lock error, you can try checking for applications holding the lock file. You'll need to be root, and have lsof installed (not sure whether it's standard or not - it's in the Nokia SSU repository though), then run:
Code:

lsof /var/lib/dpkg/lock
If that doesn't list anything, I'd also suggest checking rootfs space (df -h /) - it may well be unable to lock the file if there's no rootfs space free.

mdziaf 2011-01-11 10:35

Re: Root vs sudo gainroot
 
Quote:

Originally Posted by Rob1n (Post 917649)
Okay, so that's working at least.

The "sudo gainroot" shouldn't be asking for a password though, so the next thing to do is check whether the sudoers entry is correct - what's the result of running (as root) the following?:
Code:

grep gainroot /etc/sudoers.d/01sudo
As for the lock error, you can try checking for applications holding the lock file. You'll need to be root, and have lsof installed (not sure whether it's standard or not - it's in the Nokia SSU repository though), then run:
Code:

lsof /var/lib/dpkg/lock
If that doesn't list anything, I'd also suggest checking rootfs space (df -h /) - it may well be unable to lock the file if there's no rootfs space free.

Ok I will get my girlfriend to do that when she comes back..will update you..appreciate the help :)

mdziaf 2011-01-11 13:33

Re: Root vs sudo gainroot
 
Quote:

Originally Posted by Rob1n (Post 917649)
Okay, so that's working at least.

The "sudo gainroot" shouldn't be asking for a password though, so the next thing to do is check whether the sudoers entry is correct - what's the result of running (as root) the following?:
Code:

grep gainroot /etc/sudoers.d/01sudo

Running the code gives me the following:
Code:

BusyBox v1.10.2 (Debian 3:1.10.2.legal-1osso30+0m5) built-in shell (ash)
Enter 'help' for a list of built-in commands.

Nokia-N900-51-1:~# grep gainroot /etc/sudoers.d/01sudo
user ALL = NOPASSWD: /usr/sbin/gainroot
Nokia-N900-51-1:~#


Rob1n 2011-01-11 14:22

Re: Root vs sudo gainroot
 
Quote:

Originally Posted by mdziaf (Post 917793)
Running the code gives me the following:
Code:

BusyBox v1.10.2 (Debian 3:1.10.2.legal-1osso30+0m5) built-in shell (ash)
Enter 'help' for a list of built-in commands.

Nokia-N900-51-1:~# grep gainroot /etc/sudoers.d/01sudo
user ALL = NOPASSWD: /usr/sbin/gainroot
Nokia-N900-51-1:~#


That's okay anyway - it specifies NOPASSWD so it shouldn't be asking for any password. What about:
Code:

grep gainroot /etc/sudoers
If that only gives the exact same result, can you post the contents of /usr/sbin/gainroot (cat /usr/sbin/gainroot)?

mdziaf 2011-01-11 14:30

Re: Root vs sudo gainroot
 
Quote:

Originally Posted by Rob1n (Post 917833)
That's okay anyway - it specifies NOPASSWD so it shouldn't be asking for any password. What about:
Code:

grep gainroot /etc/sudoers
If that only gives the exact same result, can you post the contents of /usr/sbin/gainroot (cat /usr/sbin/gainroot)?

Rob1n, I appreciate your help with this matter. but I I wont run the code, as when I tried apt-get install preenv, we were able to download and install the application. Since this was the original aim to root the N900, I feel theres no need to delve deeper into the problem.

Again many thanx to everyone for your help :D Appreciate it a lot :D

Char 2011-01-11 18:14

Re: Root vs sudo gainroot
 
Quote:

Originally Posted by mdziaf (Post 917838)
Rob1n, I appreciate your help with this matter. but I I wont run the code, as when I tried apt-get install preenv, we were able to download and install the application. Since this was the original aim to root the N900, I feel theres no need to delve deeper into the problem.

Again many thanx to everyone for your help :D Appreciate it a lot :D

so the problem WAS probably apt-worker


All times are GMT. The time now is 05:33.

vBulletin® Version 3.8.8