comparison logstash.rc @ 4:29ffaf4e0a7f

keep 7 days of data; more readable init script
author Carl Byington <carl@five-ten-sg.com>
date Thu, 07 Mar 2013 21:24:02 -0800
parents 796ac0b50dbf
children 6b7beb807d14
comparison
equal deleted inserted replaced
3:796ac0b50dbf 4:29ffaf4e0a7f
45 # 45 #
46 # Function that starts the daemon/service 46 # Function that starts the daemon/service
47 # 47 #
48 do_start() { 48 do_start() {
49 cd $HOME 49 cd $HOME
50 pid=$(su logstash -c 'echo -e "'"$JAVA $ARGS"' </dev/null >'"$LOGFILE"' 2>&1 & \n echo \$!" | bash') 50 pid=$(
51 exec sudo -u logstash /bin/bash - <<EOF
52 $JAVA $ARGS </dev/null >$LOGFILE 2>&1 &
53 echo \$!
54 EOF
55 )
56 #pid=$(su logstash -c 'echo -e "'"$JAVA $ARGS"' </dev/null >'"$LOGFILE"' 2>&1 & \n echo \$!" | bash')
51 echo $pid >$PIDFILE 57 echo $pid >$PIDFILE
52 [ -n "$pid" ] && success $"$base startup" || failure $"$base startup" 58 [ -n "$pid" ] && success $"$base startup" || failure $"$base startup"
53 # might try
54 #id
55 #exec sudo -u transmission /bin/sh - << eof
56 #id
57 #eof
58 } 59 }
59 60
60 61
61 # 62 #
62 # Function that stops the daemon/service 63 # Function that stops the daemon/service