If samba fails to start for some reason, make this cause the startup event to fail...
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Mon, 9 May 2011 22:25:27 +0000 (08:25 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Mon, 9 May 2011 23:59:44 +0000 (09:59 +1000)
Or else this will leave samba not running.

CQ S1023394

config/events.d/50.samba

index a1f99fbb248cf7460ccd72d04a4721267e2def6f..184fb2fdbc3034bda27e013d5890874d83afd0ad 100755 (executable)
@@ -65,7 +65,11 @@ start_samba() {
 
        # start the winbind service
        [ "$CTDB_MANAGES_WINBIND" = "yes" ] && {
-               service "$CTDB_SERVICE_WINBIND" start
+               service "$CTDB_SERVICE_WINBIND" start || {
+                       echo failed to start winbind
+                       exit 1
+               }
+
        }
 
        # start Samba service. Start it reniced, as under very heavy load 
@@ -74,8 +78,15 @@ start_samba() {
        [ "$CTDB_MANAGES_SAMBA" = "yes" ] && {
                /usr/bin/net serverid wipe
 
-               nice_service "$CTDB_SERVICE_NMB" start
-               nice_service "$CTDB_SERVICE_SMB" start
+               nice_service "$CTDB_SERVICE_NMB" start || {
+                       echo failed to start nmbd
+                       exit 1
+               }
+
+               nice_service "$CTDB_SERVICE_SMB" start || {
+                       echo failed to start samba
+                       exit 1
+               }
        }
        return 0
 }