[07:44] <JohnTeddy> http://paste.pound-python.org/show/5215/
[07:44] <JohnTeddy> What is wrong with that script?
[07:45] <JohnTeddy> I want an ssh tunnel to start, everytime my computer connects to a network.
[07:45] <JohnTeddy> Since my chrome, pidgin, and everything else is setup with ssh tunneling/localhost socks proxy
[07:48] <sneumann> Hi, I am currently creating upstart scripts for the batch queueing system gridengine.
[07:48] <sneumann> The pre-start script needs NFS directories to be present, so I have
[07:48] <sneumann> start on (local-filesystems and remote-filesystems and net-device-up IFACE!=lo)
[07:48] <sneumann> and yet my /tmp/my-log output shows /vol/local/bin/register_sge.sh: No such file or directory
[07:48] <sneumann> Script is on http://pastebin.com/QKnP8neJ anything obvious I missed ?
[07:58] <JohnTeddy> sneumann: You know more about upstart than I do, what's wrong with my script?
[08:01] <sneumann> what's the error ?
[08:01] <sneumann> starting too early ?
[08:01] <JohnTeddy> It just keeps restarting.
[08:02] <JohnTeddy> I'm not sure why, I don't know how to debug it.. or I can't find the log.
[08:02] <sneumann> remove the respawn for now, enable it once it works
[08:02] <sneumann> I guess it is started too early, namely before networking to mybox can happen
[08:03] <sneumann> try my http://pastebin.com/QKnP8neJ line exec > /tmp/my-log 2>&1
[08:03] <sneumann> Any Canonical people there ?
[08:03] <sneumann> upstart.canonical.com is down
[08:05] <JohnTeddy> I see, so gridengine is how you debug?
[08:05] <sneumann> no thats a batch system, debugging is via sending stdout/stderr to /tmp/my-log
[12:27] <JanC> about upstart.canonical.com being down: there is upstart.at now
[12:28] <JanC> would be nice if the old site would refer to that though...
[12:32] <JanC> JohnTeddy: first of all, the /etc/init/*.conf files are not scripts but configuration files  ;)
[12:32] <JanC> also, what is the post-start script supposed to do?
[12:45] <JanC> and how does ssh login work?
[13:25] <JohnTeddy> JanC: I am in Shanghai.. so I can't visit facebook, youtube, twitter, and a large selection of other websites.
[13:25] <JohnTeddy> So everytime I login, I type that ssh command. It forms an ssh tunnel to a remote server in California I own (the company owns). So chrome and pidgin are setup to use localhost:1080 as a socks proxy. So I can visit whatever websites I want, and not worry about certain things being blocked, or being snooped on.
[13:26] <JohnTeddy> The annoying this is typing that command a few times a day.
[13:26] <JohnTeddy> Each time I move my laptop, say from one office to another. Or sometimes the great Chinese firewall will kill off my ssh tunnel, so I have to start it again.
[13:27] <JohnTeddy> I'd li ke upstart to type this ssh command, as soon as I connect to the network, either over WiFi0 or eth0. I don't know anything about upstart, or programming in general.. so I'm struggling.
[13:28] <JanC> do you need to type any password when connecting with ssh ?
[13:28] <JohnTeddy> no, I have sftp'd my ssh DSA certificate to the remote server in remote:/home/me/.ssh/known_hosts
[13:28] <JohnTeddy> So if I do 'ssh john@remote', I just get a shell with no password prompt.
[13:29] <JanC> so you haven't encrypted your private key...
[13:30] <JanC> okay, now one problem is that upstart runs ssh as root, and root probably doesn't have a private key that you uploaded...
[13:30] <JohnTeddy> mmm, my disk is encrypted.
[13:31] <JohnTeddy> I am using cryptsetup, so when I boot my system.. busybox pops up.. and asks for a key before my large file system can be mounted (which included .ssh).
[13:31] <JohnTeddy> So I don't believe my private key is easily accessible, and is not shared with anyone.
[13:31] <JohnTeddy> JanC: hmm, I see.
[13:31] <JohnTeddy> I don't want to run ssh as root anyway, that seems like a bad idea.
[13:32] <JohnTeddy> Can I just manually do 'su john; ssh blah blah;'?
[13:33] <JanC> you can do su -c "ssh blah blah" john 
[13:37] <JanC> I think you also shouldn't use the -f option
[13:38] <JanC> because when it forks to the background, upstart will probably think it exits
[13:39] <JohnTeddy> I see.
[13:39] <JohnTeddy> JanC: So besides those changes, the script should work?
[13:39] <JohnTeddy> I googled for this ping command, it seemslike a better condition to be met, relative to the interface starting up.
[13:40] <JanC> like I said, it's not a script but a configuration file  ;)
[13:41] <JanC> JohnTeddy: the problem is that it gets run *after* ssh
[13:42] <JanC> so if you have no connection, ssh will always be run
[13:43] <JanC> and it will probably fail because early during boot there is no connection, exit with an error, get restarted by upstart, repeat until there is a connection--then you test if there is a connection
[13:47] <JanC> so it should be a pre-start script really
[13:47] <JanC> and it's probably better to make "start on" depend on a network device comming up
[15:53] <sneumann> hi, I am still trying to create an upstart job for the gridengine daemon, facing two problems:
[15:54] <sneumann> 1) my job is not executed upon booting
[15:54] <sneumann> 2) service gridengine stop simply hangs, and I don't know what it is waiting for.
[15:55] <sneumann> The job is started with "expect fork", but I also tried "expect daemon"
[15:56] <sneumann> Any clues ? The full script is at http://pastebin.com/QKnP8neJ
[15:57] <sneumann> I tried "start on (startup and remote-filesystems)" but it is not triggered
[22:22] <Keybuk> it strikes me that the Upstart documentation is sorely missing the page from the Make documentation that explains that there are really two separate syntaxes in the files
[22:22] <Keybuk> upstart and shell
[22:24] <ion> heh
[22:25] <JanC> or that they are configuration files that contain snippets of shell code  ;)
[22:27] <ion> A lot of people do seem to talk about Upstart “scripts”. That might indicate they have the wrong impression of the semantics of the job definitions.
[22:29] <Keybuk> indeed
[22:30] <ion> Of course, nothing would prevent a very similar syntax that is in fact a DSL in a scripting language.
[22:37] <JanC> you can say that about HTML too  ;)
[22:37] <ion> of course
[22:38] <ion> (html (head (title "foo") (script (on-click 'foo (alert "bar")))) (body (h1 "o hai") (p (id 'foo) "quux")))
[22:39] <ion> Web scripting in the same language as the markup of content, anyone? :-P
[22:40] <JanC> Mozilla configuration files are sort of JavaScript scripts too  ;)
[22:41] <JanC> Mozilla/Firefox/etc.
[22:41] <JanC> or were (maybe not anymore nowadays that they have SQLite?)
[22:42] <ion> prefs.js still exists.