[04:02] <luke-jr> how can I get upstart to log all output to a file?
[09:00] <dude__> I'm searching for a way to disable upstart jobs via a command, is this possible?
[14:45] <frederickjh> Anyone know a method to run a upstart job as another user and still have it run with an exec command in the .conf file?
[14:48] <frederickjh> When ever I try to pass the username to run it as it then gets interpreted by the shell and then running  status <jobname> tells me it is not running, but ps -C <jobname> shows it is running.
[18:10] <JanC> frederickjh: what do you use to run it as a certain user?
[18:11] <JanC> and the difference between status & ps is probably because you need another 'expect' stanza in the job file
[18:43] <frederickjh> JanC I am using sudo -u username command to run the job.
[18:44] <frederickjh> What is a 'expect' stanza?  Where do I find more info about it, JanC?
[18:44] <frederickjh> I have not come across that command in any of the upstart docs/info I have found.
[18:45] <JanC> it's in the manual page
[18:46] <JanC> init(5) manpage
[18:46] <frederickjh> ok
[18:46] <frederickjh> I will check it out.
[18:46] <JanC> so, run 'man 5 init'
[18:46] <frederickjh> why the 5?
[18:46] <frederickjh> why not man init ?
[18:48] <JanC> because there are manpages for init in more than 1 category
[18:48] <frederickjh> I see it brings up a different man page.
[18:48] <JanC> see 'man man' for more info about these categories
[18:48] <frederickjh> ok
[18:48] <frederickjh> thansk
[18:48] <frederickjh> thanks!
[18:49] <JanC> e.g. 5 is for file format description 
[18:49] <frederickjh> ok
[18:51] <frederickjh> ok I am using expect fork now that I reread my job maybe in need expect daemon as that is what the processes are.
[18:51] <JanC> frederickjh: if you look at the default 'man init', you'll see init(8) at the top right, meaning that one is in section 8, and at the bottom it lists init(5) in the SEE ALSO list
[18:52] <frederickjh> ok
[18:52] <JanC> might be useful for other programs in the future  ☺
[18:55] <frederickjh> yes
[18:56] <frederickjh> one other question.  Right now I am specifying the username in the command but I would like to some how pass it to the command without a variable.
[18:57] <frederickjh> As, when I use a variable it get interpreted by the shell and the status never shows it running, but maybe the expect daemon will fix that.
[18:57] <Kasuko> what does "stop on runlevel" mean in a job? My upstart isn't running rc-sysinit properly and as such anything depending on runlevel or any old style sysvinit scripts aren't executed.
[19:00] <Kasuko> runing Ubuntu 10.04
[19:02] <JanC> "stop on runlevel 5" will stop a job when the "runlevel 5" event is emitted (by telinit, normally)
[19:03] <Kasuko> I know but what is "stop on runlevel" with no number
[19:04] <JanC> I don't think that's supposed to make sense
[19:05] <Kasuko> "stop on runlevel" is in my rc-sysinit.conf job
[19:06] <JanC> right
[19:06] <Kasuko> so thats not the problem?
[19:06] <JanC> no
[19:07] <Kasuko> Dang!
[19:07] <Kasuko> Thought I was close
[19:07] <Kasuko> anyway to debug what upstart has done? initctl list doesnt return anything
[19:08] <ion> It stops the job on any runlevel event.
[19:09] <Kasuko> so basically when it's done it's job stop. Makes sense. But I am never getting the telinit 2 that should be running (or if I am it's not being registered)
[19:10] <ion> https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/543506 perhaps
[19:15] <Kasuko> sorta Looks similar but they are all getting output from initctl list where I get nothing
[19:17] <ion> Huh. That’s strange.
[19:17] <ion> What does, say, ‘status rc’ output?
[19:18] <Kasuko> mediapc-desktop.root ~: initctl list
[19:18] <Kasuko> mediapc-desktop.root ~: status rc
[19:18] <Kasuko> mediapc-desktop.root ~: return 1
[19:18] <Kasuko> mediapc-desktop.root ~:                                                       1
[19:19] <Kasuko> if you see there is a 1 to the right of the last line, thats the error code. I am getting no output AND no error codes
[19:21] <ion> echo foo; >&2 echo bar
[19:25] <Kasuko> mediapc-desktop.root ~: echo foo; >&2 echo bar                                1
[19:25] <Kasuko> foo
[19:25] <Kasuko> bar
[19:31] <Kasuko> Should I be posting a bug report?
[19:33] <ion> Please run ‘strace -o strace.initctl status rc’ first and share strace.initctl via a pastebin or equivalent.
[19:38] <Kasuko> I dont need pastebin, nothing is returned
[19:40] <ion> strace.initctl is empty?
[19:44] <Kasuko> ah my bad, it's output to a file, my apologies
[19:49] <Keybuk> compare "status rc" as a user and as root?
[20:28] <Kasuko> Sorry for delay, something came up. http://pastebin.com/UTuYdNYg
[20:29] <Kasuko> mediapc-desktop.root ~: status rc
[20:29] <Kasuko> mediapc-desktop.root ~: exit
[20:29] <Kasuko> mediapc-desktop.kasuko ~: status rc
[20:29] <Kasuko> mediapc-desktop.kasuko ~:
[20:29] <Kasuko> no difference
[20:54] <Kasuko> anything? 
[21:23] <Keybuk> no idea, your strace makes it look like an empty executable
[21:24] <ion> kasuko: What distro are you running?
[21:26] <Kasuko> anything? ubuntu 10q.04
[21:26] <Kasuko> oops sorry about thee repeat
[21:27] <Keybuk> status --help ?
[21:29] <ion> Please pastebin the output of apt-cache policy upstart; md5sum /sbin/initctl; grep sbin/initctl /var/lib/dpkg/info/upstart.md5sums
[21:32] <Kasuko> status --help displays the standard help output
[21:34] <Kasuko> http://pastebin.com/4TKeWN6X
[21:34] <Kasuko> they aren't the same
[21:37] <Kasuko> but I have tried apt-get install --reinstall upstart earlier today
[21:37] <ion> ls -l /sbin/initctl; file /sbin/initctl; dpkg-divert --list '*initctl*'
[21:38] <Kasuko> lrwxrwxrwx 1 root root 9 2010-05-12 21:34 /sbin/initctl -> /bin/true
[21:38] <Kasuko> /sbin/initctl: symbolic link to `/bin/true'
[21:38] <Kasuko> local diversion of /sbin/initctl to /sbin/initctl.distrib
[21:38] <Kasuko> are you kidding me?
[21:39] <Kasuko> wtf
[21:40] <Kasuko> ya running initctl.distrib list gives me the proper output
[21:41] <Kasuko> so why would that happen?
[21:42] <ion> Good question
[21:43] <ion> keybuk: I take it upstart maintscripts have never done any diversions in the past?
[21:45] <Keybuk> nope
[21:45] <Keybuk> people do it in chroots
[21:45] <Keybuk> for fun, profit, and to take over the world
[21:48] <Kasuko> This isn't a chroot though, nor am I in it for profits or taking over the world ... but that would be nice
[21:49] <ion> kasuko: I take it you’re the only one with root access to the box? :-)
[21:49] <Kasuko> Yes
[21:49] <Kasuko> Why, should I be worried?
[21:50] <Kasuko> maybe I'm not the only one with root access anymore :S
[21:50] <Keybuk> seems an odd thing to do
[21:52] <Kasuko> There are no erroneus users and I never changed the root password from randomly generated
[21:52] <ion> I’m out of ideas for now.
[21:53] <Kasuko> I'm just more curious if I should be reporting it as a bug somewhere or if it was a one time thing
[21:53] <Keybuk> debootstrap does it, but it usually undoes it
[21:53] <Keybuk> bug where?  until you know what made the diversion, nowhere to file the bug
[21:53] <Keybuk> unless we can file "something strange is afoot" bugs on the universe?
[21:53] <Keybuk> for example
[21:53] <Keybuk> <fx: best police officer's voice>
[21:54] <Keybuk> What were you doing on, or around, the 12th of May at approximately 9.34 pee emm ?
[21:54] <Kasuko> True, well I just linked initctl to initctl.distrib but that just solves the list. Now I am going to try the work around from that bug report
[21:57] <ion> The proper way to remove the diversion is dpkg-divert --rename --remove /sbin/initctl
[22:01] <ion> Running the two commands listed in https://wiki.ubuntu.com/LucidLynx/ReleaseNotes#Upstart%20jobs%20cannot%20be%20run%20in%20a%20chroot would result precisely in what your system has. How that has ended up happening is unclear.
[22:08] <luke-jr> how can I get upstart to log all output to a file?
[22:09] <Keybuk> it logs to syslog by default
[22:10] <luke-jr> there is no syslog on this machine
[22:10] <Keybuk> in that case, it logs to the console
[22:10] <luke-jr> I know that. It scrolls by too fast to read.
[22:10] <luke-jr> that's why I need it in a file
[22:13] <Keybuk> so install syslog
[22:13] <Keybuk> or something that captures the console output
[22:15] <luke-jr> I've found it basically impossible to capture console output since Upstart reopens /dev/console
[22:15] <luke-jr> rather than using the stdin/out it inherits from pre-init
[22:16] <Keybuk> sure you can
[22:16] <Keybuk> e.g. bootlogd
[22:18] <luke-jr> any idea where i can get bootlogd? :/
[22:21] <Kasuko> I can confrim that the work around in 543506 fixed the other issue. Thank you
[22:23] <luke-jr> found one, but bootlogd seems to require CONFIG_LEGACY_PTY, which I cannot provide it... (or can I?)