[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Pulp-list] puppet friendly install process (rc script patch)



ugh..

--- pulp-server    2012-02-24 11:34:11.000000000 -0800
+++ pulp-server.new    2012-02-24 23:31:54.065061046 -0800
@@ -30,16 +30,15 @@
     $SERVICE mongod start
     /usr/bin/pulp-migrate
     RETVAL=$?
-    [ $RETVAL = 0 ] && touch ${init_file}
+    if [ $RETVAL = 0 ]; then
+        touch ${init_file}
+        echo "Initialized Pulp database."
+    fi
     return $RETVAL
 }
 
 start() {
-    if [ ! -f $init_file ]; then
-        echo $"Pulp database not initialized, please run: $0 init"
-        RETVAL=2
-        return $RETVAL
-    fi
+    [ ! -f $init_file ] && init 
     $SERVICE mongod start || RETVAL=$?
     [ $RETVAL = 0 ] && $SERVICE qpidd start || RETVAL=$?
     [ $RETVAL = 0 ] && $SERVICE httpd start || RETVAL=$?




----- Original Message -----
> From: Ryan Bowlby <rbowlby83 yahoo com>
> To: "pulp-list redhat com" <pulp-list redhat com>
> Cc: 
> Sent: Sunday, February 26, 2012 5:51 PM
> Subject: [Pulp-list] puppet friendly install process (rc script patch)
> 
> 
> 
> Hi All,
> 
> I'm performing an initial Pulp install and decided to create a puppet module 
> at the same time. The install instructions call for running 
> "/etc/init.d/pulp init" before initial start. This is not very puppet 
> friendly and also doing so manually seems like a superfluous step. Instead, why 
> not just have the rc script perform this step if the init_file is not present? 
> I've created the below patch, as this would make the install process more 
> intuitive and the puppet module cleaner.
> 
> --- pulp-server    2012-02-24 11:34:11.000000000 -0800
> +++ pulp-server.new    2012-02-24 23:24:46.984969522 -0800
> @@ -30,16 +30,14 @@
>      $SERVICE mongod start
>      /usr/bin/pulp-migrate
>      RETVAL=$?
> -    [ $RETVAL = 0 ] && touch ${init_file}
> +    if [ $RETVAL = 0 ]; then
> +        touch ${init_file}
> +        echo "Initialized Pulp database."
>      return $RETVAL
>  }
>  
>  start() {
> -    if [ ! -f $init_file ]; then
> -        echo $"Pulp database not initialized, please run: $0 init"
> -        RETVAL=2
> -        return $RETVAL
> -    fi
> +    [ ! -f $init_file ] && init 
>      $SERVICE mongod start || RETVAL=$?
>      [ $RETVAL = 0 ] && $SERVICE qpidd start || RETVAL=$?
>      [ $RETVAL = 0 ] && $SERVICE httpd start || RETVAL=$?
> 
> 
> Thanks,
> Ryan Bowlby
> 
> _______________________________________________
> Pulp-list mailing list
> Pulp-list redhat com
> https://www.redhat.com/mailman/listinfo/pulp-list
> 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]