init script has hard coded chown

Bug #929848 reported by Paul
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
nagios3 (Ubuntu)
Expired
Wishlist
Unassigned

Bug Description

I changed the user the nagios runs under and could not get the services to start; so after looking around I found that the init script was chowning /var/run/nagios3 directory.

/etc/init.d/nagios3

start () {
  DIRECTORY=$(dirname $THEPIDFILE)
  [ ! -d $DIRECTORY ] && mkdir -p $DIRECTORY
  chown nagios:nagios $DIRECTORY

Change:
/etc/init.d/nagios3

start () {
  DIRECTORY=$(dirname $THEPIDFILE)
  [ ! -d $DIRECTORY ] && mkdir -p $DIRECTORY
  chown "$(get_config nagios_user)":"$(get_config nagios_group)" $DIRECTORY

Revision history for this message
Dave Walker (davewalker) wrote :

Thanks for the bug report.

Please can you confirm rational for switching the user it runs as?

Changed in nagios3 (Ubuntu):
importance: Undecided → Wishlist
status: New → Incomplete
Revision history for this message
Mark Dickie (mark-dickie) wrote :

I also have had a problem with this. In my case I had changed the user that apache runs as to make it compatible with freePBX which requires apache to run as the asterisk user.

I have created an edited version of the init script which you will find attached. This appears to work with whatever you specify in the nagios config. Best check it over though as this is my first init script. I only changed lines 91,92 and 125.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for nagios3 (Ubuntu) because there has been no activity for 60 days.]

Changed in nagios3 (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.