Run Xserver as root with script

This forum is for topics dealing with problems with software specifically in the ARMv6h repo.

Run Xserver as root with script

Postby JesusCruz » Thu Aug 28, 2014 11:02 am

Hi everyone

I am working with an ARMStone a9 board which has iMX6 linux kernel. I am doing an embedded application in which I have to show a video from Ipcamera. The thing is that I attached the screen to my board, I switch my board on, I login as root, I start the Xserver("startx &"), and then I run my application and everything is works properly.

My problem is because I want that when I switch my board on the Xserver run automatically. I do an script in which I execute the command "startx &", but it does start.

I have been investigated and I find out that the Xserver should be run as root, then I think that when the script starts and run the Xserver run it without root privileges then run wrong.

But I do not know how can I run the Xserver as root and if is possible in automatically way, with a script.

Thanks guys
JesusCruz
 
Posts: 6
Joined: Thu Aug 28, 2014 10:56 am

Re: Run Xserver as root with script

Postby pepedog » Thu Aug 28, 2014 12:12 pm

pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Run Xserver as root with script

Postby JesusCruz » Thu Aug 28, 2014 12:24 pm

mmm I think that the second link could be, but to be honest I do not know what could I use. I just want to start the xserver with a script automatically, and I think that I need to run as root, but even I am not sure if it is necessary.
JesusCruz
 
Posts: 6
Joined: Thu Aug 28, 2014 10:56 am

Re: Run Xserver as root with script

Postby JesusCruz » Thu Aug 28, 2014 12:25 pm

I am pretty new with ARM architecture and embedded system
JesusCruz
 
Posts: 6
Joined: Thu Aug 28, 2014 10:56 am

Re: Run Xserver as root with script

Postby pepedog » Thu Aug 28, 2014 1:21 pm

Are you trying to auto run desktop, or just the app?
Systemd, the thing that starts up things on boot, need full paths to things, ie /usr/bin/startx
You can auto start an app without a desktop. Like
/usr/bin/xorg-xinit /path-to-app/app-name
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Run Xserver as root with script

Postby JesusCruz » Thu Aug 28, 2014 1:58 pm

In my board I do not have S.O,. I just trying to run the start the Xserver with a script which I put in the init.d. In the script I just set this:

ifconfig eth0 X.X.X.X up
startx &

So do you mean that if I want to start the Xserver I should put the complete path?
Thanks
JesusCruz
 
Posts: 6
Joined: Thu Aug 28, 2014 10:56 am

Re: Run Xserver as root with script

Postby WarheadsSE » Thu Aug 28, 2014 2:10 pm

$this->bbcode_second_pass_quote('JesusCruz', 'I') do not have S.O

What?
$this->bbcode_second_pass_quote('JesusCruz', 'I') just trying to run the start the Xserver with a script which I put in the init.d.

Arch doesn't exactly use init.d anymore....
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Run Xserver as root with script

Postby JesusCruz » Thu Aug 28, 2014 2:17 pm

Only has a simple sysroot based on Linux. This is my board http://www.fs-net.de/en/products/armstone/armstonea9/
JesusCruz
 
Posts: 6
Joined: Thu Aug 28, 2014 10:56 am

Re: Run Xserver as root with script

Postby WarheadsSE » Thu Aug 28, 2014 2:20 pm

See, since you're on the Arch Linux ARM forum, wer're giving you directions like it was Arch.

You should have a look at the Xorg log, since that probably will tell you why it shut off.

If you are starting something in the manner you say, it is running as root, but you're likely not in a state that is sufficient for X to be actually starting.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Run Xserver as root with script

Postby pepedog » Thu Aug 28, 2014 2:24 pm

My Prius doesn't run arch, I wonder if that uses systemd to start up? Wait, I see the start button now.
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Next

Return to ARMv6h

Who is online

Users browsing this forum: No registered users and 2 guests