Find the answer to your Linux question:
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.
  1. #1
    Just 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

  2. #2
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    you would need to have root access to issue commands to restart services, which is more likely the reason why it didn't work

  3. #3
    Just Joined!
    Join Date
    Aug 2008
    Posts
    17
    Quote Originally Posted by coopstah13 View Post
    you would need to have root access to issue commands to restart services, which is more likely the reason why it didn't work
    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

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •