• 12
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

I am trying to run Apache Solr 4.10.4 as service in Ubuntu 14.04.

I have written the following upstart conf file :

sudo vim /etc/init/my-solr-job.conf

# my-solr - Search Backend Engine

description "my solr search engine"

start on runlevel [2345]
stop on runlevel [!2345]

respawn
respawn limit 3 60

env JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64"

exec $JAVA_HOME/bin/java -jar /home/xyzuser/solr-4.10.4/example/start.jar
#Tried this also
#exec /home/xyzuser/solr-4.10.4/bin/solr -f -p 8983

When I run the following commands, I am getting these outputs:-

Command 1

init-checkconf -d /etc/init/my-solr.conf 
DEBUG: upstart_path=/sbin/init
DEBUG: initctl_path=/sbin/initctl
DEBUG: Setting XDG_RUNTIME_DIR='/tmp/init-checkconf.zPFmEfcI7D'
DEBUG: Unsetting UPSTART_SESSION (unix:abstract=/com/ubuntu/upstart-    session/1000/2037)
DEBUG: confdir=/tmp/init-checkconf.QFW9ZI7uGv
DEBUG: file=/etc/init/my-solr.conf
DEBUG: job=my-solr
DEBUG: upstart_out=/tmp/init-checkconf-upstart-output.ykMpMbTBU6
DEBUG: upstart_cmd=/sbin/init --user --no-dbus --no-startup-event --    verbose --confdir /tmp/init-checkconf.QFW9ZI7uGv
DEBUG: Upstart pid=5661
DEBUG: Joining Upstart session 'unix:abstract=/com/ubuntu/upstart-session/1000/5661'
DEBUG: Waiting for Upstart to initialise (attempt 1)
DEBUG: Secondary Upstart (/sbin/init --user --no-dbus --no-startup-    event --verbose --confdir /tmp/init-checkconf.QFW9ZI7uGv) running with PID 5661
File /etc/init/my-solr.conf: syntax ok
DEBUG: Restoring XDG_RUNTIME_DIR to '/run/user/1000'
DEBUG: Restoring UPSTART_SESSION to     'unix:abstract=/com/ubuntu/upstart-session/1000/2037'
DEBUG: Stopping secondary Upstart (running with PID 5661)

Command 2

initctl check-config my-solr
initctl: Invalid job class: my-solr

Command 3

initctl list | grep my-solr
<Output is nothing. I tried using initctl reload-configuration>

Command 4

sudo service my-solr start
start: Unknown job: my-solr

Command 5

ln -s /etc/init/my-solr.conf /etc/init.d/my-solr
<Did not make any difference>

Can anybody help me out with this? I don't understand what am I doing wrong?

I unset this env variable and it worked like a charm

env | grep UPSTART
UPSTART_SESSION=unix:abstract=/com/ubuntu/upstart-session/1000/2037

The command I used :

unset UPSTART_SESSION

But I still did not understand the root cause of it.

I modified conf file a little bit because when I was trying to stop the job, it was giving me - Unknown Instance error

Here is my final conf -

# my-solr - Search Backend Engine

description "my solr search engine"

start on runlevel [2345]
stop on runlevel [!2345]

respawn
respawn limit 3 60

env JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64"

exec /home/xyzuser/solr-4.10.4/bin/solr start -f -p 8983
pre-stop exec /home/xyzuser/solr-4.10.4/bin/solr stop -f -p 8983

I used pre-stop because stop was sending SIGTERM to the job, so using above I tried to stop the job gracefully.

  • 0
Reply Report

Warm tip !!!

This article is reproduced from Stack Exchange / Stack Overflow, please click

Trending Tags