Results 1 to 3 of 3
Hello,
I built an embedded system and am running ubuntu 9.04 on it. The system does not have a keyboard mouse or anything attached to it, but a small touch ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 02-03-2010 #1Just Joined!
- Join Date
- Aug 2008
- Posts
- 17
restarting gdm on an embedded system
Hello,
I built an embedded system and am running ubuntu 9.04 on it. The system does not have a keyboard mouse or anything attached to it, but a small touch sensitive display.
X-windows (the touch screen driver) sometimes freezes and I need to restart X-windows.
The embedded system has a front panel with some buttons and I want to be able to restart X-windows using a key combination. The key panel is read/controlled with a daemon.
What I want is to restart X with a key combination, but how do I make the call? Something like:
system("service gdm restart > /dev/null"); doesn't seem to work. (probably because there's no shell?)
any ideas?
thanks,
Ron
- 02-04-2010 #2
you would need to have root access to issue commands to restart services, which is more likely the reason why it didn't work
- 02-04-2010 #3Just Joined!
- Join Date
- Aug 2008
- Posts
- 17
correct, the deamon runs as root.
Actually on Fedora 12 it just works, the problem I have is on a system running Ubuntu 9.04. (same/similar hardware).
Also, on both machines, when not running it as a deamon it just works.
(i checked the process on ubuntu, it runs as root there too)
I am using this:
if (execl("/etc/init.d/gdm", "/etc/init.d/gdm", "restart") == -1)
_exit(-1); // bummer, execl returned so it failed
in a fork since execl overwrites the process and /etc/init.d/gdm terminates if execl was successful


Reply With Quote

