/srv/irclogs.ubuntu.com/2012/12/12/#upstart.txt

xnoxdoes nih_list_add_before exist?15:26
VarazirHello 17:45
VarazirHello 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
SpamapSVarazir: thats interesting...17:48
SpamapSVarazir: it kind of looks like the variable expansion isn't working right17:49
Varazirok 17:50
Varaziris there a way to easy debug ? 17:50
SpamapSVarazir: but I don't see any obvious reason that would fail17:50
SpamapSVarazir: set -x17:50
SpamapSVarazir: also if you're on 12.04 or later, you should get any uncaught output in /var/log/upstart/yourjobname.log17:50
Varazirit's where I found the error msg 17:51
Varazirset -x didn't give any more info 17:52
xnoxVarazir: what is $1?17:55
Varazir8 or 0 17:56
Varazirerr 5 or 0 17:56
Varazirthe script starts up my TV and AVR befor lightdm starts XBMC17:57
Varazirusing a CEC adapter 17:57
jribVarazir: maybe you can check what the value of $power actually is before it enters until?17:58
=== broder_ is now known as broder
SpamapSthe ""'s should, in theory, handle that17:59
SpamapSVarazir: I see what xnox is asking. There's a reference to $1 without anything setting it. Upstart certainly won't set it17:59
SpamapSOn line 2118:00
SpamapSpower=$(cec_power $1) >/dev/null 2>&1   # Assign power state to $power 18:00
SpamapSthats basically always going to be just   $(cec_power)18:00
Varaziryes it's inside a function 18:00
Varazirthat I call with the value 0 or 5 18:00
jriboh,  yes, line 21 is part of the cec_power_on() definition... I missed that18:01
Varazirecho "test $power" should give me output in the upstart log file correct ? 18:02
jrib*cough* indentation *cough* :)18:02
SpamapSoh right, its indented horribly ok18:02
SpamapSVarazir: yeah, you really need to start indenting things18:02
VarazirI have just that pastebin dosn't show it 18:03
Varazirerr it indenting stuff 18:04
VarazirI see I should ofc indent the untill loop too18:04
VarazirI added echo "test $power" but nothing came up in the log file 18:06
Varazirit's strange that it keeps running the untill loop 18:09
VarazirI can see in my own logfile that the $power is set 18:10
Varazirtested the script again standalone and it worked like a charm 18:13
SpamapSVarazir: perhaps the cec tools expect some env vars to be set.18:14
VarazirI can't see it's that complaning over 18:15
jribyou have = in one script and == in the other by the way18:15
Varazirthat's changed 18:15
Varazirhttp://pastebin.ca/229193118:16
jribVarazir: 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
Varazirworked18:18
Varazirsame result 18:18
Varazirhttp://pastebin.ca/2291935 output with set -x running the script 18:19
Varazirinit-checkconf /etc/init/start-htpc.conf18:21
VarazirERROR: failed to ask Upstart to check conf file18:21
slangasekxnox: do you plan to take care of Debian bug #695604 in libnih, or should I add it to my list?18:23
Varazirhttp://pastebin.ca/229193618:23
Varazirjrib: and SpamapS: I need to go I'm back in 1.5 18:24
Varazirhour 18:24
Varazirello 20:54

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!