You are not logged in.

#1 2017-09-17 12:22:53

Fred7109
Member
Registered: 2015-05-17
Posts: 134

[SOLVED] Programs from panel and terminal doesn't launch similarily

Hello

I have this problem, that I have tried to avoid for some time now, however, it is unavoidably now unfortunately. The problem is that when I want to start chromium from the terminal, I use the following command, in order to use a specific namespace:

ip netns exec secondvpn sudo -u [username] firejail chromium --user-data-dir="/home/[username]/.config/chromium/Profile 2" https://duckduckgo.com

Chromium opens just as it should, however, when doing the same from a launcher from the panel with gksudo, as below, it doesn't work, it just starts a normal chromium profile.

gksudo 'ip netns exec secondvpn sudo -u [username] firejail chromium --user-data-dir="/home/[username]/.config/chromium/Profile 2" https://duckduckgo.com'

Any ideas on how to solve this problem would be greatly appreciated.

Last edited by Fred7109 (2017-09-18 06:18:52)

Offline

#2 2017-09-17 13:50:34

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,876

Re: [SOLVED] Programs from panel and terminal doesn't launch similarily

gksudo 'foo sudo -u [username] bar'

Why is there an inner sudo and how does it get the password and/or username?

ip netns exec secondvpn gksudo -u [username] firejail chromium --user-data-dir="/home/[username]/.config/chromium/Profile 2" https://duckduckgo.com

?

Offline

#3 2017-09-17 16:15:12

Fred7109
Member
Registered: 2015-05-17
Posts: 134

Re: [SOLVED] Programs from panel and terminal doesn't launch similarily

Hello Seth

Thank you for the reply.

I have just replaced my actual username with [username], so it has the username. In addition, the username is the one of the logged in user, so it doesn't need a password. Finally, the reason there is an inner sudo is that I can only launch a program in the namespace where I run my second VPN with administrative privileges, however, I don't want the program that I launch inside the namespace to have administrative privileges, which I why I use sudo -u [username], to get to normal privileges.

Do you have any idea why it works great when I execute the command in the terminal, but not from the panel with a launcher?

Last edited by Fred7109 (2017-09-17 16:15:47)

Offline

#4 2017-09-17 19:47:27

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,876

Re: [SOLVED] Programs from panel and terminal doesn't launch similarily

The answer will be in the behavior of gksudo - I assume you're elevating privileges using plain sudo or su from an interactive shell?
Tried various combinations of -l, -k, -w and -S to gksu[do]?

Offline

#5 2017-09-18 06:17:29

Fred7109
Member
Registered: 2015-05-17
Posts: 134

Re: [SOLVED] Programs from panel and terminal doesn't launch similarily

Hello Seth

Yes, I am elevating the privileges using sudo from an interactive shell, where it works as it should. I have tried with the combinations you proposed, when running the command from the panel, but trying the various combinations did not solve the problem either unfortunately. However, something else solved the problem (I really don't know why it makes a difference?), namely removing the quotations marks around my profile for chromium.

Thank you for the help.

Last edited by Fred7109 (2017-09-18 06:18:32)

Offline

#6 2017-09-18 07:03:16

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,876

Re: [SOLVED] Programs from panel and terminal doesn't launch similarily

ftr, you should not have to (single) quote parameters to gksudo - maybe it took the inner quotes "literally" or to quit the command parsing? (sounds like a bug in gksu)

Offline

Board footer

Powered by FluxBB