2013년 8월 12일 월요일

How to solve message "Starting nagios:No directory, logging in with HOME=/" when starting nagios deamon

I wrote a script of installing nagios 3 named "install-nagios3.sh" on my github repository (https://github.com/yeonki-choi/nagios) and tested it. After ran this, everything was fine excepts for message "Starting nagios:No directory, logging in with HOME=/" when starting nagios daemon.
$ sudo service nagios start
Starting nagios:No directory, logging in with HOME=/
done.

I found this message was same-produced when I switched to user "nagios". It was caused there was no home directory for user "nagios". This script created the user "nagios" with no home directory during running to own nagios-core's home directory and start its daemon.

$ sudo su - nagios
No directory, logging in with HOME=/

To do solve this, it just make home directory for that user

# Make a directory and changed the ownership
$ sudo mkdir /home/nagios
$ sudo chown -R nagios:nagios /home/nagios

# Setting the directory as the home of nagios
$ sudo usermod --home /home/nagios nagios
usermod: no changes

# Restarting nagios daemon, this time there is no above message 
$ sudo service nagios restart
Running configuration check...done.
Stopping nagios: done.
Starting nagios: done.

댓글 3개:

  1. Wouldn't it best to set home directory of Nagios to /usr/local/nagios instead? as that is where Nagios is installed?

    답글삭제
  2. Hi, Saad.
    Thanks for comment.
    This post is to create home directory of user "nagios", not the home directory of nagios monitoring. Users' home directories are usually created at /home/{user_name}/.

    답글삭제