Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

[dev.icinga.com #387] Add support for sysconfig environment variables in init script #176

Closed
icinga-migration opened this issue Apr 30, 2010 · 5 comments

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/387

Created by mfriedrich on 2010-04-30 20:35:50 +00:00

Assignee: (none)
Status: Closed (closed on 2010-05-19 09:24:31 +00:00)
Target Version: (none)
Last Update: 2010-05-19 09:24:31 +00:00 (in Redmine)


Depends wether on the operating system afaik. Needs to be tested though.
This one's just for RHEL, for Debian it's another location in /etc/default/

http://git.op5.org/git/?p=nagios.git;a=commit;h=155692866180682cc4515c160dcb6748a1b3fedb

Steve Traylen 

Add support for sysconfig environment variables to Nagios

This patch adds a conditional source'ing of /etc/sysconfig/nagios
to the daemon start script. This is useful to set environment
variables passed on to Nagios and the plugins it runs, such as
ORACLE_LOCATION and other similar things that some plugins need
to run properly.



If Debian et al do things differently, I'm sure their package

managers can patch this appropriately.

diff --git a/daemon-init.in b/daemon-init.in

index cdb9b93..98f35e5 100644 (file)

--- a/daemon-init.in
+++ b/daemon-init.in
@@ -28,7 +28,12 @@
 # Description: Starts and stops the Nagios monitor
 #              used to provide network services status.
 #
-  
+
+# Load any extra environment variables for Nagios and its plugins
+if test -f /etc/sysconfig/nagios; then
+       . /etc/sysconfig/nagios
+fi
+
 status_nagios ()
 {

Changesets

2010-05-19 09:19:17 +00:00 by Meier 4e99d93

use redhaht init script on redhat rpm builds
fixes #387
fixes #249 on redhat

2010-05-19 09:46:36 +00:00 by Meier e290d8d

use redhat init script on redhat rpm builds
fixes #387
refs #249 on redhat
@icinga-migration
Copy link
Author

Updated by mfriedrich on 2010-05-12 18:57:21 +00:00

  • Assigned to deleted formorer
  • Priority changed from Normal to Low

mh i do think it could be useful, but it's not really necessary. what do you think?

@icinga-migration
Copy link
Author

Updated by Meier on 2010-05-12 19:00:47 +00:00

The patch is ok but should be done against daemon-init-redhat.in instead. Also the spec should use daemon-init-redhat.in when building for redhat.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2010-05-16 17:14:11 +00:00

so to speak a configure option, that takes e.g. --with-rhel-init or --with-debian-init and then taking the correct init script on building the init script?

@icinga-migration
Copy link
Author

Updated by Meier on 2010-05-16 18:43:03 +00:00

I was thinking about solving that in the spec file depending on the value of %_vendor

@icinga-migration
Copy link
Author

Updated by Meier on 2010-05-19 09:24:31 +00:00

  • Status changed from New to Closed
  • Done % changed from 0 to 100

4e99d93

deamon-init-redhat.in had that alread

[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog

it is now used in rpm-builds if %_vendor is redhat

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant