packages: rpcbind/rpcbind.init, rpcbind/rpcbind.service, rpcbind/rpcbind.sp...

baggins baggins at pld-linux.org
Wed Jan 18 23:15:03 CET 2012


Author: baggins                      Date: Wed Jan 18 22:15:03 2012 GMT
Module: packages                      Tag: HEAD
---- Log message:
- added systemd package
- simplify sysconfig for compatibility with systemd (with trigger)

---- Files affected:
packages/rpcbind:
   rpcbind.init (1.2 -> 1.3) , rpcbind.service (1.1 -> 1.2) , rpcbind.spec (1.19 -> 1.20) , rpcbind.sysconfig (1.2 -> 1.3) 

---- Diffs:

================================================================
Index: packages/rpcbind/rpcbind.init
diff -u packages/rpcbind/rpcbind.init:1.2 packages/rpcbind/rpcbind.init:1.3
--- packages/rpcbind/rpcbind.init:1.2	Tue May  8 14:55:37 2007
+++ packages/rpcbind/rpcbind.init	Wed Jan 18 23:14:58 2012
@@ -33,14 +33,8 @@
 start() {
 	# Check if the service is already running?
 	if [ ! -f /var/lock/subsys/rpcbind ]; then
-		is_no "${RPCBIND_VERBOSE}" || RPCBIND_OPTIONS="${RPCBIND_OPTIONS} -l"
-		is_yes "${RPCBIND_INSECURE}" && RPCBIND_OPTIONS="${RPCBIND_OPTIONS} -i"
-		[ -z "${RPCBIND_ADDRESSES}" ] || \
-			for a in $RPCBIND_ADDRESSES ; do
-				RPCBIND_OPTIONS="${RPCBIND_OPTIONS} -h $a"
-			done
 		msg_starting rpcbind
-		daemon rpcbind ${RPCBIND_OPTIONS}
+		daemon rpcbind -w $RPCBIND_OPTIONS
 		RETVAL=$?
 		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/rpcbind
 	else
@@ -62,7 +56,6 @@
 # See how we were called.
 case "$1" in
   start)
-	RPCBIND_OPTIONS=
   	start
 	;;
   stop)
@@ -70,12 +63,10 @@
 	;;
   cleanup)
 	stop
-	RPCBIND_OPTIONS=
 	start
 	;;
   restart|force-reload)
 	stop
-	RPCBIND_OPTIONS="-w"
 	start
 	;;
   status)

================================================================
Index: packages/rpcbind/rpcbind.service
diff -u packages/rpcbind/rpcbind.service:1.1 packages/rpcbind/rpcbind.service:1.2
--- packages/rpcbind/rpcbind.service:1.1	Wed Jan 18 20:27:16 2012
+++ packages/rpcbind/rpcbind.service	Wed Jan 18 23:14:58 2012
@@ -5,7 +5,8 @@
 
 [Service]
 Type=forking
-ExecStart=/sbin/rpcbind -w
+EnvironmentFile=-/etc/sysconfig/rpcbind
+ExecStart=/sbin/rpcbind -w $RPCBIND_OPTIONS
 
 [Install]
 WantedBy=multi-user.target

================================================================
Index: packages/rpcbind/rpcbind.spec
diff -u packages/rpcbind/rpcbind.spec:1.19 packages/rpcbind/rpcbind.spec:1.20
--- packages/rpcbind/rpcbind.spec:1.19	Mon Sep 27 11:22:50 2010
+++ packages/rpcbind/rpcbind.spec	Wed Jan 18 23:14:58 2012
@@ -3,13 +3,15 @@
 Summary(pl.UTF-8):	Demon odwzorowujący adresy uniwersalne na numery programów RPC
 Name:		rpcbind
 Version:	0.2.0
-Release:	3
+Release:	3.1
 License:	GPL
 Group:		Daemons
 Source0:	http://dl.sourceforge.net/rpcbind/%{name}-%{version}.tar.bz2
 # Source0-md5:	1a77ddb1aaea8099ab19c351eeb26316
 Source1:	%{name}.init
 Source2:	%{name}.sysconfig
+Source3:	%{name}.service
+Source4:	%{name}.socket
 Patch0:		%{name}-libwrap.patch
 Patch1:		%{name}-syslog.patch
 Patch2:		%{name}-sunrpc.patch
@@ -24,7 +26,7 @@
 BuildRequires:	libtirpc-devel >= 1:0.1.10
 BuildRequires:	libtool
 BuildRequires:	libwrap-devel
-BuildRequires:	rpmbuild(macros) >= 1.228
+BuildRequires:	rpmbuild(macros) >= 1.623
 Requires(post,preun):	/sbin/chkconfig
 Requires:	/sbin/chkconfig
 Requires:	rc-scripts >= 0.4.1.6
@@ -47,6 +49,20 @@
 adresy uniwersalne. Musi działać na maszynie, aby można było wykonywać
 wywołania RPC na serwerze na tej maszynie.
 
+%package systemd
+Summary:	systemd units for rpcbind
+Summary(pl.UTF-8):	Jednostki systemd dla demona rpcbind
+Group:		Daemons
+Requires:	%{name} = %{version}-%{release}
+Requires:	systemd
+Requires:	systemd-units
+
+%description systemd
+systemd units for rpcbind.
+
+%description systemd -l pl.UTF-8
+Jednostki systemd dla demona rpcbind.
+
 %prep
 %setup -q
 %patch0 -p1
@@ -73,7 +89,7 @@
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{/sbin,%{_sbindir},/etc/{sysconfig,rc.d/init.d}} \
-	$RPM_BUILD_ROOT{%{_mandir}/man8,%{_var}/lib/%{name}}
+	$RPM_BUILD_ROOT{%{_mandir}/man8,%{_var}/lib/%{name},%{systemdunitdir}}
 
 install src/rpcbind $RPM_BUILD_ROOT/sbin
 install src/rpcinfo $RPM_BUILD_ROOT%{_sbindir}
@@ -83,6 +99,9 @@
 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/rpcbind
 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/rpcbind
 
+install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/rpcbind.service
+install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/rpcbind.socket
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -104,6 +123,28 @@
 	/sbin/chkconfig --del rpcbind
 fi
 
+%post systemd
+%systemd_post rpcbind.service
+
+%preun systemd
+%systemd_preun rpcbind.service
+
+%postun systemd
+%systemd_reload
+
+%triggerpostun -- %{name} < 0.2.0-4
+if [ -f /etc/sysconfig/rpcbind ]; then
+	. /etc/sysconfig/rpcbind
+	[ "$RPCBIND_VERBOSE" == "no" ] || RPCBIND_OPTIONS="-l"
+	[ "$RPCBIND_INSECURE" == "yes" ] && RPCBIND_OPTIONS="$RPCBIND_OPTIONS -i"
+	for a in $RPCBIND_ADDRESSES ; do
+		RPCBIND_OPTIONS="$RPCBIND_OPTIONS -h $a"
+	done
+	[ -z "$RPCBIND_OPTIONS" ] && exit 0
+	cp -f /etc/sysconfig/rpcbind /etc/sysconfig/rpcbind.rpmsave
+	echo "RPCBIND_OPTIONS=\"$RPCBIND_OPTIONS\"" >> /etc/sysconfig/rpcbind
+fi
+
 %files
 %defattr(644,root,root,755)
 %doc AUTHORS ChangeLog NEWS README
@@ -114,12 +155,21 @@
 %{_mandir}/man8/*.8*
 %dir %attr(700,rpc,root) %{_var}/lib/%{name}
 
+%files systemd
+%defattr(644,root,root,755)
+%{systemdunitdir}/rpcbind.service
+%{systemdunitdir}/rpcbind.socket
+
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
 * %{date} PLD Team <feedback at pld-linux.org>
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.20  2012/01/18 22:14:58  baggins
+- added systemd package
+- simplify sysconfig for compatibility with systemd (with trigger)
+
 Revision 1.19  2010/09/27 09:22:50  baggins
 - rel 3
 - make '-h' option work for both UDP and TCP sockets

================================================================
Index: packages/rpcbind/rpcbind.sysconfig
diff -u packages/rpcbind/rpcbind.sysconfig:1.2 packages/rpcbind/rpcbind.sysconfig:1.3
--- packages/rpcbind/rpcbind.sysconfig:1.2	Tue May  8 14:55:37 2007
+++ packages/rpcbind/rpcbind.sysconfig	Wed Jan 18 23:14:58 2012
@@ -1,11 +1,6 @@
 # Set nice level for rpcbind
 SERVICE_RUN_NICE_LEVEL="+1"
 
-# Turn on libwrap connection logging
-RPCBIND_VERBOSE="yes"
-
-# "Insecure" mode.  Allow calls to SET and UNSET from any host
-RPCBIND_INSECURE="no"
-
-# Specify specific IP addresses to bind to for UDP requests
-#RPCBIND_ADDRESSES="10.1.0.1"
+# Options for rpcbind daemon, be verbose by default
+#RPCBIND_OPTIONS="-l -h 10.1.0.1"
+RPCBIND_OPTIONS="-l"
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/rpcbind/rpcbind.init?r1=1.2&r2=1.3&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/rpcbind/rpcbind.service?r1=1.1&r2=1.2&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/rpcbind/rpcbind.spec?r1=1.19&r2=1.20&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/rpcbind/rpcbind.sysconfig?r1=1.2&r2=1.3&f=u



More information about the pld-cvs-commit mailing list