[pve-devel] r6198 - in pve-manager/pve2: . bin bin/init.d

svn-commits at proxmox.com svn-commits at proxmox.com
Wed Jun 29 09:35:14 CEST 2011


Author: dietmar
Date: 2011-06-29 09:35:14 +0200 (Wed, 29 Jun 2011)
New Revision: 6198

Removed:
   pve-manager/pve2/bin/pvesetup
Modified:
   pve-manager/pve2/ChangeLog
   pve-manager/pve2/bin/Makefile.am
   pve-manager/pve2/bin/Makefile.in
   pve-manager/pve2/bin/init.d/pvenetcommit
Log:
remove pvesetup


Modified: pve-manager/pve2/ChangeLog
===================================================================
--- pve-manager/pve2/ChangeLog	2011-06-29 06:59:01 UTC (rev 6197)
+++ pve-manager/pve2/ChangeLog	2011-06-29 07:35:14 UTC (rev 6198)
@@ -1,5 +1,10 @@
 2011-06-29  Proxmox Support Team  <support at proxmox.com>
 
+	* bin/init.d/pvenetcommit: moved functionality from pvesetup
+	skript
+
+	* bin/Makefile.am (bin_SCRIPTS): remove pvesetup skript
+
 	* debian/postinst: add dpkg-trigger support (restart daemons when
 	used libraries changes)
 

Modified: pve-manager/pve2/bin/Makefile.am
===================================================================
--- pve-manager/pve2/bin/Makefile.am	2011-06-29 06:59:01 UTC (rev 6197)
+++ pve-manager/pve2/bin/Makefile.am	2011-06-29 07:35:14 UTC (rev 6198)
@@ -9,7 +9,6 @@
 	pvebanner		\
 	pvectl			\
 	pvedaemon		\
-	pvesetup		\
 	pveversion		\
 	pveperf
 

Modified: pve-manager/pve2/bin/Makefile.in
===================================================================
--- pve-manager/pve2/bin/Makefile.in	2011-06-29 06:59:01 UTC (rev 6197)
+++ pve-manager/pve2/bin/Makefile.in	2011-06-29 07:35:14 UTC (rev 6198)
@@ -222,7 +222,6 @@
 	pvebanner		\
 	pvectl			\
 	pvedaemon		\
-	pvesetup		\
 	pveversion		\
 	pveperf
 

Modified: pve-manager/pve2/bin/init.d/pvenetcommit
===================================================================
--- pve-manager/pve2/bin/init.d/pvenetcommit	2011-06-29 06:59:01 UTC (rev 6197)
+++ pve-manager/pve2/bin/init.d/pvenetcommit	2011-06-29 07:35:14 UTC (rev 6198)
@@ -9,13 +9,25 @@
 # Short-Description: commits network changes
 ### END INIT INFO
 
+set -e
+
 . /lib/lsb/init-functions
 
-PATH=/sbin:/bin:/usr/bin:/usr/sbin
+PATH=/sbin:/bin
 
+IFFN=/etc/network/interfaces
+
+# we cant use perl here, because this skript runs before
+# we have /usr mounted
+
 case "$1" in
     start)
-	pvesetup --init
+	if test -f "${IFFN}.new"; then
+	    echo "committing new network configuration";
+	    if ! mv "${IFFN}.new" $IFFN; then
+		echo "unable to commit changes to '${IFFN}' - $!\n";
+	    fi
+	fi
 	;;
     stop|restart|force-reload)
 	exit 0

Deleted: pve-manager/pve2/bin/pvesetup
===================================================================
--- pve-manager/pve2/bin/pvesetup	2011-06-29 06:59:01 UTC (rev 6197)
+++ pve-manager/pve2/bin/pvesetup	2011-06-29 07:35:14 UTC (rev 6198)
@@ -1,39 +0,0 @@
-#!/usr/bin/perl -w
-
-use strict;
-use Getopt::Long;
-
-sub print_usage {
-    my $msg = shift;
-
-    print STDERR "ERROR: $msg\n" if $msg;
-    print STDERR "USAGE: pvesetup --init  # sync network config\n";
-
-}
-
-my $opt_init;
-
-if (!GetOptions ('init' => \$opt_init)) {
-    print_usage ();
-    exit (-1);
-} 
-
-if (scalar (@ARGV) != 0) {
-    print_usage ();
-    exit (-1);
-}
-
-exit (0) if !$opt_init; # do nothing
-
-my $iffn = "/etc/network/interfaces";
-
-if (-f "$iffn.new") {
-    print "committing new network configuration\n";
-    if (system ("mv '$iffn.new' '$iffn'") != 0) {
-	print STDERR "unable to commit changes to '$iffn' - $!\n";
-    }
-}
-
-exit (0);
-
-




More information about the pve-devel mailing list