changeset 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
files logstash.cron logstash.rc
diffstat 2 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/logstash.cron	Thu Mar 07 10:41:01 2013 -0800
+++ b/logstash.cron	Thu Mar 07 21:24:02 2013 -0800
@@ -1,4 +1,4 @@
 #!/bin/bash
 
-/usr/local/bin/logstash_index_cleaner.py -d 2
+/usr/local/bin/logstash_index_cleaner.py -d 7
 
--- a/logstash.rc	Thu Mar 07 10:41:01 2013 -0800
+++ b/logstash.rc	Thu Mar 07 21:24:02 2013 -0800
@@ -47,14 +47,15 @@
 #
 do_start() {
     cd $HOME
-    pid=$(su logstash -c 'echo -e "'"$JAVA $ARGS"' </dev/null >'"$LOGFILE"' 2>&1 & \n echo \$!" | bash')
+    pid=$(
+    exec sudo -u logstash /bin/bash - <<EOF
+        $JAVA $ARGS </dev/null >$LOGFILE 2>&1 &
+        echo \$!
+EOF
+    )
+    #pid=$(su logstash -c 'echo -e "'"$JAVA $ARGS"' </dev/null >'"$LOGFILE"' 2>&1 & \n echo \$!" | bash')
     echo $pid >$PIDFILE
     [ -n "$pid" ] && success $"$base startup" || failure $"$base startup"
-    # might try
-    #id
-    #exec sudo -u transmission /bin/sh - << eof
-    #id
-    #eof
 }