3

I would like to run the ELK stack in a FreeBSD Jail on an FreeNAS host. I have a hard time to get an simple init/rc.d script to work.

#!/bin/sh . /etc/rc.subr name=logstash rcvar=logstash_enable load_rc_config $name logstash_bin="/usr/local/bin/${name}/bin/${name}" logstash_conf="/usr/local/etc/${name}/${name}.conf" logstash_pid="/var/run/${name}.pid" command="/usr/sbin/daemon" command_args="-f -p ${logstash_pid} ${logstash_bin} -f ${logstash_conf} web" run_rc_command "$1" 

I can execute the script and it will return that logstash now started but "ps" tells me another story.

root@logstash:/var/log # service logstash start Starting logstash. root@logstash:/var/log # ps aux USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND root 2963 0.0 0.0 12076 1636 ?? SsJ 3:58PM 0:00.02 /usr/sbin/syslogd -s root 3014 0.0 0.0 14176 1592 ?? SsJ 3:58PM 0:00.01 /usr/sbin/cron -s root 57344 0.0 0.0 17564 3736 0 SJ 5:31PM 0:00.18 csh root 61945 0.0 0.0 14220 1768 0 R+J 7:24PM 0:00.00 ps aux root@logstash:/var/log # 

If I print the content of $command and $command_args out and enter it manually it works perfectly.

output from "command="echo /usr/sbin/daemon":

/etc/rc.d/logstash: WARNING: cannot read shebang line from echo /etc/rc.d/logstash: WARNING: run_rc_command: cannot run echo /usr/sbin/daemon 

Any ideas what I'm doing wrong?

1
  • Please try command="echo /usr/sbin/daemon". Does it print the full command? Commented Oct 5, 2014 at 6:12

1 Answer 1

1

Are you sure the logstash_bin is right? "/usr/local/bin/logstash/bin/logstash" looks suspicious.

There is also an RC debugging mechanism (eg "rc_debug=true /usr/local/etc/rc.d/logstash start"), but I'm not sure if it will help you in this case.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.