[13:04] <tauren> i'm considering migrating an init.d script to upstart. I've looked through the files in /etc/init, but I don't really get what gets run when you stop a service.
[13:04] <tauren> basically, my init.d script sets up a bunch of iptables rules, and when it is stopped, I want to remove them.
[13:11] <tauren> i see some scripts don't have a script or exec, they only have pre-start and post-stop. Maybe that's how I need to do it.
[13:11] <Keybuk> put them in a post-stop script
[13:11] <Keybuk> yes
[13:11] <Keybuk> then your job is "running" when the rules are in place
[13:11] <tauren> Keybuk, ok, cool.
[13:11] <Keybuk> even though there's no process associated
[13:11] <tauren> that makes sense now.
[13:12] <tauren> in my init.d script, I have another command that I can run:  service firewall report
[13:12] <tauren> can I add new "commands" with upstart?
[13:13] <tauren> Keybuk: basically, the report command just does:  iptables -nvx -t filter -L ACCOUNTING
[13:15] <Keybuk> not yet
[13:15] <Keybuk> it's planned
[13:16] <tauren> Keybuk, ok, thanks
[13:30] <tauren> Keybuk: any reason why I'm not getting any echo output?  I've got console output in my firewall.conf file and my pre-start script contains echo "Test", but doing start firewall doesn't respond with "Test"
[13:57] <tauren> oh, I see. Including "console output" makes the output go to the console. duh. But when I remove that, I still don't see the echo output at the command line when I run "start firewall"
[14:01] <Keybuk> removing that makes the output go to /dev/null
[15:39] <tauren> Keybuk, is there a way to get echos to be output then? Besides to the console or /dev/null? 
[15:39] <Keybuk> no
[15:40] <tauren> i've got my upstart script working perfectly, and am currently doing:  echo "Informational message" >> /tmp/firewall.out
[15:40] <tauren> but i would prefer the output to be on stdout.
[15:40] <tauren> ok then. thanks anyway!
[15:41] <Keybuk> right
[15:41] <Keybuk> but which stdout? :p
[15:42] <tauren> yeah, i see your point.  i mean if someone enters "start firewall" via an ssh session, they should see the output. but i wasn't thinking this would also be run at other times too.
[21:39] <tauren> what's the best way to start a service running as a particular user?
[21:40] <ion> su
[21:41] <tauren> i mean, i will create a new file /etc/init/jetty.conf, but I want the script that starts jetty to run as a user on the system.
[22:28] <tauren> Here is my upstart conf file: http://pastie.org/865735
[22:28] <tauren> when I do a "start jetty", a java process gets started
[22:28] <tauren> and it reports that it is started with a pid
[22:28] <tauren> but "status jetty" says it isn't running
[22:29] <tauren> and "stop jetty" doesn't work
[22:29] <tauren> how can I make this script start jetty as a user, and then be able to stop it by running "/home/$username/jetty/stop.sh" as the user?
[22:41] <Keybuk> "expect fork" or "expect daemon"
[23:26] <tauren> Keybuk, thanks, i'll try that