[pve-devel] r5914 - in dab/trunk: . scripts

svn-commits at proxmox.com svn-commits at proxmox.com
Fri May 6 08:30:32 CEST 2011


Author: dietmar
Date: 2011-05-06 08:30:32 +0200 (Fri, 06 May 2011)
New Revision: 5914

Modified:
   dab/trunk/DAB.pm
   dab/trunk/Makefile
   dab/trunk/changelog.Debian
   dab/trunk/scripts/mysql_randompw
   dab/trunk/scripts/ssh_gen_host_keys
Log:
support insserv


Modified: dab/trunk/DAB.pm
===================================================================
--- dab/trunk/DAB.pm	2011-05-06 06:22:24 UTC (rev 5913)
+++ dab/trunk/DAB.pm	2011-05-06 06:30:32 UTC (rev 5914)
@@ -1154,12 +1154,18 @@
 sub install_init_script {
     my ($self, $script, $runlevel, $prio) = @_;
 
+    my $suite = $self->{config}->{suite};
     my $rootdir = $self->vz_root_dir();
 
     my $base = basename ($script);
     my $target = "$rootdir/etc/init.d/$base";
+
     $self->run_command ("install -m 0755 '$script' '$target'");
-    $self->ve_command ("update-rc.d $base start $prio $runlevel .");
+    if ($suite eq 'etch' || $suite eq 'lenny') {
+	$self->ve_command ("update-rc.d $base start $prio $runlevel .");
+    } else {
+	$self->ve_command ("insserv $base");
+    }
 
     return $target;
 }

Modified: dab/trunk/Makefile
===================================================================
--- dab/trunk/Makefile	2011-05-06 06:22:24 UTC (rev 5913)
+++ dab/trunk/Makefile	2011-05-06 06:30:32 UTC (rev 5914)
@@ -1,6 +1,6 @@
 VERSION=1.1
 PACKAGE=dab
-PKGREL=12
+PKGREL=13
 
 
 SCRIPTS=        				\

Modified: dab/trunk/changelog.Debian
===================================================================
--- dab/trunk/changelog.Debian	2011-05-06 06:22:24 UTC (rev 5913)
+++ dab/trunk/changelog.Debian	2011-05-06 06:30:32 UTC (rev 5914)
@@ -1,3 +1,9 @@
+dab (1.1-13) unstable; urgency=low
+
+  * use insserv instead of update-rc.d (for newer versions)
+
+ -- Proxmox Support Team <support at proxmox.com>  Fri, 06 May 2011 06:59:25 +0200
+
 dab (1.1-12) unstable; urgency=low
 
   * use UPASSWD instead of PASSWD inside shell scripts (avoid problems

Modified: dab/trunk/scripts/mysql_randompw
===================================================================
--- dab/trunk/scripts/mysql_randompw	2011-05-06 06:22:24 UTC (rev 5913)
+++ dab/trunk/scripts/mysql_randompw	2011-05-06 06:30:32 UTC (rev 5914)
@@ -1,9 +1,9 @@
 #!/bin/sh
 ### BEGIN INIT INFO
 # Provides:          mysql_randompw
-# Required-Start:    $local_fs
+# Required-Start:    $local_fs mysql
 # Required-Stop:
-# X-Start-Before:    mysql
+# X-Start-Before:
 # Default-Start:     2
 # Default-Stop:
 # Short-Description: Generate random MySQL root password
@@ -18,6 +18,8 @@
     exit 0;
 fi
 
+echo "Generate random MySQL root password"
+
 # set HOME dir (for .my.cfg)
 export HOME=/root
 export USER=root
@@ -33,5 +35,10 @@
 
 chmod 0600 /root/.my.cnf
 
-rm -f /etc/init.d/mysql_randompw
-update-rc.d -f mysql_randompw remove
+if [ -x /sbin/insserv ] ; then
+    /sbin/insserv -r mysql_randompw
+    rm -f /etc/init.d/mysql_randompw
+else
+    rm -f /etc/init.d/mysql_randompw
+    update-rc.d -f mysql_randompw remove
+fi

Modified: dab/trunk/scripts/ssh_gen_host_keys
===================================================================
--- dab/trunk/scripts/ssh_gen_host_keys	2011-05-06 06:22:24 UTC (rev 5913)
+++ dab/trunk/scripts/ssh_gen_host_keys	2011-05-06 06:30:32 UTC (rev 5914)
@@ -26,6 +26,10 @@
 rm -f /etc/ssh/ssh_host_dsa_key
 ssh-keygen -q -f /etc/ssh/ssh_host_dsa_key -t dsa -N ''
 
-rm -f /etc/init.d/ssh_gen_host_keys
-update-rc.d -f ssh_gen_host_keys remove
-
+if [ -x /sbin/insserv ] ; then
+    /sbin/insserv -r ssh_gen_host_keys
+    rm -f /etc/init.d/ssh_gen_host_keys
+else
+    rm -f /etc/init.d/ssh_gen_host_keys
+    update-rc.d -f ssh_gen_host_keys remove
+fi




More information about the pve-devel mailing list