Uploaded image for project: 'CDH (READ-ONLY)'
  1. CDH (READ-ONLY)
  2. DISTRO-138

Exit consistently in init scripts for stop on stopped service

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: CDH3b4
    • Fix Version/s: CDH3u3
    • Component/s: Packaging
    • Labels:
      None
    • Environment:
      Ubuntu 10.04.2 and noticed with package:

      hadoop-zookeeper-server_3.3.1+10-1~lucid-cdh3b3_all.deb

      Description

      CDH init scripts exit with both 0 and 1 when calling stop on a stopped service. It's common to exit successful when stopping an already stopped service.

      LSB agrees with this: "In addition to straightforward success, the following situations are also to be considered successful: ... running stop on a service already stopped or not running"

      http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html

      root@node00:~/zookeeper# for file in /etc/init.d/hadoop-*; do $file stop 2>/dev/null >&2; printf "%50s %d\n" $file $?;done
                        /etc/init.d/hadoop-0.20-datanode 1
                      /etc/init.d/hadoop-0.20-jobtracker 1
                        /etc/init.d/hadoop-0.20-namenode 1
               /etc/init.d/hadoop-0.20-secondarynamenode 1
                     /etc/init.d/hadoop-0.20-tasktracker 1
                         /etc/init.d/hadoop-hbase-master 0
                   /etc/init.d/hadoop-hbase-regionserver 0
                     /etc/init.d/hadoop-zookeeper-server 1
      root@node00:~/zookeeper# for file in /etc/init.d/hadoop-*; do $file stop 2>/dev/null >&2; printf "%50s %d\n" $file $?;done
                        /etc/init.d/hadoop-0.20-datanode 1
                      /etc/init.d/hadoop-0.20-jobtracker 1
                        /etc/init.d/hadoop-0.20-namenode 1
               /etc/init.d/hadoop-0.20-secondarynamenode 1
                     /etc/init.d/hadoop-0.20-tasktracker 1
                         /etc/init.d/hadoop-hbase-master 0
                   /etc/init.d/hadoop-hbase-regionserver 0
                     /etc/init.d/hadoop-zookeeper-server 1
      

      http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html

        Attachments

          Activity

            People

            • Assignee:
              plinnell Peter Linnell
              Reporter:
              brock Brock Noland
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: