Active Topics

 


Reply
Thread Tools
felbutss's Avatar
Posts: 579 | Thanked: 286 times | Joined on Oct 2009 @ Australia
#11
Originally Posted by daperl View Post
I'm not sure if this is the best advice, but if, as root, you add the following line to

/etc/sudoers

Code:
user ALL = NOPASSWD: ALL
you should be able to run anything as root by putting

sudo

in front of it. For instance,

Code:
sudo whoami
should output "root" and not "user."

i missed this step. how do i apply this to the above tutorial you made???
 
Posts: 134 | Thanked: 91 times | Joined on Nov 2009 @ Imperial College London
#12
Originally Posted by daperl View Post
I'm not sure if this is the best advice, but if, as root, you add the following line to

/etc/sudoers

Code:
user ALL = NOPASSWD: ALL
you should be able to run anything as root by putting

sudo

in front of it. For instance,

Code:
sudo whoami
should output "root" and not "user."
You should be careful when editing the sudoers file. If you make a mistake with the syntax sudo will stop working entirely.

You can protect against this somewhat be using the "visudo" command. This will test for parse errors when you try to save and potentially save some pain.

Though I guess it should be obvious, it might be worth noting that the above edit is probably not a good idea on a proper multi-user system!

Cheers,
Jan
 

The Following User Says Thank You to Big Phat Jan For This Useful Post:
Posts: 134 | Thanked: 91 times | Joined on Nov 2009 @ Imperial College London
#13
Originally Posted by felbutss View Post
i missed this step. how do i apply this to the above tutorial you made???
If Matan is correct (and I'm sure he is!) you do not need this step at all. It would have been useful if you needed to be root to kill the processes you were trying to kill, but as it seems that you don't I would leave it alone.

quick question. how do i set a icon??? sorry to break balls
I think you just add a line to your .desktop file like this: "Icon=/path/to/icon". You might not see the result until you restart though.

Cheers,
Jan

Last edited by Big Phat Jan; 2010-03-06 at 17:32.
 
felbutss's Avatar
Posts: 579 | Thanked: 286 times | Joined on Oct 2009 @ Australia
#14
ok ill just do it without it but lol one thing guys. why isnt it showing up in the app manager???? i verified all the steps 100%
 
Posts: 134 | Thanked: 91 times | Joined on Nov 2009 @ Imperial College London
#15
Originally Posted by felbutss View Post
ok ill just do it without it but lol one thing guys. why isnt it showing up in the app manager???? i verified all the steps 100%
I think that you wouldn't expect to. Look in the menu, you should see it there. You can add it as a shortcut to your desktop as you would any other program.

Cheers,
Jan
 

The Following User Says Thank You to Big Phat Jan For This Useful Post:
felbutss's Avatar
Posts: 579 | Thanked: 286 times | Joined on Oct 2009 @ Australia
#16
OMG IT WORKED. thanks for the help. hope to return the favor one day

'had one problem because i had one letter as caps lol'


this is so fun. im making it speak after its finished. i feel like a kid again

Last edited by felbutss; 2010-03-06 at 18:00.
 
daperl's Avatar
Posts: 2,427 | Thanked: 2,986 times | Joined on Dec 2007
#17
Originally Posted by felbutss View Post
quick question. how do i set a icon??? sorry to break balls
I can't tell if you got this working or not. I'm not exactly sure how all this stuff works, but here's something that always seems to work for me:

Create a 48x48 .png file and call it killerapp.png. Put it in:

/usr/share/pixmaps

Inside:

/usr/share/applications/hildon/killerapp.desktop

add the line

Icon: killerapp

I'm not sure, but you might have to reboot to see the icon in the Application Manager and/or on the Desktop. If you're not seeing it on the Desktop, you might have to delete and readd the shortcut.
__________________
N9: Go white or go home

Last edited by daperl; 2010-03-06 at 18:32.
 

The Following User Says Thank You to daperl For This Useful Post:
kd_alex's Avatar
Posts: 116 | Thanked: 19 times | Joined on Mar 2010
#18
Since you all seem to be wise in writing scripts I was hoping to ask for help with one of mine. Sorry to Hijack this thread but it seems the appropriate place to post my question.

In my script I want to execute a command that requires root permissions.

so my script looks like this

#!/bin/sh
sudo gainroot
echo `/etc/init.d/lirc start`
exit

The problem is my script hangs on trying to sudo gainroot. I have also tried this using echo `sudo gainroot`

Any suggestions?
 
Posts: 1,224 | Thanked: 1,763 times | Joined on Jul 2007
#19
A shell script is not like typing the same characters at a shell. What you want can be achieved by

sudo echo `/etc/init.d/lirc start`

Assuming you set /etc/sudoers to allow execution of echo as root.
__________________
My repository

"N900 community support for the MeeGo-Harmattan" Is the new "Mer is Fremantle for N810".

No more Nokia devices for me.
 

The Following User Says Thank You to Matan For This Useful Post:
kd_alex's Avatar
Posts: 116 | Thanked: 19 times | Joined on Mar 2010
#20
thank you so much for the suggestion.

when searching sudoers i found that '/etc/init.d/lirc start' was included already for all users with no password. so i modified what you suggested to

echo 'sudo /etc/init.d/lirc start'

it worked perfect. now to save it as a shortcut for the desktop

again thanks.
 
Reply


 
Forum Jump


All times are GMT. The time now is 14:35.