Results 1 to 5 of 5

Thread: execute command before lightdm starts

  1. #1
    Join Date
    Dec 2011
    Beans
    8

    execute command before lightdm starts

    Hello
    I am trying to execute some commands before and after llightdm starts

    This is how part of my /etc/init/lightdm.conf looks like:

    Code:
        exec irsend SEND_ONCE AVR260 KEY_POWER &
        sleep 10 ;
        exec lightdm &
        sleep 30 ;
        exec irsend SEND_ONCE AVR260 KEY_POWER2
    Code:
    irsend SEND_ONCE AVR260 KEY_POWER
    is used to turn on my amplituner
    then i wanted to add some sleep to make sure it is up
    after that lightdm should start
    and when all services start from ~/.config/autostart
    amplituner should be turned off by command
    Code:
    exec irsend SEND_ONCE AVR260 KEY_POWER2
    So this is how it looks like now
    On reboot amplituner starts - that part works fine.
    On TV screen i am stuck on shell login screen and nothing hapends further
    Then amplituner shuts down as expected.
    So why i have problem with that "exec lightdm" command?
    How can i modify this script to do what i want?

    Happy New Year to everyone

  2. #2
    Join Date
    Apr 2012
    Beans
    6,044

    Re: execute command before lightdm starts

    I think your issue is the use of 'exec' - that replaces the current (shell) process so afaik the script will never reach the following commands?

    TBH I'm not sure that putting these commands directly in /etc/init/lightdm.conf is the 'right' way to do what you want - there may be some predefined hooks in the upstart mechanism for that kind of thing (greeter-setup-script maybe?)

  3. #3
    Join Date
    Dec 2011
    Beans
    8

    Re: execute command before lightdm starts

    well my knowledge of ubuntu is rather minimal so far.
    I struggle with each problem - small stepps so far.

    lightdm was the only way i could think of.
    if exec command interrupts anything why last one is executed?
    I mean amplituner turns off as desired.
    just middle part seems broken
    exec lightdm


  4. #4
    Join Date
    Dec 2011
    Beans
    8

    Re: execute command before lightdm starts

    Ok then seems im doing it wrong way.
    Command for turning on amplituner:

    Code:
    irsend SEND_ONCE AVR260 KEY_POWER
    i need to start that after lirc starts and before lightdm is called.
    What would it be the best place to put that or what would be best way to call it?
    If anyone have idea preety please help me - i struggle with it whole afternoon

  5. #5
    Join Date
    Sep 2006
    Beans
    8,176
    Distro
    Ubuntu 14.04 Trusty Tahr

    pre-start

    Wouldn't you use the 'pre-start' stanza in lightdm.conf to run a script before lightdm starts? Again, avoid 'exec'
    The Truth Shall Make Ye Fret.

Tags for this Thread

Bookmarks

Posting Permissions

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