1

I have installed logstash from the official elasticsearch repository on Ubuntu 14.10. Installation process added the upstart job /etc/init/logstash.conf and init script /etc/init.d/logstash

# logstash - agent instance
#

description     "logstash agent"

start on virtual-filesystems
stop on runlevel [06]

# Respawn it if the process exits
respawn

# We're setting high here, we'll re-limit below.
limit nofile 65550 65550

setuid logstash
setgid logstash

# You need to chdir somewhere writable because logstash needs to unpack a few
# temporary files on startup.
console log
script
  # Defaults
  PATH=/bin:/usr/bin
  LS_HOME=/var/lib/logstash
  LS_HEAP_SIZE="500m"
  LS_JAVA_OPTS="-Djava.io.tmpdir=${LS_HOME}"
  LS_LOG_FILE=/var/log/logstash/logstash.log
  LS_USE_GC_LOGGING=""
  LS_CONF_DIR=/etc/logstash/conf.d
  LS_OPEN_FILES=16384
  LS_NICE=19
  LS_OPTS=""

  # Override our defaults with user defaults:
  [ -f /etc/default/logstash ] && . /etc/default/logstash

  HOME="${HOME:-$LS_HOME}"
  JAVA_OPTS="${LS_JAVA_OPTS}"
  # Reset filehandle limit
  ulimit -n ${LS_OPEN_FILES}
  cd "${LS_HOME}"

  # Export variables
  export PATH HOME JAVA_OPTS LS_HEAP_SIZE LS_JAVA_OPTS LS_USE_GC_LOGGING
  test -n "${JAVACMD}" && export JAVACMD

  exec nice -n ${LS_NICE} /opt/logstash/bin/logstash agent -f "${LS_CONF_DIR}" -l "${LS_LOG_FILE}" ${LS_OPTS}
end script

But the logstash agent does not start automatically on system reboot. But if I run

  initctl emit virtual-filesystems

the agent starts immediately. /var/log/upstart/logstash.log does not contain any entries from boot time.

Here is my /etc/fstab

# <file system> <mount point>   <type>  <options>   <dump>  <pass>
/dev/sda2   /   ext4    errors=remount-ro,relatime  0   1
/dev/sda3   /home   ext4    defaults,relatime   1   2
/dev/sda4   swap    swap    defaults    0   0
/dev/sda5   /backup ext4    defaults,relatime   1   2
proc        /proc   proc    defaults        0   0
sysfs       /sys    sysfs   defaults        0   0
devtmpfs    /dev    devtmpfs    rw  0   0

Why isn't the job running?

Update

When I changed virtual-filesystems to filesystem, it started correctly.

There is no logstash.override file. The udev service is running

root@pluto:~# ps aux | grep udev
root       329  0.0  0.0  24092   196 ?        S    10:57   0:00 upstart-udev-bridge --daemon
root       356  0.0  0.0  34840  2984 ?        Ss   10:57   0:00 /lib/systemd/systemd-udevd --daemon
root     11038  0.0  0.0   9948  2140 pts/4    D+   12:19   0:00 grep --color=auto udev
  • The udev service also starts on virtual-fs. Is it running? Is there an override file for logstash? – muru Dec 31 '14 at 6:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.