xnox | does nih_list_add_before exist? | 15:26 |
---|---|---|
Varazir | Hello | 17:45 |
Varazir | Hello I have made a script to run on up start http://pastebin.ca/2291905 I get error " /proc/self/fd/9: 18: [: on: unexpected operator" if I run the script by it self like this http://pastebin.ca/2291900 it works | 17:46 |
SpamapS | Varazir: thats interesting... | 17:48 |
SpamapS | Varazir: it kind of looks like the variable expansion isn't working right | 17:49 |
Varazir | ok | 17:50 |
Varazir | is there a way to easy debug ? | 17:50 |
SpamapS | Varazir: but I don't see any obvious reason that would fail | 17:50 |
SpamapS | Varazir: set -x | 17:50 |
SpamapS | Varazir: also if you're on 12.04 or later, you should get any uncaught output in /var/log/upstart/yourjobname.log | 17:50 |
Varazir | it's where I found the error msg | 17:51 |
Varazir | set -x didn't give any more info | 17:52 |
xnox | Varazir: what is $1? | 17:55 |
Varazir | 8 or 0 | 17:56 |
Varazir | err 5 or 0 | 17:56 |
Varazir | the script starts up my TV and AVR befor lightdm starts XBMC | 17:57 |
Varazir | using a CEC adapter | 17:57 |
jrib | Varazir: maybe you can check what the value of $power actually is before it enters until? | 17:58 |
=== broder_ is now known as broder | ||
SpamapS | the ""'s should, in theory, handle that | 17:59 |
SpamapS | Varazir: I see what xnox is asking. There's a reference to $1 without anything setting it. Upstart certainly won't set it | 17:59 |
SpamapS | On line 21 | 18:00 |
SpamapS | power=$(cec_power $1) >/dev/null 2>&1 # Assign power state to $power | 18:00 |
SpamapS | thats basically always going to be just $(cec_power) | 18:00 |
Varazir | yes it's inside a function | 18:00 |
Varazir | that I call with the value 0 or 5 | 18:00 |
jrib | oh, yes, line 21 is part of the cec_power_on() definition... I missed that | 18:01 |
Varazir | echo "test $power" should give me output in the upstart log file correct ? | 18:02 |
jrib | *cough* indentation *cough* :) | 18:02 |
SpamapS | oh right, its indented horribly ok | 18:02 |
SpamapS | Varazir: yeah, you really need to start indenting things | 18:02 |
Varazir | I have just that pastebin dosn't show it | 18:03 |
Varazir | err it indenting stuff | 18:04 |
Varazir | I see I should ofc indent the untill loop too | 18:04 |
Varazir | I added echo "test $power" but nothing came up in the log file | 18:06 |
Varazir | it's strange that it keeps running the untill loop | 18:09 |
Varazir | I can see in my own logfile that the $power is set | 18:10 |
Varazir | tested the script again standalone and it worked like a charm | 18:13 |
SpamapS | Varazir: perhaps the cec tools expect some env vars to be set. | 18:14 |
Varazir | I can't see it's that complaning over | 18:15 |
jrib | you have = in one script and == in the other by the way | 18:15 |
Varazir | that's changed | 18:15 |
Varazir | http://pastebin.ca/2291931 | 18:16 |
jrib | Varazir: if you change "#!/bin/sh" to "#!/bin/sh -e", the result is the same? I'm not sure why it would matter, but let's see... | 18:17 |
Varazir | worked | 18:18 |
Varazir | same result | 18:18 |
Varazir | http://pastebin.ca/2291935 output with set -x running the script | 18:19 |
Varazir | init-checkconf /etc/init/start-htpc.conf | 18:21 |
Varazir | ERROR: failed to ask Upstart to check conf file | 18:21 |
slangasek | xnox: do you plan to take care of Debian bug #695604 in libnih, or should I add it to my list? | 18:23 |
Varazir | http://pastebin.ca/2291936 | 18:23 |
Varazir | jrib: and SpamapS: I need to go I'm back in 1.5 | 18:24 |
Varazir | hour | 18:24 |
Varazir | ello | 20:54 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!