Hi !
I would like to confirm what I am trying to do is right thing or not.
It looks like similar issue to https://github.com/elastic/kibana/issues/7475
but since its upgrade issue , I have created a new thread.
Problem
After upgrading kibana from 4.5.1 to 5.0.0-alpha by yum update , kibana fails to start as below.
Jul 08 15:17:55 ip-172-30-1-196.ec2.internal systemd[1]: kibana.service holdoff time over, scheduling restart.
Jul 08 15:17:55 ip-172-30-1-196.ec2.internal systemd[1]: Started Kibana.
Jul 08 15:17:55 ip-172-30-1-196.ec2.internal systemd[1]: Starting Kibana...
Jul 08 15:17:55 ip-172-30-1-196.ec2.internal systemd[12491]: Failed at step USER spawning /usr/share/kibana/bin/kibana: No such process
Jul 08 15:17:55 ip-172-30-1-196.ec2.internal systemd[1]: kibana.service: main process exited, code=exited, status=217/USER
Jul 08 15:17:55 ip-172-30-1-196.ec2.internal systemd[1]: Unit kibana.service entered failed state.
Jul 08 15:17:55 ip-172-30-1-196.ec2.internal systemd[1]: kibana.service failed.
Jul 08 15:17:55 ip-172-30-1-196.ec2.internal systemd[1]: kibana.service holdoff time over, scheduling restart.
Jul 08 15:17:55 ip-172-30-1-196.ec2.internal systemd[1]: start request repeated too quickly for kibana.service
Jul 08 15:17:55 ip-172-30-1-196.ec2.internal systemd[1]: Failed to start Kibana.
Jul 08 15:17:55 ip-172-30-1-196.ec2.internal systemd[1]: Unit kibana.service entered failed state.
Jul 08 15:17:55 ip-172-30-1-196.ec2.internal systemd[1]: kibana.service failed.
Analysis
After checking the unit file for systemd, kibana now starts up with user kibana.
[root@ip-172-30-1-196 logstash]# cat /usr/lib/systemd/system/kibana.service
[Unit]
Description=Kibana
[Service]
Type=simple
User=kibana
Group=kibana
ExecStart=/usr/share/kibana/bin/kibana "-c /etc/kibana/kibana.yml"
Restart=always
[Install]
WantedBy=multi-user.target
After creating user kibana , systemd still has errors
[root@ip-172-30-1-196 logstash]# useradd -M -s /sbin/nologin kibana
[root@ip-172-30-1-196 logstash]# grep kibana /etc/passwd
kibana:x:1001:1001::/home/kibana:/sbin/nologin
Jul 08 15:30:39 ip-172-30-1-196.ec2.internal systemd[1]: kibana.service holdoff time over, scheduling restart.
Jul 08 15:30:39 ip-172-30-1-196.ec2.internal systemd[1]: Started Kibana.
Jul 08 15:30:39 ip-172-30-1-196.ec2.internal systemd[1]: Starting Kibana...
Jul 08 15:30:40 ip-172-30-1-196.ec2.internal kibana[12623]: fs.js:549
Jul 08 15:30:40 ip-172-30-1-196.ec2.internal kibana[12623]: return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
Jul 08 15:30:40 ip-172-30-1-196.ec2.internal kibana[12623]: ^
Jul 08 15:30:40 ip-172-30-1-196.ec2.internal kibana[12623]: Error: EACCES: permission denied, open '/usr/share/kibana/optimize/.babelcache.json'
Jul 08 15:30:40 ip-172-30-1-196.ec2.internal kibana[12623]: at Error (native)
Jul 08 15:30:40 ip-172-30-1-196.ec2.internal kibana[12623]: at Object.fs.openSync (fs.js:549:18)
Jul 08 15:30:40 ip-172-30-1-196.ec2.internal kibana[12623]: at Object.fs.writeFileSync (fs.js:1156:15)
Jul 08 15:30:40 ip-172-30-1-196.ec2.internal kibana[12623]: at save (/usr/share/kibana/node_modules/babel-core/lib/api/register/cache.js:35:19)
Jul 08 15:30:40 ip-172-30-1-196.ec2.internal kibana[12623]: at nextTickCallbackWith0Args (node.js:420:9)
Jul 08 15:30:40 ip-172-30-1-196.ec2.internal kibana[12623]: at process._tickDomainCallback (node.js:390:13)
Jul 08 15:30:40 ip-172-30-1-196.ec2.internal kibana[12623]: at Function.Module.runMain (module.js:443:11)
Jul 08 15:30:40 ip-172-30-1-196.ec2.internal kibana[12623]: at startup (node.js:139:18)
Jul 08 15:30:40 ip-172-30-1-196.ec2.internal kibana[12623]: at node.js:968:3
To bypass this error , I now start up kibana with user root and group root.
Question
My question is should I chown the whole kibana env as below after yum update?
chown -R kibana:kibana /usr/share/kibana
Thanks,
Yu