/srv/irclogs.ubuntu.com/2010/03/11/#upstart.txt

=== rberger_ is now known as rberger
taureni'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
taurenbasically, my init.d script sets up a bunch of iptables rules, and when it is stopped, I want to remove them.13:04
taureni 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
Keybukput them in a post-stop script13:11
Keybukyes13:11
Keybukthen your job is "running" when the rules are in place13:11
taurenKeybuk, ok, cool.13:11
Keybukeven though there's no process associated13:11
taurenthat makes sense now.13:11
taurenin my init.d script, I have another command that I can run:  service firewall report13:12
taurencan I add new "commands" with upstart?13:12
taurenKeybuk: basically, the report command just does:  iptables -nvx -t filter -L ACCOUNTING13:13
Keybuknot yet13:15
Keybukit's planned13:15
taurenKeybuk, ok, thanks13:16
taurenKeybuk: 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:30
taurenoh, 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"13:57
Keybukremoving that makes the output go to /dev/null14:01
taurenKeybuk, is there a way to get echos to be output then? Besides to the console or /dev/null? 15:39
Keybukno15:39
taureni've got my upstart script working perfectly, and am currently doing:  echo "Informational message" >> /tmp/firewall.out15:40
taurenbut i would prefer the output to be on stdout.15:40
taurenok then. thanks anyway!15:40
Keybukright15:41
Keybukbut which stdout? :p15:41
taurenyeah, 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.15:42
=== Caesar_ is now known as Caesar
=== blueyed_ is now known as blueyed
taurenwhat's the best way to start a service running as a particular user?21:39
ionsu21:40
taureni 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.21:41
=== rberger_ is now known as rberger
taurenHere is my upstart conf file: http://pastie.org/86573522:28
taurenwhen I do a "start jetty", a java process gets started22:28
taurenand it reports that it is started with a pid22:28
taurenbut "status jetty" says it isn't running22:28
taurenand "stop jetty" doesn't work22:29
taurenhow 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:29
Keybuk"expect fork" or "expect daemon"22:41
=== robbiew is now known as robbiew_
taurenKeybuk, thanks, i'll try that23:26

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