new upstream 2.8.0
This commit is contained in:
parent
fc7f4b43c1
commit
b2b0c9995a
836 changed files with 137090 additions and 30018 deletions
|
|
@ -1,17 +1,88 @@
|
|||
EXTRA_DIST = makelocal.sh
|
||||
EXTRA_DIST = makelocal.sh precheck.py.in preproto.pl.in README
|
||||
PROTOTYPE_DIR = $(DESTDIR)@prefix@
|
||||
SOLARIS_CHECK_TARGETS =
|
||||
PYTHON = @PYTHON@
|
||||
|
||||
package: makelocal.sh pkginfo
|
||||
$ cd @prefix@; $ find . -print | pkgproto > prototype1
|
||||
$ cp makelocal.sh precheck.py pkginfo nut preinstall postinstall preremove postremove preproto.pl @prefix@
|
||||
$ cd @prefix@; perl preproto.pl
|
||||
$ cd @prefix@; python precheck.py
|
||||
$ cd @prefix@; rm -f prototype1
|
||||
$ cd @prefix@; ./makelocal.sh
|
||||
$ cp @prefix@/*.gz $(srcdir)
|
||||
if test `uname -p` = "i386"; then \
|
||||
mv NUT_solaris_package.local.gz NUT_solaris_i386_package@PACKAGE_VERSION@.local.gz; \
|
||||
else \
|
||||
if test `uname -p` = "sparc"; then \
|
||||
mv NUT_solaris_package.local.gz NUT_solaris_sparc_package@PACKAGE_VERSION@.local.gz; \
|
||||
fi; \
|
||||
fi;
|
||||
SOLARIS_SMF_MANIFESTS = \
|
||||
nut.xml \
|
||||
nut-server.xml \
|
||||
nut-monitor.xml \
|
||||
nut-driver.xml \
|
||||
nut-driver-enumerator.xml
|
||||
|
||||
SOLARIS_SMF_METHODSCRIPTS = \
|
||||
svc-nut-server \
|
||||
svc-nut-monitor
|
||||
|
||||
if WITH_SOLARIS_SMF
|
||||
# OS equivalent of /lib/svc/method and /var/svc/manifest/application
|
||||
# but we can just use then from this location
|
||||
solarissmfmethoddir = @datadir@/solaris-smf/method
|
||||
solarissmfmanifestdir = @datadir@/solaris-smf/manifest
|
||||
solarissmfmethod_SCRIPTS = $(SOLARIS_SMF_METHODSCRIPTS)
|
||||
solarissmfmanifest_DATA = $(SOLARIS_SMF_MANIFESTS)
|
||||
|
||||
libexec_SCRIPTS = ../upsdrvsvcctl/nut-driver-enumerator.sh
|
||||
|
||||
sbin_SCRIPTS = ../upsdrvsvcctl/upsdrvsvcctl
|
||||
|
||||
SOLARIS_CHECK_TARGETS += check-local-solaris-smf
|
||||
endif
|
||||
|
||||
solarisinitscriptdir = @datadir@/solaris-init
|
||||
solarisinitscript_SCRIPTS = nut
|
||||
|
||||
SOLARIS_PACKAGE_TARGETS =
|
||||
|
||||
if WITH_SOLARIS_PKG_IPS
|
||||
SOLARIS_PACKAGE_TARGETS += package-solaris-ips
|
||||
endif
|
||||
|
||||
if WITH_SOLARIS_PKG_SVR4
|
||||
SOLARIS_PACKAGE_TARGETS += package-solaris-svr4
|
||||
endif
|
||||
|
||||
package: $(SOLARIS_PACKAGE_TARGETS)
|
||||
|
||||
# TODO: Reduce build dependencies (implicit!) on python and perl
|
||||
# by shelling the scripts used below
|
||||
# NOTE: This assumes the rest of the product has already been built
|
||||
# and installed under PROTOTYPE_DIR, but declares no explicit
|
||||
# dependency on that
|
||||
SOLARIS_PACKAGE_SVR4_HELPERSCRIPTS = makelocal.sh precheck.py preproto.pl
|
||||
SOLARIS_PACKAGE_SVR4_INSTALLSCRIPTS = preinstall postinstall preremove postremove
|
||||
SOLARIS_PACKAGE_SVR4_INSTALLDATA = pkginfo
|
||||
package-solaris-svr4: $(SOLARIS_PACKAGE_SVR4_HELPERSCRIPTS) $(SOLARIS_PACKAGE_SVR4_INSTALLSCRIPTS) $(SOLARIS_PACKAGE_SVR4_INSTALLDATA)
|
||||
if test -n "@auglensdir@" && test -d "$(DESTDIR)@auglensdir@" ; then \
|
||||
mkdir -p "$(DESTDIR)@datadir@/augeas-lenses" && \
|
||||
cd "$(DESTDIR)@auglensdir@" && \
|
||||
( cp -prf ./ "$(DESTDIR)@datadir@/augeas-lenses/" || cp -rf ./ "$(DESTDIR)@datadir@/augeas-lenses/" ) ; fi
|
||||
cd $(PROTOTYPE_DIR) && find . -print | pkgproto > prototype1
|
||||
cp $(SOLARIS_PACKAGE_SVR4_HELPERSCRIPTS) $(SOLARIS_PACKAGE_SVR4_INSTALLSCRIPTS) $(SOLARIS_PACKAGE_SVR4_INSTALLDATA) $(PROTOTYPE_DIR)
|
||||
cd $(PROTOTYPE_DIR) && chmod +x $(SOLARIS_PACKAGE_SVR4_HELPERSCRIPTS) $(SOLARIS_PACKAGE_SVR4_INSTALLSCRIPTS)
|
||||
cd $(PROTOTYPE_DIR) && perl preproto.pl
|
||||
if HAVE_PYTHON
|
||||
cd $(PROTOTYPE_DIR) && $(PYTHON) precheck.py
|
||||
endif
|
||||
cd $(PROTOTYPE_DIR) && rm -f prototype1
|
||||
cd $(PROTOTYPE_DIR) && ./makelocal.sh
|
||||
cp $(PROTOTYPE_DIR)/*.gz $(builddir)
|
||||
UNAME_P="`uname -p`" && case "$${UNAME_P}" in \
|
||||
i386|sparc) \
|
||||
mv -f NUT_solaris_package.local.gz "$(abs_top_builddir)/NUT_solaris_$${UNAME_P}_package@PACKAGE_VERSION@.local.gz" ;; \
|
||||
esac
|
||||
|
||||
# TODO: Define support for IPS packaging (provide p5m files and make rules)
|
||||
package-solaris-ips:
|
||||
@echo "SKIPPED : Target $@ is not implemented yet"
|
||||
|
||||
check-local: $(SOLARIS_CHECK_TARGETS)
|
||||
|
||||
check-local-solaris-smf: $(SOLARIS_SMF_MANIFESTS)
|
||||
@[ -x /usr/sbin/svccfg ] || { echo "WARNING : Target $@ skipped due to absent /usr/sbin/svccfg" >&2; return 0; } ; \
|
||||
RES=0 ; for F in $^ ; do \
|
||||
echo " SVCCFG-VALIDATE $$F"; \
|
||||
/usr/sbin/svccfg validate "$$F" || RES=$$? ; \
|
||||
done; exit $$RES
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in .dirstamp
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Makefile.in generated by automake 1.14.1 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.16.3 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
|
@ -13,8 +13,20 @@
|
|||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
|
||||
am__is_gnu_make = { \
|
||||
if test -z '$(MAKELEVEL)'; then \
|
||||
false; \
|
||||
elif test -n '$(MAKE_HOST)'; then \
|
||||
true; \
|
||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
||||
true; \
|
||||
else \
|
||||
false; \
|
||||
fi; \
|
||||
}
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
|
|
@ -78,21 +90,28 @@ POST_UNINSTALL = :
|
|||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
@WITH_SOLARIS_SMF_TRUE@am__append_1 = check-local-solaris-smf
|
||||
@WITH_SOLARIS_PKG_IPS_TRUE@am__append_2 = package-solaris-ips
|
||||
@WITH_SOLARIS_PKG_SVR4_TRUE@am__append_3 = package-solaris-svr4
|
||||
subdir = scripts/Solaris
|
||||
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
|
||||
$(srcdir)/pkginfo.in $(srcdir)/postinstall.in \
|
||||
$(srcdir)/preremove.in $(srcdir)/nut.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_c___attribute__.m4 \
|
||||
$(top_srcdir)/m4/ax_c_pragmas.m4 \
|
||||
$(top_srcdir)/m4/ax_check_compile_flag.m4 \
|
||||
$(top_srcdir)/m4/ax_compare_version.m4 \
|
||||
$(top_srcdir)/m4/ax_run_or_link_ifelse.m4 \
|
||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
||||
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
||||
$(top_srcdir)/m4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/m4/nut_arg_with.m4 \
|
||||
$(top_srcdir)/m4/nut_check_asciidoc.m4 \
|
||||
$(top_srcdir)/m4/nut_check_cppcheck.m4 \
|
||||
$(top_srcdir)/m4/nut_check_headers_windows.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libavahi.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libfreeipmi.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libgd.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libltdl.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libmodbus.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libneon.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libnetsnmp.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libnss.m4 \
|
||||
|
|
@ -101,15 +120,57 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
|
|||
$(top_srcdir)/m4/nut_check_libusb.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libwrap.m4 \
|
||||
$(top_srcdir)/m4/nut_check_os.m4 \
|
||||
$(top_srcdir)/m4/nut_check_pkgconfig.m4 \
|
||||
$(top_srcdir)/m4/nut_check_python.m4 \
|
||||
$(top_srcdir)/m4/nut_compiler_family.m4 \
|
||||
$(top_srcdir)/m4/nut_func_getnameinfo_argtypes.m4 \
|
||||
$(top_srcdir)/m4/nut_report_feature.m4 \
|
||||
$(top_srcdir)/m4/nut_stash_warnings.m4 \
|
||||
$(top_srcdir)/m4/nut_type_socklen_t.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/include/config.h
|
||||
CONFIG_CLEAN_FILES = pkginfo postinstall preremove nut
|
||||
CONFIG_CLEAN_FILES = nut-driver-enumerator.xml nut-driver.xml \
|
||||
nut-monitor.xml nut-server.xml nut.xml pkginfo svc-nut-server \
|
||||
svc-nut-monitor precheck.py preinstall postinstall preremove \
|
||||
postremove preproto.pl nut
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__uninstall_files_from_dir = { \
|
||||
test -z "$$files" \
|
||||
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
||||
$(am__cd) "$$dir" && rm -f $$files; }; \
|
||||
}
|
||||
am__installdirs = "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)" \
|
||||
"$(DESTDIR)$(solarisinitscriptdir)" \
|
||||
"$(DESTDIR)$(solarissmfmethoddir)" \
|
||||
"$(DESTDIR)$(solarissmfmanifestdir)"
|
||||
SCRIPTS = $(libexec_SCRIPTS) $(sbin_SCRIPTS) \
|
||||
$(solarisinitscript_SCRIPTS) $(solarissmfmethod_SCRIPTS)
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
|
|
@ -129,7 +190,18 @@ am__can_run_installinfo = \
|
|||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
DATA = $(solarissmfmanifest_DATA)
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in \
|
||||
$(srcdir)/nut-driver-enumerator.xml.in \
|
||||
$(srcdir)/nut-driver.xml.in $(srcdir)/nut-monitor.xml.in \
|
||||
$(srcdir)/nut-server.xml.in $(srcdir)/nut.in \
|
||||
$(srcdir)/nut.xml.in $(srcdir)/pkginfo.in \
|
||||
$(srcdir)/postinstall.in $(srcdir)/postremove.in \
|
||||
$(srcdir)/precheck.py.in $(srcdir)/preinstall.in \
|
||||
$(srcdir)/preproto.pl.in $(srcdir)/preremove.in \
|
||||
$(srcdir)/svc-nut-monitor.in $(srcdir)/svc-nut-server.in \
|
||||
README
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
A2X = @A2X@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
|
|
@ -138,6 +210,7 @@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
|||
AR = @AR@
|
||||
ASCIIDOC = @ASCIIDOC@
|
||||
ASPELL = @ASPELL@
|
||||
AUGPARSE = @AUGPARSE@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
|
|
@ -148,6 +221,7 @@ CCDEPMODE = @CCDEPMODE@
|
|||
CFLAGS = @CFLAGS@
|
||||
CONFPATH = @CONFPATH@
|
||||
CPP = @CPP@
|
||||
CPPCHECK = @CPPCHECK@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
|
||||
CPPUNIT_LIBS = @CPPUNIT_LIBS@
|
||||
|
|
@ -161,6 +235,7 @@ DEFS = @DEFS@
|
|||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DOC_BUILD_LIST = @DOC_BUILD_LIST@
|
||||
DOC_CHECK_LIST = @DOC_CHECK_LIST@
|
||||
DRIVER_BUILD_LIST = @DRIVER_BUILD_LIST@
|
||||
DRIVER_INSTALL_TARGET = @DRIVER_INSTALL_TARGET@
|
||||
DRIVER_MAN_LIST = @DRIVER_MAN_LIST@
|
||||
|
|
@ -173,6 +248,7 @@ ECHO_T = @ECHO_T@
|
|||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
GDLIB_CONFIG = @GDLIB_CONFIG@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
|
|
@ -190,6 +266,8 @@ LIBIPMI_CFLAGS = @LIBIPMI_CFLAGS@
|
|||
LIBIPMI_LIBS = @LIBIPMI_LIBS@
|
||||
LIBLTDL_CFLAGS = @LIBLTDL_CFLAGS@
|
||||
LIBLTDL_LIBS = @LIBLTDL_LIBS@
|
||||
LIBMODBUS_CFLAGS = @LIBMODBUS_CFLAGS@
|
||||
LIBMODBUS_LIBS = @LIBMODBUS_LIBS@
|
||||
LIBNEON_CFLAGS = @LIBNEON_CFLAGS@
|
||||
LIBNEON_LIBS = @LIBNEON_LIBS@
|
||||
LIBNETSNMP_CFLAGS = @LIBNETSNMP_CFLAGS@
|
||||
|
|
@ -200,21 +278,29 @@ LIBPOWERMAN_LIBS = @LIBPOWERMAN_LIBS@
|
|||
LIBS = @LIBS@
|
||||
LIBSSL_CFLAGS = @LIBSSL_CFLAGS@
|
||||
LIBSSL_LIBS = @LIBSSL_LIBS@
|
||||
LIBSSL_REQUIRES = @LIBSSL_REQUIRES@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
||||
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
|
||||
LIBUSB_CONFIG = @LIBUSB_CONFIG@
|
||||
LIBUSB_LIBS = @LIBUSB_LIBS@
|
||||
LIBWRAP_CFLAGS = @LIBWRAP_CFLAGS@
|
||||
LIBWRAP_LIBS = @LIBWRAP_LIBS@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LN_S_R = @LN_S_R@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NETLIBS = @NETLIBS@
|
||||
NET_SNMP_CONFIG = @NET_SNMP_CONFIG@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
NUT_DATADIR = @NUT_DATADIR@
|
||||
NUT_LIBEXECDIR = @NUT_LIBEXECDIR@
|
||||
NUT_NETVERSION = @NUT_NETVERSION@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
|
|
@ -234,6 +320,9 @@ PKG_CONFIG = @PKG_CONFIG@
|
|||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
PORT = @PORT@
|
||||
PYTHON = @PYTHON@
|
||||
PYTHON2 = @PYTHON2@
|
||||
PYTHON3 = @PYTHON3@
|
||||
RANLIB = @RANLIB@
|
||||
RUN_AS_GROUP = @RUN_AS_GROUP@
|
||||
RUN_AS_USER = @RUN_AS_USER@
|
||||
|
|
@ -247,6 +336,7 @@ STATEPATH = @STATEPATH@
|
|||
STRIP = @STRIP@
|
||||
SUN_LIBUSB = @SUN_LIBUSB@
|
||||
TREE_VERSION = @TREE_VERSION@
|
||||
VALGRIND = @VALGRIND@
|
||||
VERSION = @VERSION@
|
||||
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
|
||||
XMLLINT = @XMLLINT@
|
||||
|
|
@ -264,6 +354,7 @@ am__leading_dot = @am__leading_dot@
|
|||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
auglensdir = @auglensdir@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
|
|
@ -277,6 +368,9 @@ datarootdir = @datarootdir@
|
|||
devddir = @devddir@
|
||||
docdir = @docdir@
|
||||
driverexecdir = @driverexecdir@
|
||||
dummy_PKG_CONFIG = @dummy_PKG_CONFIG@
|
||||
dummy_PKG_CONFIG_CFLAGS = @dummy_PKG_CONFIG_CFLAGS@
|
||||
dummy_PKG_CONFIG_LIBS = @dummy_PKG_CONFIG_LIBS@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
|
|
@ -302,12 +396,14 @@ pkgconfigdir = @pkgconfigdir@
|
|||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
systemdsystemshutdowndir = @systemdsystemshutdowndir@
|
||||
systemdshutdowndir = @systemdshutdowndir@
|
||||
systemdsystemunitdir = @systemdsystemunitdir@
|
||||
systemdtmpfilesdir = @systemdtmpfilesdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
|
|
@ -317,7 +413,42 @@ top_build_prefix = @top_build_prefix@
|
|||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
udevdir = @udevdir@
|
||||
EXTRA_DIST = makelocal.sh
|
||||
EXTRA_DIST = makelocal.sh precheck.py.in preproto.pl.in README
|
||||
PROTOTYPE_DIR = $(DESTDIR)@prefix@
|
||||
SOLARIS_CHECK_TARGETS = $(am__append_1)
|
||||
SOLARIS_SMF_MANIFESTS = \
|
||||
nut.xml \
|
||||
nut-server.xml \
|
||||
nut-monitor.xml \
|
||||
nut-driver.xml \
|
||||
nut-driver-enumerator.xml
|
||||
|
||||
SOLARIS_SMF_METHODSCRIPTS = \
|
||||
svc-nut-server \
|
||||
svc-nut-monitor
|
||||
|
||||
|
||||
# OS equivalent of /lib/svc/method and /var/svc/manifest/application
|
||||
# but we can just use then from this location
|
||||
@WITH_SOLARIS_SMF_TRUE@solarissmfmethoddir = @datadir@/solaris-smf/method
|
||||
@WITH_SOLARIS_SMF_TRUE@solarissmfmanifestdir = @datadir@/solaris-smf/manifest
|
||||
@WITH_SOLARIS_SMF_TRUE@solarissmfmethod_SCRIPTS = $(SOLARIS_SMF_METHODSCRIPTS)
|
||||
@WITH_SOLARIS_SMF_TRUE@solarissmfmanifest_DATA = $(SOLARIS_SMF_MANIFESTS)
|
||||
@WITH_SOLARIS_SMF_TRUE@libexec_SCRIPTS = ../upsdrvsvcctl/nut-driver-enumerator.sh
|
||||
@WITH_SOLARIS_SMF_TRUE@sbin_SCRIPTS = ../upsdrvsvcctl/upsdrvsvcctl
|
||||
solarisinitscriptdir = @datadir@/solaris-init
|
||||
solarisinitscript_SCRIPTS = nut
|
||||
SOLARIS_PACKAGE_TARGETS = $(am__append_2) $(am__append_3)
|
||||
|
||||
# TODO: Reduce build dependencies (implicit!) on python and perl
|
||||
# by shelling the scripts used below
|
||||
# NOTE: This assumes the rest of the product has already been built
|
||||
# and installed under PROTOTYPE_DIR, but declares no explicit
|
||||
# dependency on that
|
||||
SOLARIS_PACKAGE_SVR4_HELPERSCRIPTS = makelocal.sh precheck.py preproto.pl
|
||||
SOLARIS_PACKAGE_SVR4_INSTALLSCRIPTS = preinstall postinstall preremove postremove
|
||||
SOLARIS_PACKAGE_SVR4_INSTALLDATA = pkginfo
|
||||
MAINTAINERCLEANFILES = Makefile.in .dirstamp
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
|
|
@ -333,14 +464,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
|
|||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu scripts/Solaris/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu scripts/Solaris/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
|
|
@ -351,20 +481,203 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
|||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
nut-driver-enumerator.xml: $(top_builddir)/config.status $(srcdir)/nut-driver-enumerator.xml.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
nut-driver.xml: $(top_builddir)/config.status $(srcdir)/nut-driver.xml.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
nut-monitor.xml: $(top_builddir)/config.status $(srcdir)/nut-monitor.xml.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
nut-server.xml: $(top_builddir)/config.status $(srcdir)/nut-server.xml.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
nut.xml: $(top_builddir)/config.status $(srcdir)/nut.xml.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
pkginfo: $(top_builddir)/config.status $(srcdir)/pkginfo.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
svc-nut-server: $(top_builddir)/config.status $(srcdir)/svc-nut-server.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
svc-nut-monitor: $(top_builddir)/config.status $(srcdir)/svc-nut-monitor.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
precheck.py: $(top_builddir)/config.status $(srcdir)/precheck.py.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
preinstall: $(top_builddir)/config.status $(srcdir)/preinstall.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
postinstall: $(top_builddir)/config.status $(srcdir)/postinstall.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
preremove: $(top_builddir)/config.status $(srcdir)/preremove.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
postremove: $(top_builddir)/config.status $(srcdir)/postremove.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
preproto.pl: $(top_builddir)/config.status $(srcdir)/preproto.pl.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
nut: $(top_builddir)/config.status $(srcdir)/nut.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
install-libexecSCRIPTS: $(libexec_SCRIPTS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(libexecdir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(libexecdir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
|
||||
done | \
|
||||
sed -e 'p;s,.*/,,;n' \
|
||||
-e 'h;s|.*|.|' \
|
||||
-e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
|
||||
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
|
||||
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
|
||||
if ($$2 == $$4) { files[d] = files[d] " " $$1; \
|
||||
if (++n[d] == $(am__install_max)) { \
|
||||
print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
|
||||
else { print "f", d "/" $$4, $$1 } } \
|
||||
END { for (d in files) print "f", d, files[d] }' | \
|
||||
while read type dir files; do \
|
||||
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
|
||||
test -z "$$files" || { \
|
||||
echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \
|
||||
$(INSTALL_SCRIPT) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
|
||||
} \
|
||||
; done
|
||||
|
||||
uninstall-libexecSCRIPTS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || exit 0; \
|
||||
files=`for p in $$list; do echo "$$p"; done | \
|
||||
sed -e 's,.*/,,;$(transform)'`; \
|
||||
dir='$(DESTDIR)$(libexecdir)'; $(am__uninstall_files_from_dir)
|
||||
install-sbinSCRIPTS: $(sbin_SCRIPTS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
|
||||
done | \
|
||||
sed -e 'p;s,.*/,,;n' \
|
||||
-e 'h;s|.*|.|' \
|
||||
-e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
|
||||
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
|
||||
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
|
||||
if ($$2 == $$4) { files[d] = files[d] " " $$1; \
|
||||
if (++n[d] == $(am__install_max)) { \
|
||||
print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
|
||||
else { print "f", d "/" $$4, $$1 } } \
|
||||
END { for (d in files) print "f", d, files[d] }' | \
|
||||
while read type dir files; do \
|
||||
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
|
||||
test -z "$$files" || { \
|
||||
echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
|
||||
$(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
|
||||
} \
|
||||
; done
|
||||
|
||||
uninstall-sbinSCRIPTS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \
|
||||
files=`for p in $$list; do echo "$$p"; done | \
|
||||
sed -e 's,.*/,,;$(transform)'`; \
|
||||
dir='$(DESTDIR)$(sbindir)'; $(am__uninstall_files_from_dir)
|
||||
install-solarisinitscriptSCRIPTS: $(solarisinitscript_SCRIPTS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(solarisinitscript_SCRIPTS)'; test -n "$(solarisinitscriptdir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(solarisinitscriptdir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(solarisinitscriptdir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
|
||||
done | \
|
||||
sed -e 'p;s,.*/,,;n' \
|
||||
-e 'h;s|.*|.|' \
|
||||
-e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
|
||||
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
|
||||
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
|
||||
if ($$2 == $$4) { files[d] = files[d] " " $$1; \
|
||||
if (++n[d] == $(am__install_max)) { \
|
||||
print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
|
||||
else { print "f", d "/" $$4, $$1 } } \
|
||||
END { for (d in files) print "f", d, files[d] }' | \
|
||||
while read type dir files; do \
|
||||
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
|
||||
test -z "$$files" || { \
|
||||
echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(solarisinitscriptdir)$$dir'"; \
|
||||
$(INSTALL_SCRIPT) $$files "$(DESTDIR)$(solarisinitscriptdir)$$dir" || exit $$?; \
|
||||
} \
|
||||
; done
|
||||
|
||||
uninstall-solarisinitscriptSCRIPTS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(solarisinitscript_SCRIPTS)'; test -n "$(solarisinitscriptdir)" || exit 0; \
|
||||
files=`for p in $$list; do echo "$$p"; done | \
|
||||
sed -e 's,.*/,,;$(transform)'`; \
|
||||
dir='$(DESTDIR)$(solarisinitscriptdir)'; $(am__uninstall_files_from_dir)
|
||||
install-solarissmfmethodSCRIPTS: $(solarissmfmethod_SCRIPTS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(solarissmfmethod_SCRIPTS)'; test -n "$(solarissmfmethoddir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(solarissmfmethoddir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(solarissmfmethoddir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
|
||||
done | \
|
||||
sed -e 'p;s,.*/,,;n' \
|
||||
-e 'h;s|.*|.|' \
|
||||
-e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
|
||||
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
|
||||
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
|
||||
if ($$2 == $$4) { files[d] = files[d] " " $$1; \
|
||||
if (++n[d] == $(am__install_max)) { \
|
||||
print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
|
||||
else { print "f", d "/" $$4, $$1 } } \
|
||||
END { for (d in files) print "f", d, files[d] }' | \
|
||||
while read type dir files; do \
|
||||
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
|
||||
test -z "$$files" || { \
|
||||
echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(solarissmfmethoddir)$$dir'"; \
|
||||
$(INSTALL_SCRIPT) $$files "$(DESTDIR)$(solarissmfmethoddir)$$dir" || exit $$?; \
|
||||
} \
|
||||
; done
|
||||
|
||||
uninstall-solarissmfmethodSCRIPTS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(solarissmfmethod_SCRIPTS)'; test -n "$(solarissmfmethoddir)" || exit 0; \
|
||||
files=`for p in $$list; do echo "$$p"; done | \
|
||||
sed -e 's,.*/,,;$(transform)'`; \
|
||||
dir='$(DESTDIR)$(solarissmfmethoddir)'; $(am__uninstall_files_from_dir)
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
install-solarissmfmanifestDATA: $(solarissmfmanifest_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(solarissmfmanifest_DATA)'; test -n "$(solarissmfmanifestdir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(solarissmfmanifestdir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(solarissmfmanifestdir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(solarissmfmanifestdir)'"; \
|
||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(solarissmfmanifestdir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-solarissmfmanifestDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(solarissmfmanifest_DATA)'; test -n "$(solarissmfmanifestdir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
dir='$(DESTDIR)$(solarissmfmanifestdir)'; $(am__uninstall_files_from_dir)
|
||||
tags TAGS:
|
||||
|
||||
ctags CTAGS:
|
||||
|
|
@ -372,7 +685,10 @@ ctags CTAGS:
|
|||
cscope cscopelist:
|
||||
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
|
|
@ -403,9 +719,13 @@ distdir: $(DISTFILES)
|
|||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
$(MAKE) $(AM_MAKEFLAGS) check-local
|
||||
check: check-am
|
||||
all-am: Makefile
|
||||
all-am: Makefile $(SCRIPTS) $(DATA)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(solarisinitscriptdir)" "$(DESTDIR)$(solarissmfmethoddir)" "$(DESTDIR)$(solarissmfmanifestdir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
|
|
@ -436,6 +756,7 @@ distclean-generic:
|
|||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
|
@ -456,13 +777,14 @@ info: info-am
|
|||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
install-data-am: install-solarisinitscriptSCRIPTS \
|
||||
install-solarissmfmanifestDATA install-solarissmfmethodSCRIPTS
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
install-exec-am: install-libexecSCRIPTS install-sbinSCRIPTS
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
|
|
@ -500,38 +822,65 @@ ps: ps-am
|
|||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
uninstall-am: uninstall-libexecSCRIPTS uninstall-sbinSCRIPTS \
|
||||
uninstall-solarisinitscriptSCRIPTS \
|
||||
uninstall-solarissmfmanifestDATA \
|
||||
uninstall-solarissmfmethodSCRIPTS
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
.MAKE: check-am install-am install-strip
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
||||
cscopelist-am ctags-am distclean distclean-generic \
|
||||
distclean-libtool distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
.PHONY: all all-am check check-am check-local clean clean-generic \
|
||||
clean-libtool cscopelist-am ctags-am distclean \
|
||||
distclean-generic distclean-libtool distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-libexecSCRIPTS install-man install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-sbinSCRIPTS \
|
||||
install-solarisinitscriptSCRIPTS \
|
||||
install-solarissmfmanifestDATA install-solarissmfmethodSCRIPTS \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags-am uninstall uninstall-am
|
||||
tags-am uninstall uninstall-am uninstall-libexecSCRIPTS \
|
||||
uninstall-sbinSCRIPTS uninstall-solarisinitscriptSCRIPTS \
|
||||
uninstall-solarissmfmanifestDATA \
|
||||
uninstall-solarissmfmethodSCRIPTS
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
package: makelocal.sh pkginfo
|
||||
$ cd @prefix@; $ find . -print | pkgproto > prototype1
|
||||
$ cp makelocal.sh precheck.py pkginfo nut preinstall postinstall preremove postremove preproto.pl @prefix@
|
||||
$ cd @prefix@; perl preproto.pl
|
||||
$ cd @prefix@; python precheck.py
|
||||
$ cd @prefix@; rm -f prototype1
|
||||
$ cd @prefix@; ./makelocal.sh
|
||||
$ cp @prefix@/*.gz $(srcdir)
|
||||
if test `uname -p` = "i386"; then \
|
||||
mv NUT_solaris_package.local.gz NUT_solaris_i386_package@PACKAGE_VERSION@.local.gz; \
|
||||
else \
|
||||
if test `uname -p` = "sparc"; then \
|
||||
mv NUT_solaris_package.local.gz NUT_solaris_sparc_package@PACKAGE_VERSION@.local.gz; \
|
||||
fi; \
|
||||
fi;
|
||||
package: $(SOLARIS_PACKAGE_TARGETS)
|
||||
package-solaris-svr4: $(SOLARIS_PACKAGE_SVR4_HELPERSCRIPTS) $(SOLARIS_PACKAGE_SVR4_INSTALLSCRIPTS) $(SOLARIS_PACKAGE_SVR4_INSTALLDATA)
|
||||
if test -n "@auglensdir@" && test -d "$(DESTDIR)@auglensdir@" ; then \
|
||||
mkdir -p "$(DESTDIR)@datadir@/augeas-lenses" && \
|
||||
cd "$(DESTDIR)@auglensdir@" && \
|
||||
( cp -prf ./ "$(DESTDIR)@datadir@/augeas-lenses/" || cp -rf ./ "$(DESTDIR)@datadir@/augeas-lenses/" ) ; fi
|
||||
cd $(PROTOTYPE_DIR) && find . -print | pkgproto > prototype1
|
||||
cp $(SOLARIS_PACKAGE_SVR4_HELPERSCRIPTS) $(SOLARIS_PACKAGE_SVR4_INSTALLSCRIPTS) $(SOLARIS_PACKAGE_SVR4_INSTALLDATA) $(PROTOTYPE_DIR)
|
||||
cd $(PROTOTYPE_DIR) && chmod +x $(SOLARIS_PACKAGE_SVR4_HELPERSCRIPTS) $(SOLARIS_PACKAGE_SVR4_INSTALLSCRIPTS)
|
||||
cd $(PROTOTYPE_DIR) && perl preproto.pl
|
||||
@HAVE_PYTHON_TRUE@ cd $(PROTOTYPE_DIR) && $(PYTHON) precheck.py
|
||||
cd $(PROTOTYPE_DIR) && rm -f prototype1
|
||||
cd $(PROTOTYPE_DIR) && ./makelocal.sh
|
||||
cp $(PROTOTYPE_DIR)/*.gz $(builddir)
|
||||
UNAME_P="`uname -p`" && case "$${UNAME_P}" in \
|
||||
i386|sparc) \
|
||||
mv -f NUT_solaris_package.local.gz "$(abs_top_builddir)/NUT_solaris_$${UNAME_P}_package@PACKAGE_VERSION@.local.gz" ;; \
|
||||
esac
|
||||
|
||||
# TODO: Define support for IPS packaging (provide p5m files and make rules)
|
||||
package-solaris-ips:
|
||||
@echo "SKIPPED : Target $@ is not implemented yet"
|
||||
|
||||
check-local: $(SOLARIS_CHECK_TARGETS)
|
||||
|
||||
check-local-solaris-smf: $(SOLARIS_SMF_MANIFESTS)
|
||||
@[ -x /usr/sbin/svccfg ] || { echo "WARNING : Target $@ skipped due to absent /usr/sbin/svccfg" >&2; return 0; } ; \
|
||||
RES=0 ; for F in $^ ; do \
|
||||
echo " SVCCFG-VALIDATE $$F"; \
|
||||
/usr/sbin/svccfg validate "$$F" || RES=$$? ; \
|
||||
done; exit $$RES
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
|
|
|
|||
38
scripts/Solaris/README
Normal file
38
scripts/Solaris/README
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
This directory contains init-scripts and SMF manifests and methods
|
||||
for integration of NUT services with Solaris and descendant OSes.
|
||||
|
||||
This also includes the nut-driver-enumerator.sh (service and implementation
|
||||
method) and upsdrvsvcctl (tool) to manage NUT drivers as service instances,
|
||||
which are stored in ../upsdrvsvcctl/ subdirectory (portable codebase shared
|
||||
with Linux systemd).
|
||||
|
||||
The default implementation (runs once) can be enabled with:
|
||||
|
||||
svcadm enable nut-driver-enumerator:default
|
||||
|
||||
Note that at the moment there is no out-of-the-box integration for triggering
|
||||
a restart/refresh of the nut-driver-enumerator SMF service at the very instant
|
||||
when the `ups.conf` file is modified, like there is with systemd path unit type.
|
||||
Due to this, the systems administrator is expected to either invoke
|
||||
`svcadm refresh nut-driver-enumerator` after changing the NUT configuration
|
||||
or wait until the daemonized mode, if enabled, picks up the change (should do
|
||||
so within a minute by default). However, a DTrace script or a tool like
|
||||
https://github.com/emcrisostomo/fswatch wrapped into a service might be used
|
||||
for equivalent effect.
|
||||
|
||||
Alternatively, but somewhat more expensively, the same `nut-driver-enumerator.sh`
|
||||
script can be executed in a loop as the payload of the SMF service to keep
|
||||
inspecting the configuration and apply changes to the running system. It is
|
||||
not a common use-case to keep changing device setups, so this solution is not
|
||||
enforced by default ;) although a service variant is provided...
|
||||
|
||||
Note that only one of these can be enabled at the same time:
|
||||
|
||||
svcadm disable nut-driver-enumerator:default
|
||||
svcadm enable nut-driver-enumerator:daemon
|
||||
|
||||
Init-script solution contributed by numerous authors
|
||||
SMF solution contributed by Jim Klimov <jimklimov@gmail.com>
|
||||
|
||||
For special notes about USB-connected device monitoring with NUT under Solaris
|
||||
and related operating systems, see docs/solaris-usb.txt
|
||||
|
|
@ -1,5 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
pkgmk -o -d `pwd`
|
||||
pkgtrans `pwd` `pwd`/NUT_solaris_package.local
|
||||
gzip `pwd`/NUT_solaris_package.local
|
||||
# Creates the package file from current-directory contents
|
||||
# Called by Makefile starting from installed prototype directory
|
||||
|
||||
echo "Making Solaris SVR4 package metadata..." && \
|
||||
pkgmk -o -d "`pwd`" && \
|
||||
echo "Making Solaris SVR4 package archive file..." && \
|
||||
( yes "" | pkgtrans "`pwd`" "`pwd`/NUT_solaris_package.local" ) && \
|
||||
echo "Compressing Solaris SVR4 package archive file..." && \
|
||||
gzip "`pwd`/NUT_solaris_package.local"
|
||||
|
|
|
|||
178
scripts/Solaris/nut-driver-enumerator.xml.in
Normal file
178
scripts/Solaris/nut-driver-enumerator.xml.in
Normal file
|
|
@ -0,0 +1,178 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
|
||||
<!--
|
||||
#
|
||||
# Copyright 2016-2018 Jim Klimov
|
||||
# Template manifest for instantiated NUT drivers
|
||||
#
|
||||
-->
|
||||
|
||||
<service_bundle type='manifest' name='nut-driver-enumerator'>
|
||||
|
||||
<service name='system/power/nut-driver-enumerator' type='service' version='1.1'>
|
||||
|
||||
<!--
|
||||
Wait for all local and usr filesystem to be mounted - project is
|
||||
usually located in /usr/sbin.
|
||||
-->
|
||||
<dependency
|
||||
name='fs-local'
|
||||
type='service'
|
||||
grouping='require_all'
|
||||
restart_on='none'>
|
||||
<service_fmri value='svc:/system/filesystem/local' />
|
||||
</dependency>
|
||||
|
||||
<dependency
|
||||
name='filesystem-usr'
|
||||
grouping='require_all'
|
||||
restart_on='none'
|
||||
type='service'>
|
||||
<service_fmri
|
||||
value='svc:/system/filesystem/usr:default'/>
|
||||
</dependency>
|
||||
|
||||
<dependency
|
||||
name='config-files'
|
||||
type='path'
|
||||
grouping='require_all'
|
||||
restart_on='refresh'>
|
||||
<service_fmri value='file://localhost@CONFPATH@/ups.conf' />
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
Prerequisite for NUT upsd to be started, if it's enabled
|
||||
Note that drivers are optional: if one fails to start, do not block
|
||||
the upsd from publishing others. While this script will start and
|
||||
stop (and define/undefine) services for the drivers, based on the
|
||||
changes in ups.conf, such changes also need to reflect in nut-server
|
||||
so it would know that it republishes a changed list of drivers.
|
||||
-->
|
||||
<dependent
|
||||
name='nut-daemon-service'
|
||||
grouping='optional_all'
|
||||
restart_on='error'>
|
||||
<service_fmri value='svc:/system/power/nut-server' />
|
||||
</dependent>
|
||||
|
||||
<instance name='default' enabled='false'>
|
||||
<!--
|
||||
There can be only one...
|
||||
-->
|
||||
<dependency name='enumerator_daemon' grouping='exclude_all' restart_on='none' type='service'>
|
||||
<service_fmri value='svc:/system/power/nut-driver-enumerator:daemon'/>
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
The nut-driver-enumerator start/stop methods for single-fire variant.
|
||||
-->
|
||||
|
||||
<exec_method
|
||||
type='method'
|
||||
name='start'
|
||||
exec='@NUT_LIBEXECDIR@/nut-driver-enumerator.sh'
|
||||
timeout_seconds='0'/>
|
||||
|
||||
<exec_method
|
||||
type='method'
|
||||
name='refresh'
|
||||
exec='@NUT_LIBEXECDIR@/nut-driver-enumerator.sh'
|
||||
timeout_seconds='0'/>
|
||||
|
||||
<!-- a :KILL does not really apply to a transient service... -->
|
||||
<exec_method
|
||||
type='method'
|
||||
name='stop'
|
||||
exec='/bin/true'
|
||||
timeout_seconds='60' />
|
||||
|
||||
<property_group name='startd' type='framework'>
|
||||
<!--
|
||||
Sub-process core dumps and external kill signals are not
|
||||
considered errors, so the service should be restarted.
|
||||
-->
|
||||
<propval name='ignore_error' type='astring'
|
||||
value='core,signal' />
|
||||
<propval name='duration' type='astring' value='transient' />
|
||||
</property_group>
|
||||
<property_group name='general' type='framework'>
|
||||
<propval name='package' type='astring' value='NUT'/>
|
||||
</property_group>
|
||||
<template>
|
||||
<common_name>
|
||||
<loctext xml:lang='C'>
|
||||
NUT power device driver instance enumerator (generates nut-driver:* instances)
|
||||
</loctext>
|
||||
</common_name>
|
||||
<documentation>
|
||||
<manpage title='upsdrvsvcctl' section='8'
|
||||
manpath='/usr/share/man' />
|
||||
<manpage title='ups.conf' section='5'
|
||||
manpath='/usr/share/man' />
|
||||
</documentation>
|
||||
</template>
|
||||
</instance>
|
||||
|
||||
<instance name='daemon' enabled='false'>
|
||||
<!--
|
||||
There can be only one...
|
||||
-->
|
||||
<dependency name='enumerator_default' grouping='exclude_all' restart_on='none' type='service'>
|
||||
<service_fmri value='svc:/system/power/nut-driver-enumerator:default'/>
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
The nut-driver-enumerator start/stop methods for infinite loop variant.
|
||||
-->
|
||||
|
||||
<exec_method
|
||||
type='method'
|
||||
name='start'
|
||||
exec='@NUT_LIBEXECDIR@/nut-driver-enumerator.sh --daemon'
|
||||
timeout_seconds='0'/>
|
||||
|
||||
<exec_method
|
||||
type='method'
|
||||
name='refresh'
|
||||
exec=':kill -SIGHUP'
|
||||
timeout_seconds='0'/>
|
||||
|
||||
<exec_method
|
||||
type='method'
|
||||
name='stop'
|
||||
exec=':kill'
|
||||
timeout_seconds='60' />
|
||||
|
||||
<property_group name='startd' type='framework'>
|
||||
<!--
|
||||
Sub-process core dumps and external kill signals are not
|
||||
considered errors, so the service should be restarted.
|
||||
-->
|
||||
<propval name='ignore_error' type='astring'
|
||||
value='core,signal' />
|
||||
<propval name='duration' type='astring' value='contract' />
|
||||
</property_group>
|
||||
<property_group name='general' type='framework'>
|
||||
<propval name='package' type='astring' value='NUT'/>
|
||||
</property_group>
|
||||
<template>
|
||||
<common_name>
|
||||
<loctext xml:lang='C'>
|
||||
NUT power device driver instance enumerator (generates nut-driver:* instances and keeps watch of ups.conf in a loop)
|
||||
</loctext>
|
||||
</common_name>
|
||||
<documentation>
|
||||
<manpage title='upsdrvsvcctl' section='8'
|
||||
manpath='/usr/share/man' />
|
||||
<manpage title='ups.conf' section='5'
|
||||
manpath='/usr/share/man' />
|
||||
</documentation>
|
||||
</template>
|
||||
</instance>
|
||||
|
||||
<!-- Really unstable - this service should be evolved! -->
|
||||
<stability value='Unstable' />
|
||||
|
||||
</service>
|
||||
|
||||
</service_bundle>
|
||||
124
scripts/Solaris/nut-driver.xml.in
Normal file
124
scripts/Solaris/nut-driver.xml.in
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
|
||||
<!--
|
||||
#
|
||||
# Copyright 2016 - 2019 Jim Klimov
|
||||
# Template manifest for instantiated NUT drivers
|
||||
#
|
||||
-->
|
||||
|
||||
<service_bundle type='manifest' name='nut-driver'>
|
||||
|
||||
<service name='system/power/nut-driver' type='service' version='1.1'>
|
||||
|
||||
<!--
|
||||
Wait for all local and usr filesystem to be mounted - project is
|
||||
usually located in /usr/sbin.
|
||||
-->
|
||||
<dependency
|
||||
name='fs-local'
|
||||
type='service'
|
||||
grouping='require_all'
|
||||
restart_on='none'>
|
||||
<service_fmri value='svc:/system/filesystem/local' />
|
||||
</dependency>
|
||||
|
||||
<dependency
|
||||
name='filesystem-usr'
|
||||
grouping='require_all'
|
||||
restart_on='none'
|
||||
type='service'>
|
||||
<service_fmri
|
||||
value='svc:/system/filesystem/usr:default'/>
|
||||
</dependency>
|
||||
|
||||
<dependency
|
||||
name='config-files'
|
||||
type='path'
|
||||
grouping='require_all'
|
||||
restart_on='refresh'>
|
||||
<service_fmri value='file://localhost@CONFPATH@/ups.conf' />
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
Wait for syslog to be started in order to write system
|
||||
messages from the kernel and drivers, where enabled.
|
||||
-->
|
||||
<dependency
|
||||
name='syslog'
|
||||
grouping='optional_all'
|
||||
restart_on='none'
|
||||
type='service'>
|
||||
<service_fmri
|
||||
value='svc:/system/system-log:default'/>
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
Wait for enumerator to have ensured that all configured sections
|
||||
have a corresponding SMF instance. Do not restart all driver
|
||||
instances if there was just a reconfiguration of enumerator.
|
||||
-->
|
||||
<dependency
|
||||
name='nut-driver-enumerator'
|
||||
grouping='optional_all'
|
||||
restart_on='error'
|
||||
type='service'>
|
||||
<service_fmri value='svc:/system/power/nut-driver-enumerator' />
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
Prerequisite for NUT upsd to be started, if it's enabled
|
||||
Note that drivers are optional: if one fails to start, do not block
|
||||
the upsd from publishing others.
|
||||
-->
|
||||
<dependent
|
||||
name='nut-service_needs_drivers'
|
||||
grouping='optional_all'
|
||||
restart_on='none'>
|
||||
<service_fmri value='svc:/system/power/nut-server' />
|
||||
</dependent>
|
||||
|
||||
<!--
|
||||
The nut start/stop methods.
|
||||
-->
|
||||
|
||||
<exec_method
|
||||
type='method'
|
||||
name='start'
|
||||
exec='/sbin/sh -c 'NUTDEV="`@NUT_LIBEXECDIR@/nut-driver-enumerator.sh --get-device-for-service %i`" && [ -n "$NUTDEV" ] || { echo "FATAL: Could not find a NUT device section for service unit %i" >&2 ; exit 1 ; } ; @SBINDIR@/upsdrvctl %m "$NUTDEV"''
|
||||
timeout_seconds='0'/>
|
||||
|
||||
<exec_method
|
||||
type='method'
|
||||
name='stop'
|
||||
exec='/sbin/sh -c 'NUTDEV="`@NUT_LIBEXECDIR@/nut-driver-enumerator.sh --get-device-for-service %i`" && [ -n "$NUTDEV" ] || { echo "FATAL: Could not find a NUT device section for service unit %i" >&2 ; exit 1 ; } ; @SBINDIR@/upsdrvctl %m "$NUTDEV"''
|
||||
timeout_seconds='60' />
|
||||
|
||||
<property_group name='startd' type='framework'>
|
||||
<!--
|
||||
Sub-process core dumps and external kill signals are not
|
||||
considered errors, so the service should be restarted.
|
||||
-->
|
||||
<propval name='ignore_error' type='astring'
|
||||
value='core,signal' />
|
||||
</property_group>
|
||||
|
||||
<!-- Really unstable - this service should be evolved! -->
|
||||
<stability value='Unstable' />
|
||||
|
||||
<template>
|
||||
<common_name>
|
||||
<loctext xml:lang='C'>
|
||||
NUT power device driver instance wrapper
|
||||
</loctext>
|
||||
</common_name>
|
||||
<documentation>
|
||||
<manpage title='upsdrvctl' section='8'
|
||||
manpath='/usr/share/man' />
|
||||
<manpage title='ups.conf' section='5'
|
||||
manpath='/usr/share/man' />
|
||||
</documentation>
|
||||
</template>
|
||||
</service>
|
||||
|
||||
</service_bundle>
|
||||
127
scripts/Solaris/nut-monitor.xml.in
Normal file
127
scripts/Solaris/nut-monitor.xml.in
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
|
||||
<!--
|
||||
#
|
||||
# Copyright 2016-2017 Jim Klimov
|
||||
# Service for NUT upsmon
|
||||
#
|
||||
-->
|
||||
|
||||
<service_bundle type='manifest' name='nut-monitor'>
|
||||
|
||||
<service name='system/power/nut-monitor' type='service' version='1'>
|
||||
|
||||
<!--
|
||||
Configure a default instance for the service since it doesn't
|
||||
require additional configuration intervention before it starts.
|
||||
-->
|
||||
<create_default_instance enabled='false' />
|
||||
|
||||
<!--
|
||||
Wait for all local and usr filesystem to be mounted - project is
|
||||
usually located in /usr/sbin.
|
||||
-->
|
||||
<dependency
|
||||
name='fs-local'
|
||||
type='service'
|
||||
grouping='require_all'
|
||||
restart_on='none'>
|
||||
<service_fmri value='svc:/system/filesystem/local' />
|
||||
</dependency>
|
||||
|
||||
<dependency
|
||||
name='filesystem-usr'
|
||||
grouping='require_all'
|
||||
restart_on='none'
|
||||
type='service'>
|
||||
<service_fmri
|
||||
value='svc:/system/filesystem/usr:default'/>
|
||||
</dependency>
|
||||
|
||||
<dependency
|
||||
name='config-files'
|
||||
type='path'
|
||||
grouping='require_all'
|
||||
restart_on='refresh'>
|
||||
<service_fmri value='file://localhost@CONFPATH@/upsmon.conf' />
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
Wait for syslog to be started in order to write system
|
||||
messages from the kernel.
|
||||
-->
|
||||
<dependency
|
||||
name='syslog'
|
||||
grouping='optional_all'
|
||||
restart_on='none'
|
||||
type='service'>
|
||||
<service_fmri
|
||||
value='svc:/system/system-log:default'/>
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
Wait for network to be started in order to reach remote hosts.
|
||||
-->
|
||||
<dependency
|
||||
name='network-service'
|
||||
grouping='optional_all'
|
||||
restart_on='none'
|
||||
type='service'>
|
||||
<service_fmri value='svc:/network/service' />
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
Wait for NUT upsd to be started, if it's enabled
|
||||
-->
|
||||
<dependency
|
||||
name='nut-service'
|
||||
grouping='optional_all'
|
||||
restart_on='none'
|
||||
type='service'>
|
||||
<service_fmri value='svc:/system/power/nut-server' />
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
The nut start/stop methods.
|
||||
-->
|
||||
|
||||
<exec_method
|
||||
type='method'
|
||||
name='start'
|
||||
exec='@NUT_DATADIR@/solaris-smf/method/svc-nut-monitor %m'
|
||||
timeout_seconds='60'/>
|
||||
|
||||
<exec_method
|
||||
type='method'
|
||||
name='stop'
|
||||
exec=':kill'
|
||||
timeout_seconds='60' />
|
||||
|
||||
<property_group name='startd' type='framework'>
|
||||
<!--
|
||||
Sub-process core dumps and external kill signals are not
|
||||
considered errors, so the service should be restarted.
|
||||
-->
|
||||
<propval name='ignore_error' type='astring'
|
||||
value='core,signal' />
|
||||
</property_group>
|
||||
|
||||
<!-- Really unstable - this service should be evolved! -->
|
||||
<stability value='Unstable' />
|
||||
|
||||
<template>
|
||||
<common_name>
|
||||
<loctext xml:lang='C'>
|
||||
NUT ups monitoring service
|
||||
</loctext>
|
||||
</common_name>
|
||||
<documentation>
|
||||
<manpage title='upsmon' section='8'
|
||||
manpath='/usr/share/man' />
|
||||
<manpage title='upsmon.conf' section='5'
|
||||
manpath='/usr/share/man' />
|
||||
</documentation>
|
||||
</template>
|
||||
</service>
|
||||
|
||||
</service_bundle>
|
||||
154
scripts/Solaris/nut-server.xml.in
Normal file
154
scripts/Solaris/nut-server.xml.in
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
|
||||
<!--
|
||||
#
|
||||
# Copyright 2016-2017 Jim Klimov
|
||||
# Service for the upsd daemon (and drivers, if available)
|
||||
#
|
||||
-->
|
||||
|
||||
<service_bundle type='manifest' name='nut-server'>
|
||||
|
||||
<service name='system/power/nut-server' type='service' version='1'>
|
||||
|
||||
<!--
|
||||
Configure a default instance for the service since it doesn't
|
||||
require additional configuration intervention before it starts.
|
||||
-->
|
||||
<create_default_instance enabled='false' />
|
||||
|
||||
<!--
|
||||
Wait for all local and usr filesystem to be mounted - project is
|
||||
usually located in /usr/sbin.
|
||||
-->
|
||||
<dependency
|
||||
name='fs-local'
|
||||
type='service'
|
||||
grouping='require_all'
|
||||
restart_on='none'>
|
||||
<service_fmri value='svc:/system/filesystem/local' />
|
||||
</dependency>
|
||||
|
||||
<dependency
|
||||
name='filesystem-usr'
|
||||
grouping='require_all'
|
||||
restart_on='none'
|
||||
type='service'>
|
||||
<service_fmri
|
||||
value='svc:/system/filesystem/usr:default'/>
|
||||
</dependency>
|
||||
|
||||
<dependency
|
||||
name='config-files'
|
||||
type='path'
|
||||
grouping='require_all'
|
||||
restart_on='refresh'>
|
||||
<service_fmri value='file://localhost@CONFPATH@/ups.conf' />
|
||||
<service_fmri value='file://localhost@CONFPATH@/upsd.conf' />
|
||||
<service_fmri value='file://localhost@CONFPATH@/upsd.users' />
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
Wait for syslog to be started in order to write system
|
||||
messages from the kernel.
|
||||
-->
|
||||
<dependency
|
||||
name='syslog'
|
||||
grouping='optional_all'
|
||||
restart_on='none'
|
||||
type='service'>
|
||||
<service_fmri
|
||||
value='svc:/system/system-log:default'/>
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
Wait for network to be started in order to reach remote hosts.
|
||||
-->
|
||||
<dependency
|
||||
name='network-service'
|
||||
grouping='optional_all'
|
||||
restart_on='none'
|
||||
type='service'>
|
||||
<service_fmri value='svc:/network/service' />
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
Wait for drivers to be wrapped in service instances
|
||||
Note that drivers are optional: if one fails to start or get configured,
|
||||
do not block the upsd from publishing others.
|
||||
-->
|
||||
<dependency
|
||||
name='nut-driver-enumerator'
|
||||
grouping='optional_all'
|
||||
restart_on='none'
|
||||
type='service'>
|
||||
<service_fmri value='svc:/system/power/nut-driver-enumerator' />
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
Prerequisite for NUT upsmon to be started, if it's enabled
|
||||
Although that may (also) be a client to some other server...
|
||||
-->
|
||||
<dependent
|
||||
name='nut-monitor-service'
|
||||
grouping='optional_all'
|
||||
restart_on='none'>
|
||||
<service_fmri value='svc:/system/power/nut-monitor' />
|
||||
</dependent>
|
||||
|
||||
<!--
|
||||
The nut start/stop methods.
|
||||
-->
|
||||
|
||||
<exec_method
|
||||
type='method'
|
||||
name='start'
|
||||
exec='@NUT_DATADIR@/solaris-smf/method/svc-nut-server %m'
|
||||
timeout_seconds='60'/>
|
||||
|
||||
<exec_method
|
||||
type='method'
|
||||
name='refresh'
|
||||
exec='@NUT_DATADIR@/solaris-smf/method/svc-nut-server %m'
|
||||
timeout_seconds='60'/>
|
||||
|
||||
<exec_method
|
||||
type='method'
|
||||
name='stop'
|
||||
exec=':kill'
|
||||
timeout_seconds='60' />
|
||||
|
||||
<property_group name='startd' type='framework'>
|
||||
<!--
|
||||
Sub-process core dumps and external kill signals are not
|
||||
considered errors, so the service should be restarted.
|
||||
-->
|
||||
<propval name='ignore_error' type='astring'
|
||||
value='core,signal' />
|
||||
</property_group>
|
||||
|
||||
<!-- Really unstable - this service should be evolved! -->
|
||||
<stability value='Unstable' />
|
||||
|
||||
<template>
|
||||
<common_name>
|
||||
<loctext xml:lang='C'>
|
||||
NUT data server
|
||||
</loctext>
|
||||
</common_name>
|
||||
<documentation>
|
||||
<manpage title='upsdrvctl' section='8'
|
||||
manpath='/usr/share/man' />
|
||||
<manpage title='upsd' section='8'
|
||||
manpath='/usr/share/man' />
|
||||
<manpage title='ups.conf' section='5'
|
||||
manpath='/usr/share/man' />
|
||||
<manpage title='upsd.conf' section='5'
|
||||
manpath='/usr/share/man' />
|
||||
<manpage title='upsd.users' section='5'
|
||||
manpath='/usr/share/man' />
|
||||
</documentation>
|
||||
</template>
|
||||
</service>
|
||||
|
||||
</service_bundle>
|
||||
29
scripts/Solaris/nut.in
Normal file → Executable file
29
scripts/Solaris/nut.in
Normal file → Executable file
|
|
@ -3,29 +3,31 @@
|
|||
#init.d script to start nut services
|
||||
|
||||
NUT_DIR="@prefix@"
|
||||
CONFIG=$NUT_DIR/etc/nut.conf
|
||||
NUT_SBIN_DIR="${NUT_DIR}/sbin"
|
||||
NUT_LIB_DIR="${NUT_DIR}/lib"
|
||||
CONFIG="@CONFPATH@/nut.conf"
|
||||
|
||||
if [ -f $CONFIG ] ; then
|
||||
. $CONFIG
|
||||
if [ -f "$CONFIG" ] ; then
|
||||
. "$CONFIG"
|
||||
fi
|
||||
|
||||
ups_stop () {
|
||||
pkill -n upsmon
|
||||
pkill -n upsd
|
||||
${NUT_DIR}/sbin/upsdrvctl stop > /dev/null 2>&1
|
||||
LD_LIBRARY_PATH="${NUT_LIB_DIR}:$LD_LIBRARY_PATH" "${NUT_SBIN_DIR}/upsdrvctl" stop > /dev/null 2>&1
|
||||
}
|
||||
|
||||
ups_start () {
|
||||
if [ "$MODE" = "none" ];then
|
||||
echo No mode set
|
||||
echo "No NUT mode set, not starting anything" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! "$MODE" = "netclient" ];then
|
||||
$NUT_DIR/sbin/upsdrvctl start #> /dev/null 2>&1
|
||||
$NUT_DIR/sbin/upsd #> /dev/null 2>&1
|
||||
if [ "$MODE" != "netclient" ] ; then
|
||||
LD_LIBRARY_PATH="${NUT_LIB_DIR}:$LD_LIBRARY_PATH" "${NUT_SBIN_DIR}/upsdrvctl" start #> /dev/null 2>&1
|
||||
LD_LIBRARY_PATH="${NUT_LIB_DIR}:$LD_LIBRARY_PATH" "${NUT_SBIN_DIR}/upsd" #> /dev/null 2>&1
|
||||
fi
|
||||
$NUT_DIR/sbin/upsmon #> /dev/null 2>&1
|
||||
LD_LIBRARY_PATH="${NUT_LIB_DIR}:$LD_LIBRARY_PATH" "${NUT_SBIN_DIR}/upsmon" #> /dev/null 2>&1
|
||||
}
|
||||
|
||||
case $1 in
|
||||
|
|
@ -46,10 +48,11 @@ case $1 in
|
|||
ups_start
|
||||
;;
|
||||
'poweroff')
|
||||
$NUT_DIR/sbin/upsmon -K >/dev/null 2>&1
|
||||
LD_LIBRARY_PATH="${NUT_LIB_DIR}:$LD_LIBRARY_PATH" "${NUT_SBIN_DIR}/upsmon" -K >/dev/null 2>&1
|
||||
if [ $? = 0 ]; then
|
||||
echo "Shutting down the UPS ..."
|
||||
#$NUT_DIR/sbin/upsdrvctl shutdown
|
||||
echo "Shutting down the UPS(es) ..."
|
||||
echo "WARNING: UPS shutdown is currently disabled, please uncomment it in the init-script if desired" >&2
|
||||
#${NUT_SBIN_DIR}/upsdrvctl shutdown
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
|
|
@ -57,7 +60,7 @@ case $1 in
|
|||
echo "Usage: '$0' {start | stop | restart }"
|
||||
echo ""
|
||||
exit 64
|
||||
;;
|
||||
;;
|
||||
|
||||
esac
|
||||
exit $?
|
||||
|
|
|
|||
102
scripts/Solaris/nut.xml.in
Normal file
102
scripts/Solaris/nut.xml.in
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
|
||||
<!--
|
||||
#
|
||||
# Copyright 2016-2017 Jim Klimov
|
||||
# Service for common startup or shutdown of NUT-related services
|
||||
#
|
||||
-->
|
||||
|
||||
<service_bundle type='manifest' name='nut'>
|
||||
|
||||
<service name='system/power/nut' type='service' version='1'>
|
||||
|
||||
<!--
|
||||
Configure a default instance for the service since it doesn't
|
||||
require additional configuration intervention before it starts.
|
||||
-->
|
||||
<create_default_instance enabled='true' />
|
||||
|
||||
<!--
|
||||
Not all deployments have both the drivers+data server and client
|
||||
on the same box, so this service only triggers whatever is enabled
|
||||
and waits for other system resources according to dependencies of
|
||||
those actual services.
|
||||
-->
|
||||
<dependency
|
||||
name='syslog'
|
||||
grouping='optional_all'
|
||||
restart_on='error'
|
||||
type='service'>
|
||||
<service_fmri value='svc:/system/power/nut-server:default'/>
|
||||
<service_fmri value='svc:/system/power/nut-monitor:default'/>
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
The nut start/stop methods.
|
||||
-->
|
||||
|
||||
<!-- The startup is expected to trigger enabled dependency services
|
||||
and not-trigger those which were not administratively enabled.
|
||||
There is nothing to do by itself, so it is not-persistent. -->
|
||||
<exec_method
|
||||
type='method'
|
||||
name='start'
|
||||
exec='/bin/true'
|
||||
timeout_seconds='60'/>
|
||||
|
||||
<!-- The shutdown temporarily-disables all components (if they were
|
||||
enabled and running in the first place, no-op otherwise) -->
|
||||
<exec_method
|
||||
type='method'
|
||||
name='stop'
|
||||
exec='/usr/sbin/svcadm disable -ts svc:/system/power/nut-monitor:default || /bin/true ; /usr/sbin/svcadm disable -ts svc:/system/power/nut-server:default || /bin/true ; @SBINDIR@/upsdrvsvcctl stop || /bin/true ; /bin/true'
|
||||
timeout_seconds='120' />
|
||||
|
||||
<!-- When users "refresh nut" they are likely interested
|
||||
in a new config being applied... -->
|
||||
<exec_method
|
||||
type='method'
|
||||
name='refresh'
|
||||
exec='@NUT_LIBEXECDIR@/nut-driver-enumerator.sh'
|
||||
timeout_seconds='0'/>
|
||||
|
||||
<property_group name='startd' type='framework'>
|
||||
<!--
|
||||
Sub-process core dumps and external kill signals are not
|
||||
considered errors, so the service should be restarted.
|
||||
-->
|
||||
<propval name='ignore_error' type='astring'
|
||||
value='core,signal' />
|
||||
<!--
|
||||
A transient service executes the start method once and does
|
||||
not execute it again if the method exits with $SMF_EXIT_OK.
|
||||
-->
|
||||
<propval name='duration' type='astring' value='transient' />
|
||||
</property_group>
|
||||
|
||||
<!-- Really unstable - this service should be evolved! -->
|
||||
<stability value='Unstable' />
|
||||
|
||||
<template>
|
||||
<common_name>
|
||||
<loctext xml:lang='C'>
|
||||
Service for common startup or shutdown of NUT-related services
|
||||
</loctext>
|
||||
</common_name>
|
||||
<documentation>
|
||||
<manpage title='upsdrvctl' section='8'
|
||||
manpath='/usr/share/man' />
|
||||
<manpage title='upsd' section='8'
|
||||
manpath='/usr/share/man' />
|
||||
<manpage title='ups.conf' section='5'
|
||||
manpath='/usr/share/man' />
|
||||
<manpage title='upsd.conf' section='5'
|
||||
manpath='/usr/share/man' />
|
||||
<manpage title='upsd.users' section='5'
|
||||
manpath='/usr/share/man' />
|
||||
</documentation>
|
||||
</template>
|
||||
</service>
|
||||
|
||||
</service_bundle>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
PKG="NUT"
|
||||
NAME="Network UPS Tools"
|
||||
ARCH="@OS_NAME@"
|
||||
ARCH="@target_cpu@"
|
||||
VERSION="@PACKAGE_VERSION@"
|
||||
CATEGORY="application"
|
||||
VENDOR="http://www.networkupstools.org"
|
||||
|
|
|
|||
129
scripts/Solaris/postinstall.in
Normal file → Executable file
129
scripts/Solaris/postinstall.in
Normal file → Executable file
|
|
@ -1,65 +1,126 @@
|
|||
#!/bin/sh
|
||||
|
||||
#Postinstall script
|
||||
# Postinstall script for Network UPS Tools package
|
||||
|
||||
NUT_DIR="@prefix@"
|
||||
prefix="@prefix@" # expanded as part of some autoconf macros below
|
||||
|
||||
# TODO/FIXME : Should "/var/run" be a configure variable?
|
||||
# Note that "/var/run" is transient tmpfs, so upgrade has to be done during same uptime.
|
||||
ACTIVE_ENUMERATOR_FMRI_FILE="/var/run/nut-driver-enumerator-fmri.prev"
|
||||
|
||||
# make sure the nut user exists and has correct memberships
|
||||
res=`getent group nut`
|
||||
res="`getent group @RUN_AS_GROUP@`" || res=""
|
||||
if [ -z "$res" ]; then
|
||||
groupadd nut
|
||||
/usr/sbin/groupadd "@RUN_AS_GROUP@"
|
||||
fi
|
||||
res=`getent passwd nut`
|
||||
res="`getent passwd @RUN_AS_USER@`" || res=""
|
||||
if [ -z "$res" ]; then
|
||||
useradd -g nut -G root -d ${NUT_DIR}/bin nut
|
||||
/usr/sbin/useradd -c "Network UPS Tools" -g "@RUN_AS_GROUP@" -G root -d "@STATEPATH@" -s /bin/false @RUN_AS_USER@
|
||||
fi
|
||||
|
||||
res=`groups nut | grep -w nut`
|
||||
res="`groups "@RUN_AS_GROUP@" | grep -w "@RUN_AS_USER@"`" || res=""
|
||||
if [ -z "$res" ]; then
|
||||
usermod -g nut -G root nut
|
||||
/usr/sbin/usermod -g "@RUN_AS_GROUP@" -G root "@RUN_AS_USER@"
|
||||
fi
|
||||
|
||||
# make sure that conffiles are secured and have the correct ownerships
|
||||
if [ -d @CONFPATH@ ] ; then
|
||||
chown root:nut @CONFPATH@
|
||||
if [ -d "@CONFPATH@" ] ; then
|
||||
chown "root:@RUN_AS_GROUP@" "@CONFPATH@"
|
||||
fi
|
||||
for file in nut.conf ups.conf upsd.conf upsmon.conf upsd.users upssched.conf; do
|
||||
if [ -f @CONFPATH@/$file ] ; then
|
||||
chown root:nut @CONFPATH@/$file
|
||||
chmod 640 @CONFPATH@/$file
|
||||
for file in nut.conf ups.conf upsd.conf upsmon.conf upsd.users upssched.conf nut-driver-enumerator.conf; do
|
||||
if [ -f "@CONFPATH@/$file" ] ; then
|
||||
chown "root:@RUN_AS_GROUP@" "@CONFPATH@/$file"
|
||||
chmod 640 "@CONFPATH@/$file"
|
||||
fi
|
||||
done
|
||||
|
||||
# make sure that /var/run/nut exists and has the correct ownerships
|
||||
if [ ! -d @PIDPATH@/nut ] ; then
|
||||
mkdir -p @PIDPATH@/nut
|
||||
if [ ! -d "@PIDPATH@/nut" ] ; then
|
||||
mkdir -p "@PIDPATH@/nut"
|
||||
fi
|
||||
if [ -d @PIDPATH@/nut ] ; then
|
||||
chown root:nut @PIDPATH@/nut
|
||||
chmod 770 @PIDPATH@/nut
|
||||
if [ -d "@PIDPATH@/nut" ] ; then
|
||||
chown "root:@RUN_AS_GROUP@" "@PIDPATH@/nut"
|
||||
chmod 770 "@PIDPATH@/nut"
|
||||
fi
|
||||
|
||||
# make sure that /var/state/ups exists and has the correct ownerships
|
||||
if [ ! -d @STATEPATH@ ] ; then
|
||||
mkdir -p @STATEPATH@
|
||||
if [ ! -d "@STATEPATH@" ] ; then
|
||||
mkdir -p "@STATEPATH@"
|
||||
fi
|
||||
if [ -d @STATEPATH@ ] ; then
|
||||
chown root:nut @STATEPATH@
|
||||
chmod 770 @STATEPATH@
|
||||
if [ -d "@STATEPATH@" ] ; then
|
||||
chown "root:@RUN_AS_GROUP@" "@STATEPATH@"
|
||||
chmod 770 "@STATEPATH@"
|
||||
fi
|
||||
|
||||
# Put init script in /etc/init.d
|
||||
if [ -n "@auglensdir@" ] && [ -d "@auglensdir@" ] && [ -d "@datarootdir@/augeas-lenses" ] ; then
|
||||
( cd "@datarootdir@/augeas-lenses" && cp -prf ./ "@auglensdir@"/ )
|
||||
fi
|
||||
|
||||
cp $NUT_DIR/nut /etc/init.d
|
||||
chmod 744 /etc/init.d/nut
|
||||
if test -x /usr/sbin/svcadm && test -x /usr/sbin/svccfg && test -x /usr/bin/svcs ; then
|
||||
echo "Register SMF services..."
|
||||
for S in nut-driver-enumerator nut-driver nut-server nut-monitor nut ; do
|
||||
echo "Importing NUT service manifest: $S..."
|
||||
/usr/sbin/svccfg import "@datarootdir@/solaris-smf/manifest/$S.xml"
|
||||
done
|
||||
# Enable services if the system already has a configuration (e.g. upgrade)
|
||||
if test -s "@CONFPATH@/ups.conf" ; then
|
||||
echo "Stopping NUT drivers, if any (in case of upgrade)..."
|
||||
@SBINDIR@/upsdrvsvcctl stop
|
||||
@SBINDIR@/upsdrvctl -DDDDD stop
|
||||
sleep 5
|
||||
echo "(Re-)register NUT drivers (if any)..."
|
||||
REPORT_RESTART_42=no AUTO_START=no "@NUT_LIBEXECDIR@/nut-driver-enumerator.sh" --reconfigure
|
||||
sleep 2
|
||||
echo "Enable NUT drivers (if any)..."
|
||||
# Note: we now provide two services, a daemon that keeps checking
|
||||
# the config for changes and a default one that should be refreshed
|
||||
# manually to reconfigure nut-driver instances - and is "cheaper".
|
||||
# This may still fail if the daemon instance is somehow enabled (admin)
|
||||
PREV_ACTIVE_ENUMERATOR=""
|
||||
if test -s "${ACTIVE_ENUMERATOR_FMRI_FILE}" ; then
|
||||
PREV_ACTIVE_ENUMERATOR="`head -1 "${ACTIVE_ENUMERATOR_FMRI_FILE}"`"
|
||||
fi
|
||||
[ x"nut-driver-enumerator:default" = x"${PREV_ACTIVE_ENUMERATOR}" ] && PREV_ACTIVE_ENUMERATOR=""
|
||||
for ACTIVE_ENUMERATOR in ${PREV_ACTIVE_ENUMERATOR} nut-driver-enumerator:default ; do
|
||||
/usr/sbin/svcadm enable -s ${ACTIVE_ENUMERATOR} || \
|
||||
{ /usr/sbin/svcadm clear ${ACTIVE_ENUMERATOR} 2>/dev/null ; \
|
||||
/usr/sbin/svcadm enable -s ${ACTIVE_ENUMERATOR} ; } && break || true
|
||||
done
|
||||
@SBINDIR@/upsdrvsvcctl start
|
||||
else
|
||||
echo "NOT ENABLING nut-driver-enumerator at this time : missing or empty @CONFPATH@/ups.conf" >&2
|
||||
fi
|
||||
if test -s "@CONFPATH@/ups.conf" && test -e "@CONFPATH@/upsd.conf" && test -e "@CONFPATH@/upsd.users" ; then
|
||||
# Note on the mix of "-s" and "-e" in tests above:
|
||||
# it is a valid use-case for an admin to have just touched an
|
||||
# empty upsd.conf and so use default settings for the daemon
|
||||
echo "Enable NUT upsd data server..."
|
||||
/usr/sbin/svcadm enable -s nut-server
|
||||
else
|
||||
echo "NOT ENABLING nut-server at this time : missing at least one of : @CONFPATH@/ups.conf @CONFPATH@/upsd.conf @CONFPATH@/upsd.users" >&2
|
||||
fi
|
||||
if test -s "@CONFPATH@/upsmon.conf" ; then
|
||||
echo "Enable NUT upsmon client..."
|
||||
/usr/sbin/svcadm enable -s nut-monitor
|
||||
else
|
||||
echo "NOT ENABLING nut-monitor at this time : missing or empty @CONFPATH@/upsmon.conf" >&2
|
||||
fi
|
||||
echo "Enable NUT umbrella service..."
|
||||
/usr/sbin/svcadm enable -s nut
|
||||
else
|
||||
echo "Put init script in /etc/init.d..."
|
||||
cp -pf "@NUT_DATADIR@/solaris-init/nut" /etc/init.d
|
||||
chown root:bin /etc/init.d/nut
|
||||
chmod 744 /etc/init.d/nut
|
||||
|
||||
ln -s /etc/init.d/nut /etc/rc3.d/S100nut > /dev/null 2>&1
|
||||
ln -s /etc/init.d/nut /etc/rc3.d/K100nut > /dev/null 2>&1
|
||||
ln -s ../init.d/nut /etc/rc3.d/S90nut > /dev/null 2>&1
|
||||
ln -s ../init.d/nut /etc/rc3.d/K10nut > /dev/null 2>&1
|
||||
|
||||
# Start nut services
|
||||
|
||||
#echo "Starting nut services"
|
||||
#$NUT_DIR/sbin/upsdrvctl start #> /dev/null 2>&1
|
||||
#$NUT_DIR/sbin/upsd #> /dev/null 2>&1
|
||||
#$NUT_DIR/sbin/upsmon #> /dev/null 2>&1
|
||||
# Start nut services
|
||||
|
||||
#echo "Starting nut services"
|
||||
#$NUT_DIR/sbin/upsdrvctl start #> /dev/null 2>&1
|
||||
#$NUT_DIR/sbin/upsd #> /dev/null 2>&1
|
||||
#$NUT_DIR/sbin/upsmon #> /dev/null 2>&1
|
||||
fi
|
||||
|
|
|
|||
19
scripts/Solaris/postremove.in
Executable file
19
scripts/Solaris/postremove.in
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Postremove script for Network UPS Tools package
|
||||
|
||||
# Remove init script from /etc/init.d - created by scripts not packaging
|
||||
|
||||
rm -f /etc/init.d/nut
|
||||
rm -f /etc/rc3.d/S90nut
|
||||
rm -f /etc/rc3.d/K10nut
|
||||
|
||||
# Remove nut group and user
|
||||
|
||||
/usr/sbin/userdel "@RUN_AS_USER@"
|
||||
|
||||
/usr/sbin/groupdel "@RUN_AS_GROUP@"
|
||||
|
||||
# Remove /var/run/nut
|
||||
|
||||
rm -rf "@PIDPATH@/nut"
|
||||
48
scripts/Solaris/precheck.py.in
Executable file
48
scripts/Solaris/precheck.py.in
Executable file
|
|
@ -0,0 +1,48 @@
|
|||
#!@PYTHON@
|
||||
|
||||
import sys
|
||||
|
||||
if sys.version_info >= ( 2, 6 ):
|
||||
import subprocess
|
||||
p = subprocess.Popen(["uname", "-s"], stdout=subprocess.PIPE)
|
||||
platform = p.communicate()[0]
|
||||
if p.returncode != 0:
|
||||
raise Exception("FAILED to get platform from 'uname -s'!")
|
||||
|
||||
p = subprocess.Popen(["uname", "-p"], stdout=subprocess.PIPE)
|
||||
architecture = p.communicate()[0]
|
||||
if p.returncode != 0:
|
||||
raise Exception("FAILED to get architecture from 'uname -p'!")
|
||||
else:
|
||||
import commands
|
||||
platform = commands.getoutput('uname -s')
|
||||
architecture = commands.getoutput('uname -p')
|
||||
|
||||
# checkinstall script creation
|
||||
fp=open("checkinstall","w")
|
||||
# Note: same arch is relevant for different bitnesses that
|
||||
# can be discerned via `isainfo` further (if ever needed)
|
||||
fp.write("#!/bin/sh\n")
|
||||
fp.write("\nexpected_platform=SunOS\n")
|
||||
if platform == "SunOS" and architecture == "i386":
|
||||
fp.write("expected_architecture=i386\n")
|
||||
elif platform == "SunOS" and architecture == "sparc":
|
||||
fp.write("expected_architecture=sparc\n")
|
||||
|
||||
fp.write("platform=\"`uname -s`\"\n")
|
||||
fp.write("architecture=\"`uname -p`\"\n\n")
|
||||
|
||||
fp.write("if [ \"${platform}\" -eq \"${expected_platform}\" ]; then\n")
|
||||
fp.write("\tif [ \"${architecture}\" -eq \"${expected_architecture}\" ]; then\n")
|
||||
fp.write("\t\techo \"Checkinstall complete\"\n")
|
||||
fp.write("\telse\n")
|
||||
fp.write("\t\techo \"This is not Solaris $architecture machine: platform='${platform}' expected_platform='${expected_platform}'\"\n")
|
||||
fp.write("\t\texit 1\n")
|
||||
fp.write("\tfi\n")
|
||||
fp.write("else\n")
|
||||
fp.write("\techo \"This is not Solaris machine: architecture='${architecture}' expected_architecture='${expected_architecture}'\"\n")
|
||||
fp.write("\texit 1\n")
|
||||
fp.write("fi\n")
|
||||
fp.write("exit 0\n")
|
||||
|
||||
fp.close()
|
||||
23
scripts/Solaris/preinstall.in
Executable file
23
scripts/Solaris/preinstall.in
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Preinstall script for Network UPS Tools package
|
||||
NUT_DIR="@prefix@"
|
||||
|
||||
# Create group nut
|
||||
|
||||
grep -w "@RUN_AS_GROUP@" /etc/group
|
||||
if [ "$?" != 0 ]; then
|
||||
/usr/sbin/groupadd "@RUN_AS_GROUP@"
|
||||
fi
|
||||
|
||||
# Create user for installing "Network UPS Tools"
|
||||
|
||||
grep -w "@RUN_AS_USER@" /etc/passwd
|
||||
if [ "$?" != 0 ]; then
|
||||
/usr/sbin/useradd -c "Network UPS Tools" -g "@RUN_AS_GROUP@" -G root -d "@STATEPATH@" -s /bin/false "@RUN_AS_USER@"
|
||||
fi
|
||||
|
||||
res="`groups "@RUN_AS_GROUP@" | grep -w "@RUN_AS_USER@"`" || res=""
|
||||
if [ -z "$res" ]; then
|
||||
/usr/sbin/usermod -g "@RUN_AS_GROUP@" -G root "@RUN_AS_USER@"
|
||||
fi
|
||||
39
scripts/Solaris/preproto.pl.in
Executable file
39
scripts/Solaris/preproto.pl.in
Executable file
|
|
@ -0,0 +1,39 @@
|
|||
#!/usr/bin/env perl
|
||||
|
||||
$temp = "prototype1";
|
||||
$prototype="prototype";
|
||||
$pkginfo = "pkginfo";
|
||||
$checkinstall = "checkinstall";
|
||||
$preinstall = "preinstall";
|
||||
$postinstall = "postinstall";
|
||||
$preremove = "preremove";
|
||||
$postremove = "postremove";
|
||||
$nutuser = "@RUN_AS_USER@";
|
||||
$nutgroup = "@RUN_AS_GROUP@";
|
||||
|
||||
open (PREPROTO,"< $temp") || die "Unable to read prototype information ($!)\n";
|
||||
open (PROTO,"> $prototype") || die "Unable to write file prototype ($!)\n";
|
||||
print PROTO "i pkginfo=./$pkginfo\n";
|
||||
print PROTO "i checkinstall=./$checkinstall\n";
|
||||
print PROTO "i preinstall=./$preinstall\n";
|
||||
print PROTO "i postinstall=./$postinstall\n";
|
||||
print PROTO "i preremove=./$preremove\n";
|
||||
print PROTO "i postremove=./$postremove\n";
|
||||
while (<PREPROTO>) {
|
||||
# Read the prototype information from /tmp/prototype$$
|
||||
chomp;
|
||||
$thisline = $_;
|
||||
if ($thisline =~ " prototype1 ") {
|
||||
# We don't need that line
|
||||
} elsif ($thisline =~ "^[fd] ") {
|
||||
# Change the ownership for files and directories
|
||||
($dir, $none, $file, $mode, $user, $group) = split / /,$thisline;
|
||||
print PROTO "$dir $none $file=$file $mode $nutuser $nutgroup\n";
|
||||
} else {
|
||||
# Symlinks and other stuff should be printed as well ofcourse
|
||||
print PROTO "$thisline\n";
|
||||
}
|
||||
}
|
||||
#print PROTO "f $none nut $mode root $nutgroup\n";
|
||||
close PROTO;
|
||||
close PREPROTO;
|
||||
67
scripts/Solaris/preremove.in
Normal file → Executable file
67
scripts/Solaris/preremove.in
Normal file → Executable file
|
|
@ -1,8 +1,71 @@
|
|||
#!bin/sh
|
||||
#!/bin/sh
|
||||
|
||||
# Preremove script for Network UPS Tools package
|
||||
|
||||
# Stop all nut services
|
||||
|
||||
NUT_DIR="@prefix@"
|
||||
prefix="@prefix@" # expanded as part of some autoconf macros below
|
||||
|
||||
#$NUT_DIR/sbin/upsdrvctl stop
|
||||
# TODO/FIXME : Should "/var/run" be a configure variable?
|
||||
# Note that "/var/run" is transient tmpfs, so upgrade has to be done during same uptime.
|
||||
ACTIVE_ENUMERATOR_FMRI_FILE="/var/run/nut-driver-enumerator-fmri.prev"
|
||||
|
||||
if test -x /usr/sbin/svcadm && test -x /usr/sbin/svccfg && test -x /usr/bin/svcs ; then
|
||||
# Unconfigure SMF services
|
||||
# First detect the first active (online, maintenance, etc.)
|
||||
# instance of nut-driver-enumerator so we can pass it to the
|
||||
# next lifetime in case of re-install of NUT and keep the
|
||||
# user's previously declared preference.
|
||||
ACTIVE_ENUMERATOR="`/usr/bin/svcs -H -o state,fmri '*/nut-driver-enumerator:*' | while read S F ; do [ "$S" != "disabled" ] && [ "$S" != "offline" ] && echo "$F" && break ; done`"
|
||||
if [ -n "$ACTIVE_ENUMERATOR" ]; then
|
||||
rm -f "${ACTIVE_ENUMERATOR_FMRI_FILE}"
|
||||
touch "${ACTIVE_ENUMERATOR_FMRI_FILE}"
|
||||
chmod 600 "${ACTIVE_ENUMERATOR_FMRI_FILE}"
|
||||
chown 0:0 "${ACTIVE_ENUMERATOR_FMRI_FILE}"
|
||||
echo "${ACTIVE_ENUMERATOR}" > "${ACTIVE_ENUMERATOR_FMRI_FILE}"
|
||||
fi
|
||||
# First tell the automagic to stop, so it does not interfere; diligently clean it out below
|
||||
/usr/sbin/svcadm disable nut-driver-enumerator:default || true
|
||||
/usr/sbin/svcadm disable nut-driver-enumerator:daemon || true
|
||||
for S in nut nut-monitor nut-server ; do
|
||||
echo "Stopping NUT service: $S..."
|
||||
/usr/sbin/svcadm clear "$S" 2>/dev/null
|
||||
/usr/sbin/svcadm disable -s "$S"
|
||||
echo "Removing NUT service: $S..."
|
||||
/usr/sbin/svccfg delete "$S" || \
|
||||
/usr/sbin/svccfg -s "$S" delete || \
|
||||
/usr/sbin/svccfg -s "$S" delete default
|
||||
done
|
||||
echo "Stopping NUT drivers, if any..."
|
||||
@SBINDIR@/upsdrvsvcctl stop
|
||||
@SBINDIR@/upsdrvctl -DDDDD stop
|
||||
sleep 5
|
||||
for S in `/usr/bin/svcs -H -o fmri '*/nut-driver:*'` `/usr/bin/svcs -H -o fmri '*/nut-driver-enumerator:*'` ; do
|
||||
echo "Stopping NUT service: $S..."
|
||||
/usr/sbin/svcadm clear "$S" 2>/dev/null
|
||||
/usr/sbin/svcadm disable -s "$S"
|
||||
done
|
||||
sleep 5
|
||||
for S in `/usr/bin/svcs -H -o fmri '*/nut-driver:*' | grep -wv default` `/usr/bin/svcs -H -o fmri '*/nut-driver-enumerator:*' | grep -wv default` ; do
|
||||
echo "Removing NUT service: $S..."
|
||||
# Note: S here is a full FMRI URL
|
||||
SB="`echo "$S" | sed 's,:[^:]*$,,'`"
|
||||
SI="`echo "$S" | sed 's,^.*:\([^:]*\)$,\1,'`"
|
||||
/usr/sbin/svcadm disable -s "$S"
|
||||
/usr/sbin/svccfg -s "$SB" delete -f "$SI" || \
|
||||
/usr/sbin/svccfg delete "$S"
|
||||
done
|
||||
for S in nut-driver-enumerator nut-driver ; do
|
||||
echo "Removing NUT service: $S..." && \
|
||||
/usr/sbin/svccfg delete "$S" || \
|
||||
/usr/sbin/svccfg -s "$S" delete || \
|
||||
/usr/sbin/svccfg -s "$S" delete default
|
||||
done
|
||||
else
|
||||
[ -x /etc/init.d/nut ] && /etc/init.d/nut stop
|
||||
fi
|
||||
|
||||
if [ -n "@auglensdir@" ] && [ -d "@auglensdir@" ] && [ -d "@datarootdir@/augeas-lenses" ] ; then
|
||||
( cd "@datarootdir@/augeas-lenses" && find . -type f -exec rm -f "@auglensdir@"/'{}' \; )
|
||||
fi
|
||||
|
|
|
|||
56
scripts/Solaris/svc-nut-monitor.in
Executable file
56
scripts/Solaris/svc-nut-monitor.in
Executable file
|
|
@ -0,0 +1,56 @@
|
|||
#!/sbin/sh
|
||||
|
||||
# Trivial (better is yet to come) SMF method script to start nut services
|
||||
# Adapted for OpenIndiana userland from init.d script template in NUT sources
|
||||
# Adaptation copyright (C) 2016-2017 Jim Klimov
|
||||
|
||||
if [ -z "$SMF_FMRI" ]; then
|
||||
echo "$0 must be called in SMF context!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# smf(5)
|
||||
. /lib/svc/share/smf_include.sh || exit
|
||||
|
||||
prefix="@prefix@"
|
||||
NUT_DIR="@prefix@"
|
||||
NUT_SBIN_DIR="${NUT_DIR}/sbin"
|
||||
NUT_LIB_DIR="${NUT_DIR}/lib"
|
||||
NUT_RUN_DIR="@PIDPATH@/nut"
|
||||
CONFIG="@CONFPATH@/nut.conf"
|
||||
NUTUSER="@RUN_AS_USER@"
|
||||
NUTGROUP="@RUN_AS_GROUP@"
|
||||
|
||||
if [ -f "$CONFIG" ] ; then
|
||||
. "$CONFIG"
|
||||
fi
|
||||
|
||||
ups_start () {
|
||||
if [ "$MODE" = "none" ];then
|
||||
echo "No NUT mode set, not starting anything" >&2
|
||||
exit $SMF_EXIT_ERR_CONFIG
|
||||
fi
|
||||
|
||||
# Default rights inspired by NUT scripts/Solaris/postinstall.in
|
||||
mkdir -p "$NUT_RUN_DIR" && \
|
||||
chown "root:$NUTGROUP" "$NUT_RUN_DIR" && \
|
||||
chmod 770 "$NUT_RUN_DIR" \
|
||||
|| exit $SMF_EXIT_ERR_FATAL
|
||||
|
||||
LD_LIBRARY_PATH="${NUT_LIB_DIR}:$LD_LIBRARY_PATH" "${NUT_SBIN_DIR}"/upsmon #> /dev/null 2>&1
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
'start')
|
||||
ups_start
|
||||
;;
|
||||
|
||||
*)
|
||||
echo ""
|
||||
echo "Usage: '$0' {start}"
|
||||
echo ""
|
||||
exit $SMF_EXIT_ERR_CONFIG
|
||||
;;
|
||||
esac
|
||||
|
||||
exit $?
|
||||
64
scripts/Solaris/svc-nut-server.in
Executable file
64
scripts/Solaris/svc-nut-server.in
Executable file
|
|
@ -0,0 +1,64 @@
|
|||
#!/sbin/sh
|
||||
|
||||
# Trivial (better is yet to come) SMF method script to start nut services
|
||||
# Adapted for OpenIndiana userland from init.d script template in NUT sources
|
||||
# Adaptation copyright (C) 2016 Jim Klimov
|
||||
|
||||
if [ -z "$SMF_FMRI" ]; then
|
||||
echo "$0 must be called in SMF context!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# smf(5)
|
||||
. /lib/svc/share/smf_include.sh || exit
|
||||
|
||||
prefix="@prefix@"
|
||||
NUT_DIR="@prefix@"
|
||||
NUT_SBIN_DIR="$NUT_DIR/sbin"
|
||||
NUT_LIB_DIR="${NUT_DIR}/lib"
|
||||
NUT_RUN_DIR="@PIDPATH@/nut"
|
||||
CONFIG="@CONFPATH@/nut.conf"
|
||||
NUTUSER="@RUN_AS_USER@"
|
||||
NUTGROUP="@RUN_AS_GROUP@"
|
||||
|
||||
if [ -f "$CONFIG" ] ; then
|
||||
. "$CONFIG"
|
||||
fi
|
||||
|
||||
ups_start () {
|
||||
# Default rights inspired by NUT scripts/Solaris/postinstall.in
|
||||
mkdir -p "$NUT_RUN_DIR" && \
|
||||
chown "root:$NUTGROUP" "$NUT_RUN_DIR" && \
|
||||
chmod 770 "$NUT_RUN_DIR" \
|
||||
|| exit $SMF_EXIT_ERR_FATAL
|
||||
|
||||
if [ "$MODE" = "none" ];then
|
||||
echo "No NUT mode set, not starting anything" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$MODE" != "netclient" ] ; then
|
||||
# In this distribution, UPS drivers are wrapped by service instances
|
||||
#LD_LIBRARY_PATH="${NUT_LIB_DIR}:$LD_LIBRARY_PATH" "${NUT_SBIN_DIR}/upsdrvctl" start #> /dev/null 2>&1
|
||||
LD_LIBRARY_PATH="${NUT_LIB_DIR}:$LD_LIBRARY_PATH" "${NUT_SBIN_DIR}/upsd" #> /dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
'start')
|
||||
ups_start
|
||||
;;
|
||||
|
||||
'refresh'|'reload')
|
||||
LD_LIBRARY_PATH="${NUT_LIB_DIR}:$LD_LIBRARY_PATH" "${NUT_SBIN_DIR}/upsd" -c reload
|
||||
;;
|
||||
|
||||
*)
|
||||
echo ""
|
||||
echo "Usage: '$0' {start}"
|
||||
echo ""
|
||||
exit $SMF_EXIT_ERR_CONFIG
|
||||
;;
|
||||
esac
|
||||
|
||||
exit $?
|
||||
Loading…
Add table
Add a link
Reference in a new issue