- make init script lsb compliant (#528016)

This commit is contained in:
Michal Hlavinka 2009-10-09 09:02:25 +00:00
parent 33812affd2
commit 9cd7b15c03
3 changed files with 35 additions and 15 deletions

View File

@ -2,7 +2,7 @@
# smartmontools init file for smartd # smartmontools init file for smartd
# Copyright (C) 2002-4 Bruce Allen <smartmontools-support@lists.sourceforge.net> # Copyright (C) 2002-4 Bruce Allen <smartmontools-support@lists.sourceforge.net>
# $Id: smartd.initd,v 1.7 2008/05/12 10:17:58 tsmetana Exp $ # $Id: smartd.initd,v 1.8 2009/10/09 09:02:24 mhlavink Exp $
# For RedHat and cousins: # For RedHat and cousins:
# chkconfig: - 99 01 # chkconfig: - 99 01
@ -46,9 +46,13 @@ SMARTD_BIN=/usr/sbin/smartd
RETVAL=0 RETVAL=0
prog=smartd prog=smartd
pidfile=/var/lock/subsys/smartd pidfile=/var/lock/subsys/smartd
config=/etc/smartd.conf
start() start()
{ {
[ $UID -eq 0 ] || exit 4
[ -x $SMARTD_BIN ] || exit 5
[ -f $config ] || exit 6
echo -n $"Starting $prog: " echo -n $"Starting $prog: "
daemon $SMARTD_BIN $smartd_opts daemon $SMARTD_BIN $smartd_opts
RETVAL=$? RETVAL=$?
@ -59,6 +63,7 @@ start()
stop() stop()
{ {
[ $UID -eq 0 ] || exit 4
echo -n $"Shutting down $prog: " echo -n $"Shutting down $prog: "
killproc $SMARTD_BIN killproc $SMARTD_BIN
RETVAL=$? RETVAL=$?
@ -102,7 +107,7 @@ case "$1" in
stop stop
start start
;; ;;
try-restart) condrestart|try-restart)
if [ -f $pidfile ]; then if [ -f $pidfile ]; then
stop stop
start start
@ -116,8 +121,9 @@ case "$1" in
RETVAL=$? RETVAL=$?
;; ;;
*) *)
echo $"Usage: $0 {start|stop|reload|force-reload|report|restart|try-restart|status}" echo $"Usage: $0 {start|stop|restart|status|condrestart|try-restart|reload|force-reload|report}"
RETVAL=3 RETVAL=2
[ $1 = 'usage' ] && RETVAL=0
esac esac
exit $RETVAL exit $RETVAL

View File

@ -1,6 +1,6 @@
diff -up smartmontools-5.38/configure.in.lowcap smartmontools-5.38/configure.in diff -up smartmontools-5.38/configure.in.lowcap smartmontools-5.38/configure.in
--- smartmontools-5.38/configure.in.lowcap 2009-10-05 15:45:16.419171091 +0200 --- smartmontools-5.38/configure.in.lowcap 2009-10-09 10:19:22.395700024 +0200
+++ smartmontools-5.38/configure.in 2009-10-05 15:45:16.425170899 +0200 +++ smartmontools-5.38/configure.in 2009-10-09 10:19:22.431698988 +0200
@@ -143,6 +143,40 @@ if test "$with_selinux" = "yes"; then @@ -143,6 +143,40 @@ if test "$with_selinux" = "yes"; then
AC_DEFINE(WITH_SELINUX, [1], [Define to 1 if SELinux support is enabled]) AC_DEFINE(WITH_SELINUX, [1], [Define to 1 if SELinux support is enabled])
fi fi
@ -44,7 +44,7 @@ diff -up smartmontools-5.38/configure.in.lowcap smartmontools-5.38/configure.in
if test "$mandir" = '${prefix}/man'; then if test "$mandir" = '${prefix}/man'; then
diff -up smartmontools-5.38/Makefile.am.lowcap smartmontools-5.38/Makefile.am diff -up smartmontools-5.38/Makefile.am.lowcap smartmontools-5.38/Makefile.am
--- smartmontools-5.38/Makefile.am.lowcap 2007-04-01 18:49:44.000000000 +0200 --- smartmontools-5.38/Makefile.am.lowcap 2007-04-01 18:49:44.000000000 +0200
+++ smartmontools-5.38/Makefile.am 2009-10-05 15:45:16.426170991 +0200 +++ smartmontools-5.38/Makefile.am 2009-10-09 10:19:22.434699065 +0200
@@ -35,7 +35,7 @@ smartd_SOURCES = smartd.cpp \ @@ -35,7 +35,7 @@ smartd_SOURCES = smartd.cpp \
utility.cpp \ utility.cpp \
utility.h utility.h
@ -56,7 +56,7 @@ diff -up smartmontools-5.38/Makefile.am.lowcap smartmontools-5.38/Makefile.am
EXTRA_smartd_SOURCES = os_darwin.cpp \ EXTRA_smartd_SOURCES = os_darwin.cpp \
diff -up smartmontools-5.38/smartd.8.in.lowcap smartmontools-5.38/smartd.8.in diff -up smartmontools-5.38/smartd.8.in.lowcap smartmontools-5.38/smartd.8.in
--- smartmontools-5.38/smartd.8.in.lowcap 2008-03-04 23:09:47.000000000 +0100 --- smartmontools-5.38/smartd.8.in.lowcap 2008-03-04 23:09:47.000000000 +0100
+++ smartmontools-5.38/smartd.8.in 2009-10-05 15:46:16.711483245 +0200 +++ smartmontools-5.38/smartd.8.in 2009-10-09 10:19:22.439699030 +0200
@@ -145,6 +145,12 @@ input. This is useful for commands like: @@ -145,6 +145,12 @@ input. This is useful for commands like:
to perform quick and simple checks without a configuration file. to perform quick and simple checks without a configuration file.
@ -71,8 +71,8 @@ diff -up smartmontools-5.38/smartd.8.in.lowcap smartmontools-5.38/smartd.8.in
Runs \fBsmartd\fP in "debug" mode. In this mode, it displays status Runs \fBsmartd\fP in "debug" mode. In this mode, it displays status
information to STDOUT rather than logging it to SYSLOG and does not information to STDOUT rather than logging it to SYSLOG and does not
diff -up smartmontools-5.38/smartd.cpp.lowcap smartmontools-5.38/smartd.cpp diff -up smartmontools-5.38/smartd.cpp.lowcap smartmontools-5.38/smartd.cpp
--- smartmontools-5.38/smartd.cpp.lowcap 2009-10-05 15:45:16.412170973 +0200 --- smartmontools-5.38/smartd.cpp.lowcap 2009-10-09 10:19:22.312699527 +0200
+++ smartmontools-5.38/smartd.cpp 2009-10-05 15:45:16.434170827 +0200 +++ smartmontools-5.38/smartd.cpp 2009-10-09 10:43:45.294698988 +0200
@@ -74,6 +74,10 @@ extern "C" int __stdcall FreeConsole(voi @@ -74,6 +74,10 @@ extern "C" int __stdcall FreeConsole(voi
#include <io.h> // setmode() #include <io.h> // setmode()
#endif // __CYGWIN__ #endif // __CYGWIN__
@ -134,15 +134,26 @@ diff -up smartmontools-5.38/smartd.cpp.lowcap smartmontools-5.38/smartd.cpp
PrintOut(LOG_INFO," -V Print License, Copyright, and version information\n"); PrintOut(LOG_INFO," -V Print License, Copyright, and version information\n");
#endif #endif
} }
@@ -3890,6 +3916,7 @@ void ParseOpts(int argc, char **argv){ @@ -3866,7 +3892,7 @@ void ParseOpts(int argc, char **argv){
char *tailptr;
long lchecktime;
// Please update GetValidArgList() if you edit shortopts
- const char *shortopts = "c:l:q:dDni:p:r:Vh?";
+ const char *shortopts = "c:l:q:dDni:p:r:VCh?";
#ifdef HAVE_GETOPT_LONG
char *arg;
// Please update GetValidArgList() if you edit longopts
@@ -3890,6 +3916,9 @@ void ParseOpts(int argc, char **argv){
{ "copyright", no_argument, 0, 'V' }, { "copyright", no_argument, 0, 'V' },
{ "help", no_argument, 0, 'h' }, { "help", no_argument, 0, 'h' },
{ "usage", no_argument, 0, 'h' }, { "usage", no_argument, 0, 'h' },
+#ifdef HAVE_LIBCAP_NG
+ { "usecapabilities",no_argument, 0, 'C' }, + { "usecapabilities",no_argument, 0, 'C' },
+#endif
{ 0, 0, 0, 0 } { 0, 0, 0, 0 }
}; };
#endif #endif
@@ -4030,6 +4057,12 @@ void ParseOpts(int argc, char **argv){ @@ -4030,6 +4059,12 @@ void ParseOpts(int argc, char **argv){
PrintCopyleft(); PrintCopyleft();
EXIT(0); EXIT(0);
break; break;
@ -155,7 +166,7 @@ diff -up smartmontools-5.38/smartd.cpp.lowcap smartmontools-5.38/smartd.cpp
case 'h': case 'h':
// help: print summary of command-line options // help: print summary of command-line options
debugmode=1; debugmode=1;
@@ -4408,6 +4441,16 @@ static int smartd_main(int argc, char ** @@ -4408,6 +4443,16 @@ static int smartd_main(int argc, char **
// don't exit on bad checksums // don't exit on bad checksums
con->checksumfail=0; con->checksumfail=0;
@ -172,7 +183,7 @@ diff -up smartmontools-5.38/smartd.cpp.lowcap smartmontools-5.38/smartd.cpp
// the main loop of the code // the main loop of the code
while (1){ while (1){
@@ -4482,7 +4525,15 @@ static int smartd_main(int argc, char ** @@ -4482,7 +4527,15 @@ static int smartd_main(int argc, char **
PrintTestSchedule(ATAandSCSIdevlist); PrintTestSchedule(ATAandSCSIdevlist);
EXIT(0); EXIT(0);
} }

View File

@ -1,7 +1,7 @@
Summary: Tools for monitoring SMART capable hard disks Summary: Tools for monitoring SMART capable hard disks
Name: smartmontools Name: smartmontools
Version: 5.38 Version: 5.38
Release: 18%{?dist} Release: 19%{?dist}
Epoch: 1 Epoch: 1
Group: System Environment/Base Group: System Environment/Base
License: GPLv2+ License: GPLv2+
@ -79,6 +79,9 @@ fi
%config(noreplace) %{_sysconfdir}/sysconfig/smartmontools %config(noreplace) %{_sysconfdir}/sysconfig/smartmontools
%changelog %changelog
* Fri Oct 09 2009 Michal Hlavinka <mhlavink@redhat.com> - 1:5.38-19
- make init script lsb compliant (#528016)
* Mon Oct 05 2009 Michal Hlavinka <mhlavink@redhat.com> - 1:5.38-18 * Mon Oct 05 2009 Michal Hlavinka <mhlavink@redhat.com> - 1:5.38-18
- bump release for rebuild - bump release for rebuild