Author Topic: What is the console for raspberry and how to set "sudo"  (Read 5446 times)

Offline typicalc

  • Multiple posting newcomer
  • *
  • Posts: 18
What is the console for raspberry and how to set "sudo"
« on: June 28, 2016, 08:40:18 am »
I have two questions that I have not found an answer:

1) When I launch a program in debugging mode I get an error "Can't launch console ..". I am using Raspberry Pi 3.
How do I set the right terminal in Codeblocks? I tried several options at Settings->General Settings->"Terminal to launch programs" to no avail.

My second question:

2) When launching a program how do I set "root" capabilities (I'm twiddling the GPIO), ie. how do I lauch it using "sudo ./myprogramname" etc.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: What is the console for raspberry and how to set "sudo"
« Reply #1 on: June 28, 2016, 10:38:49 am »
1. Do you have the terminals listed in the UI installed on the system?
2. I don't think you can at the moment.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline typicalc

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: What is the console for raspberry and how to set "sudo"
« Reply #2 on: June 28, 2016, 11:13:28 am »
The Rasberry "Rasbian" (of Debian) terminal program is "LXTerminal"
I tried what was availabe and tried entering LXTerminal also but still no luck.

Is debugging really out of the questing when I need root permission? Any workarounds?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: What is the console for raspberry and how to set "sudo"
« Reply #3 on: June 28, 2016, 08:54:56 pm »
Probably attaching to a running process, but I'n not sure if non-root users are allowed to do it either.

Another option is starting gdbserver as root using remote debugging in cb. I've not tried it and I'm not sure if it will work.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

ariebonn

  • Guest
Re: What is the console for raspberry and how to set "sudo"
« Reply #4 on: July 05, 2016, 12:41:37 pm »
I've been running C::B from terminal using "sudo codeblocks" to work around the root issue. Maybe that will help you?

Offline typicalc

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: What is the console for raspberry and how to set "sudo"
« Reply #5 on: July 16, 2016, 12:41:40 pm »
Thanks,

Running "sudo codeblocks" helped.

Can you help me with the terminal? I've tried to set lxterminal etc. to no avail.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: What is the console for raspberry and how to set "sudo"
« Reply #6 on: July 16, 2016, 12:58:21 pm »
Can you help me with the terminal? I've tried to set lxterminal etc. to no avail.
Have you tried if running the command in another terminal works?
What is the output of lxterminal --help?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline typicalc

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: What is the console for raspberry and how to set "sudo"
« Reply #7 on: August 08, 2016, 01:29:13 pm »
Typing
$ lxterminal --help
gives me;
Code
Usage:
  lxterminal [Options...] - LXTerminal is a terminal emulator

Options:
  -e, --command=STRING             Execute the argument to this option inside the terminal
  --geometry=COLUMNSxROWS          Set the terminal's size
  -l, --loginshell                 Execute login shell
  -t, -T, --title=,
    --tabs=NAME[,NAME[,NAME[...]]] Set the terminal's title
  --working-directory=DIRECTORY    Set the terminal's working directory

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: What is the console for raspberry and how to set "sudo"
« Reply #8 on: August 09, 2016, 08:38:18 pm »
What is the command you've specified in the settings?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline typicalc

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: What is the console for raspberry and how to set "sudo"
« Reply #9 on: August 10, 2016, 09:56:36 am »
I am using
Code
lxterminal --title=$TITLE -e
That does produce an error message in the debugger tab when starting a debugging session.

If I open a terminal manually and type "lxterminal --title="hello" -e" and press Enter it opens another terminal window with no problems.

I am running Code::Blocks 13.12 on the Raspberry (installed it a few months ago). I dunno if a newer version (16.01) is available. Imho "Rasbian" is a derivative of Debia - not sure though.
« Last Edit: August 10, 2016, 11:12:47 am by typicalc »

Offline typicalc

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: What is the console for raspberry and how to set "sudo"
« Reply #10 on: September 01, 2016, 06:51:21 pm »
At last I found what was the problem.
At "Project"->"Set programs' arguments" I had to check on "Run host in terminal".