Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I just installed tor, privoxy and proxychains on Ubuntu 13.10, but they are not experiencing any problems. My problem is based on a .desktop file I created as I think it actually doesn't work properly. The content of that file is:

[Desktop Entry]
Type=Application
Terminal=false
Name=Switch IP address
Icon=/usr/desktop/icons/switchip.png
Exec=service tor restart

As command service tor restart is used to obtain new fake IP address, but when I run it from a terminal, it works. When I click on icon on launcher (which is .desktop file above) it does not take any effect. What I missed or did wrong?

share|improve this question

3 Answers 3

Try this:

[Desktop Entry]
Type=Application
Terminal=false
Name=Switch IP address
Icon=/usr/desktop/icons/switchip.png
Exec=pkexec service tor restart

service needs to run as root, using pkexec.

share|improve this answer
1  
yes, i forgot i must run it as admin... i recently came from kali where you login as root, and forget about sudo command... also, i think this is best way is, as with sudo i must keep terminal=true, and gksudo requires installation. thanks. –  black_hat_cat Jan 10 at 21:47
    
@black_hat_cat, would you accept this answer as it did solve the problem. See What should I do when someone answers my question? –  Sneetsher Jul 19 at 9:17

Services need root privileges to run. Try to change:

Exec=service tor restart

To:

Exec=gksu service tor restart

Or:

Exec=sudo service tor restart

Also, this will restart the service. Some services refuse to restart if they're not already running, try to use start instead of restart.

share|improve this answer
2  
This will require Terminal=true, otherwise sudo will be unable to get the password input. gksu needs to be installed first (sudo apt-get install gksu). –  minerz029 Jan 10 at 21:30
    
Forgot both things, thanks! –  darent Jan 10 at 21:32

Try changing

Terminal=false

to

Terminal=true

and see if it does execute properly. (remember to mark your .desktop file as executable)

share|improve this answer
    
no it does not. –  black_hat_cat Jan 10 at 21:28
    
another thing... does this command work when u use it manually in terminal? –  Frost Jan 10 at 21:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.