LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   why there's no output on my screen? ubuntu upstart event (https://www.linuxquestions.org/questions/linux-software-2/why-theres-no-output-on-my-screen-ubuntu-upstart-event-4175455894/)

suitianshi 03-28-2013 06:01 AM

why there's no output on my screen? ubuntu upstart event
 
I added a new file test.conf to /etc/init/, content as below:

start on test
stop on shutdown
console output
exec echo hello

and I used "initctl emit laji" to trigger it but no console output.

what am i doing wrong?

eSelix 03-28-2013 06:47 AM

Why "laji"? Your event is called "test". Also this example it is rather a task and not service, so "task" keyword should be included.

suitianshi 03-28-2013 07:37 AM

sorry for my mistake, event name is "test".
is the term "task" necessary?

start on test
task
console output
exec echo hello

is the above correct?
i'm using windows and thus cann't try it out.

eSelix 03-28-2013 09:07 PM

Task is not neccessary in this situation, but your executed command is a task (start, do what must do and end) as opposed to service, which start on event emit and stop on event stop condition. You can get unexpected behavior. For example when you add later "respawn" ("echo" will respawn forever).

This is correct and should work.


All times are GMT -5. The time now is 11:21 PM.