/srv/irclogs.ubuntu.com/2011/04/14/#upstart.txt

=== marrusl is now known as marrusl_afk
=== marrusl_afk is now known as marrusl
JohnTeddyhttp://paste.pound-python.org/show/5215/07:44
JohnTeddyWhat is wrong with that script?07:44
JohnTeddyI want an ssh tunnel to start, everytime my computer connects to a network.07:45
JohnTeddySince my chrome, pidgin, and everything else is setup with ssh tunneling/localhost socks proxy07:45
sneumannHi, I am currently creating upstart scripts for the batch queueing system gridengine.07:48
sneumannThe pre-start script needs NFS directories to be present, so I have07:48
sneumannstart on (local-filesystems and remote-filesystems and net-device-up IFACE!=lo)07:48
sneumannand yet my /tmp/my-log output shows /vol/local/bin/register_sge.sh: No such file or directory07:48
sneumannScript is on http://pastebin.com/QKnP8neJ anything obvious I missed ?07:48
JohnTeddysneumann: You know more about upstart than I do, what's wrong with my script?07:58
sneumannwhat's the error ?08:01
sneumannstarting too early ?08:01
JohnTeddyIt just keeps restarting.08:01
JohnTeddyI'm not sure why, I don't know how to debug it.. or I can't find the log.08:02
sneumannremove the respawn for now, enable it once it works08:02
sneumannI guess it is started too early, namely before networking to mybox can happen08:02
sneumanntry my http://pastebin.com/QKnP8neJ line exec > /tmp/my-log 2>&108:03
sneumannAny Canonical people there ?08:03
sneumannupstart.canonical.com is down08:03
JohnTeddyI see, so gridengine is how you debug?08:05
sneumannno thats a batch system, debugging is via sending stdout/stderr to /tmp/my-log08:05
JanCabout upstart.canonical.com being down: there is upstart.at now12:27
JanCwould be nice if the old site would refer to that though...12:28
JanCJohnTeddy: first of all, the /etc/init/*.conf files are not scripts but configuration files  ;)12:32
JanCalso, what is the post-start script supposed to do?12:32
JanCand how does ssh login work?12:45
JohnTeddyJanC: I am in Shanghai.. so I can't visit facebook, youtube, twitter, and a large selection of other websites.13:25
JohnTeddySo 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:25
JohnTeddyThe annoying this is typing that command a few times a day.13:26
JohnTeddyEach 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:26
JohnTeddyI'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:27
JanCdo you need to type any password when connecting with ssh ?13:28
JohnTeddyno, I have sftp'd my ssh DSA certificate to the remote server in remote:/home/me/.ssh/known_hosts13:28
JohnTeddySo if I do 'ssh john@remote', I just get a shell with no password prompt.13:28
JanCso you haven't encrypted your private key...13:29
JanCokay, now one problem is that upstart runs ssh as root, and root probably doesn't have a private key that you uploaded...13:30
JohnTeddymmm, my disk is encrypted.13:30
JohnTeddyI 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
JohnTeddySo I don't believe my private key is easily accessible, and is not shared with anyone.13:31
JohnTeddyJanC: hmm, I see.13:31
JohnTeddyI don't want to run ssh as root anyway, that seems like a bad idea.13:31
JohnTeddyCan I just manually do 'su john; ssh blah blah;'?13:32
JanCyou can do su -c "ssh blah blah" john 13:33
JanCI think you also shouldn't use the -f option13:37
JanCbecause when it forks to the background, upstart will probably think it exits13:38
JohnTeddyI see.13:39
JohnTeddyJanC: So besides those changes, the script should work?13:39
JohnTeddyI googled for this ping command, it seemslike a better condition to be met, relative to the interface starting up.13:39
JanClike I said, it's not a script but a configuration file  ;)13:40
JanCJohnTeddy: the problem is that it gets run *after* ssh13:41
JanCso if you have no connection, ssh will always be run13:42
JanCand 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 connection13:43
JanCso it should be a pre-start script really13:47
JanCand it's probably better to make "start on" depend on a network device comming up13:47
sneumannhi, I am still trying to create an upstart job for the gridengine daemon, facing two problems:15:53
sneumann1) my job is not executed upon booting15:54
sneumann2) service gridengine stop simply hangs, and I don't know what it is waiting for.15:54
sneumannThe job is started with "expect fork", but I also tried "expect daemon"15:55
sneumannAny clues ? The full script is at http://pastebin.com/QKnP8neJ15:56
sneumannI tried "start on (startup and remote-filesystems)" but it is not triggered15:57
Keybukit 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 files22:22
Keybukupstart and shell22:22
ionheh22:24
JanCor that they are configuration files that contain snippets of shell code  ;)22:25
ionA 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:27
Keybukindeed22:29
ionOf course, nothing would prevent a very similar syntax that is in fact a DSL in a scripting language.22:30
JanCyou can say that about HTML too  ;)22:37
ionof course22:37
ion(html (head (title "foo") (script (on-click 'foo (alert "bar")))) (body (h1 "o hai") (p (id 'foo) "quux")))22:38
ionWeb scripting in the same language as the markup of content, anyone? :-P22:39
JanCMozilla configuration files are sort of JavaScript scripts too  ;)22:40
JanCMozilla/Firefox/etc.22:41
JanCor were (maybe not anymore nowadays that they have SQLite?)22:41
ionprefs.js still exists.22:42
=== robbiew is now known as robbiew_

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