• R/O
  • SSH

contrib-spec-files: Commit

日本OpenSolaris Users Group有志による、レポジトリサーバ作成のためのspecファイル群です。


Commit MetaInfo

Revisionaf9987c3785243cc57073f45cf0c8792ac900236 (tree)
Time2020-02-07 14:03:27
AuthorFumihisa TONAKA <fumi.ftnk@gmai...>
CommiterFumihisa TONAKA

Log Message

SFEnagios-nrpe-jposug: use generated SMF manifest instead of JPOUSG's

Change Summary

Incremental Difference

diff -r 35bbc1fd47f6 -r af9987c37852 specs/SFEnagios-nrpe-jposug.spec
--- a/specs/SFEnagios-nrpe-jposug.spec Thu Feb 06 20:16:43 2020 +0900
+++ b/specs/SFEnagios-nrpe-jposug.spec Fri Feb 07 14:03:27 2020 +0900
@@ -17,16 +17,14 @@
1717 %define _sysconfdir /etc
1818 %define _localstatedir /var
1919
20-Name: SFEnagios-nrpe
20+Name: SFEnagios-nrpe
2121 IPS_package_name: jposug/diagnostic/nagios/nrpe
22-Version: %{tarball_version}
23-Summary: NRPE - Nagios Remote Plugin Executor
24-Group: Applications/System
25-License: GPL
26-URL: http://www.nagios.org/
22+Version: %{tarball_version}
23+Summary: NRPE - Nagios Remote Plugin Executor
24+Group: Applications/System
25+License: GPL
26+URL: http://www.nagios.org/
2727 Source: https://github.com/NagiosEnterprises/nrpe/archive/nrpe-%{tarball_version}.tar.gz
28-Source1: nagios-nrpe-jposug.xml
29-Source2: svc-nagios-nrpe-jposug
3028 BuildRoot: %{_tmppath}/%{name}-%{version}-build
3129
3230 BuildREquires: jposug/library/security/libressl
@@ -45,11 +43,8 @@
4543 CPUS=1
4644 fi
4745
48-
4946 PATH=/opt/jposug/bin:/opt/jposug/sbin:${PATH}
5047 export CC='/usr/bin/gcc -m64'
51-# export CFLAGS="%{optflags}"
52-# export LDFLAGS="%{_ldflags}"
5348 export LDFLAGS="-L/opt/jposug/lib -L/lib/%{_arch64} -L/usr/lib/%{_arch64} -R/opt/jposug/lib -R/lib/%{_arch64} -R/usr/lib/%{_arch64}"
5449 export PKG_CONFIG_PATH=/opt/jposug/lib/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
5550
@@ -81,9 +76,7 @@
8176 install -m 0644 sample-config/nrpe.cfg %{buildroot}%{_sysconfdir}/nagios/nrpe.cfg
8277
8378 install -d 0755 %{buildroot}%/var/svc/manifest/site
84-install -m 0644 %{SOURCE1} %{buildroot}%/var/svc/manifest/site
85-install -d 0755 %{buildroot}%/lib/svc/method
86-install -m 0555 %{SOURCE2} %{buildroot}%/lib/svc/method
79+install -m 0644 startup/solaris-init.xml %{buildroot}%/var/svc/manifest/site/nagios-nrpe-jposug.xml
8780
8881 rm %{buildroot}%{_sbindir}/nrpe-uninstall
8982
@@ -112,12 +105,10 @@
112105 %dir %attr (0755, root, sys) %{_localstatedir}/svc/manifest
113106 %dir %attr (0755, root, sys) %{_localstatedir}/svc/manifest/site
114107 %class(manifest) %attr(0444, root, sys) %{_localstatedir}/svc/manifest/site/nagios-nrpe-jposug.xml
115-%dir %attr (0755, root, bin) /lib/svc
116-%dir %attr (0755, root, bin) /lib/svc/method
117-%attr (0555, root, bin) /lib/svc/method/svc-nagios-nrpe-jposug
118-
119108
120109 %changelog
110+* Fri Feb 07 2020 - Fumihisa TONAKA <fumi.ftnk@gmail.com>
111+- use generated SMF manifest instead of JPOUSG's
121112 * Thu Feb 06 2020 - Fumihisa TONAKA <fumi.ftnk@gmail.com>
122113 - use libressl
123114 * Fri Feb 08 2019 - Fumihisa TONAKA <fumi.ftnk@gmail.com>
diff -r 35bbc1fd47f6 -r af9987c37852 specs/ext-sources/nagios-nrpe-jposug.xml
--- a/specs/ext-sources/nagios-nrpe-jposug.xml Thu Feb 06 20:16:43 2020 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
1-<?xml version="1.0"?>
2-<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
3-<service_bundle type="manifest" name="nrpe">
4-
5- <service name="site/nagios/nrpe" type="service" version="1">
6-
7- <create_default_instance enabled="false"/>
8- <single_instance/>
9-
10- <!--
11- Wait for network interfaces to be initialized.
12- -->
13- <dependency name='network'
14- grouping='require_all'
15- restart_on='error'
16- type='service'>
17- <service_fmri value='svc:/milestone/network:default'/>
18- </dependency>
19-
20- <!--
21- Wait for all local filesystems to be mounted.
22- -->
23- <dependency name='filesystem-local'
24- grouping='require_all'
25- restart_on='none'
26- type='service'>
27- <service_fmri
28- value='svc:/system/filesystem/local:default'/>
29- </dependency>
30-
31- <dependency name="milestone"
32- grouping="require_all"
33- restart_on="none"
34- type="service">
35- <service_fmri value="svc:/milestone/multi-user"/>
36- </dependency>
37-
38- <exec_method type="method" name="start"
39- exec="/lib/svc/method/svc-nagios-nrpe-jposug start"
40- timeout_seconds="60"/>
41- <exec_method type="method" name="stop"
42- exec="/lib/svc/method/svc-nagios-nrpe-jposug stop"
43- timeout_seconds="60"/>
44- <exec_method type="method" name="refresh"
45- exec="/lib/svc/method/svc-nagios-nrpe-jposug refresh"
46- timeout_seconds="60"/>
47-
48- <property_group name='nrpe' type='application'>
49- <propval name='bin' type='astring'
50- value='/opt/jposug/sbin/nrpe' />
51- <propval name='cfgfile' type='astring'
52- value='/etc/nagios/nrpe.cfg' />
53- <propval name='vardir' type='astring'
54- value='/var/log/nagios' />
55- <propval name='runfile' type='astring'
56- value='/var/run/nagios/nrpe.pid' />
57- <propval name='lockdir' type='astring'
58- value='/var/lock/subsys' />
59- <propval name='lockfile' type='astring'
60- value='nrpe' />
61- <propval name='user' type='astring'
62- value='nagios' />
63- <propval name='group' type='astring'
64- value='nagios' />
65- </property_group>
66-
67- <stability value="Unstable"/>
68-
69- <template>
70- <common_name>
71- <loctext xml:lang="C">Nagios Remote Plugin Executor</loctext>
72- </common_name>
73- <documentation>
74- <doc_link name='nagios.org'
75- uri='http://www.nagios.org' />
76- </documentation>
77- </template>
78- </service>
79-</service_bundle>
diff -r 35bbc1fd47f6 -r af9987c37852 specs/ext-sources/svc-nagios-nrpe-jposug
--- a/specs/ext-sources/svc-nagios-nrpe-jposug Thu Feb 06 20:16:43 2020 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
1-#!/bin/sh
2-. /lib/svc/share/smf_include.sh
3-
4-getproparg() {
5- val=`svcprop -p $1 $SMF_FMRI`
6- [ -n "$val" ] && echo $val
7-}
8-
9-status_nrpe ()
10-{
11- pid_nrpe
12- if ps -p $NrpePID > /dev/null 2>&1; then
13- return 0
14- else
15- return 1
16- fi
17- return 1
18-}
19-
20-
21-killproc_nrpe ()
22-{
23- kill $NrpePID
24-}
25-
26-
27-pid_nrpe ()
28-{
29- if test ! -f $NrpeRunFile; then
30- echo "No lock file found in $NagiosRunFile"
31- exit 1
32- fi
33- NrpePID=`head -n 1 $NrpeRunFile`
34-}
35-
36-NrpeBin=`getproparg nrpe/bin`
37-NrpeCfgFile=`getproparg nrpe/cfgfile`
38-NrpeRunFile=`getproparg nrpe/runfile`
39-NrpeLockDir=`getproparg nrpe/lockdir`
40-NrpeLockFile=`getproparg nrpe/lockfile`
41-NrpeUser=`getproparg nrpe/user`
42-NrpeGroup=`getproparg nrpe/group`
43-
44-if [ -z $SMF_FMRI ]; then
45- echo "Error: SMF framework variables are not initialized"
46- exit $SMF_EXIT_ERR
47-fi
48-
49-# Check that nrpe exists.
50-if [ ! -x $NrpeBin ]; then
51- echo "Executable file $NrpeBin not found. Exiting."
52- exit $SMF_EXIT_ERR_CONFIG
53-fi
54-
55-# Check that nagios.cfg exists.
56-if [ ! -f $NrpeCfgFile ]; then
57- echo "Configuration file $NrpeCfgFile not found. Exiting."
58- exit $SMF_EXIT_ERR_CONFIG
59-fi
60-
61-# See how we were called.
62-case "$1" in
63- start)
64- # Start daemons.
65- echo -n "Starting nrpe: "
66- NrpeRunDir=`dirname $NrpeRunFile`
67- if [ ! -d $NrpeRunDir ]
68- then
69- mkdir $NrpeRunDir
70- fi
71- chown $NrpeUser:$NrpeGroup $NrpeRunDir
72-
73- touch $NrpeRunFile
74- chown $NrpeUser:$NrpeGroup $NrpeRunFile
75- $NrpeBin -c $NrpeCfgFile -d
76- mkdir -p $NrpeLockDir
77- touch $NrpeLockDir/$NrpeLockFile
78- echo " done."
79- exit 0
80- ;;
81- stop)
82- # Stop daemons.
83- echo -n "Shutting down nrpe: "
84- pid_nrpe
85- killproc_nrpe
86- echo
87- rm -f $NrpeLockDir/$NrpeLockFile $NrpeRunFile
88- ;;
89- restart)
90- $0 stop
91- $0 start
92- ;;
93- status)
94- status_nrpe
95- ;;
96- *)
97- echo "Usage: nrpe {start|stop|restart|status}"
98- exit 1
99-esac
100-
101-exit $SMF_EXIT_OK
Show on old repository browser