(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LeftVar name:PIDDIR) rhs:{(/var/run/samba)} spids:[36])]
      spids: [36]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LeftVar name:SMBDPID)
          rhs: {($ VSub_Name "$PIDDIR") (/smbd.pid)}
          spids: [39]
        )
      ]
      spids: [39]
    )
    (C {(unset)} {(TMPDIR)})
    (AndOr children:[(C {(test)} {(-x)} {(/usr/sbin/smbd)})(C {(exit)} {(0)})] op_id:Op_DPipe)
    (C {(.)} {(/lib/lsb/init-functions)})
    (Case
      to_match: {($ VSub_Number "$1")}
      arms: [
        (case_arm
          pat_list: [{(start)}]
          action: 
            (CommandList
              children: [
                (If
                  arms: [
                    (if_arm
                      cond: (Sentence command:(C {(init_is_upstart)}) terminator:<Op_Semi ";">)
                      action: (C {(exit)} {(1)})
                      spids: [-1 89]
                    )
                  ]
                  spids: [-1 97]
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LeftVar name:SERVER_ROLE)
                      rhs: 
                        {
                          (CommandSubPart
                            command_list: 
                              (Pipeline
                                children: [
                                  (SimpleCommand
                                    words: [
                                      {(samba-tool)}
                                      {(testparm)}
                                      {(--parameter-name) (Lit_Other "=") (DQ ("server role"))}
                                    ]
                                    redirects: [
                                      (Redirect
                                        op_id: Redir_Great
                                        arg_word: {(/dev/null)}
                                        fd: 2
                                        spids: [112]
                                      )
                                    ]
                                  )
                                  (C {(tail)} {(-1)})
                                ]
                                negated: False
                              )
                            spids: [101 120]
                          )
                        }
                      spids: [100]
                    )
                  ]
                  spids: [100]
                )
                (If
                  arms: [
                    (if_arm
                      cond: 
                        (Sentence
                          command: 
                            (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$SERVER_ROLE"))} {(Lit_Other "=")} 
                              {(DQ ("active directory domain controller"))} {(Lit_Other "]")}
                            )
                          terminator: <Op_Semi ";">
                        )
                      action: (C {(exit)} {(0)})
                      spids: [-1 140]
                    )
                  ]
                  spids: [-1 148]
                )
                (C {(log_daemon_msg)} {(DQ ("Starting SMB/CIFS daemon"))} {(smbd)})
                (C {(install)} {(-o)} {(root)} {(-g)} {(root)} {(-m)} {(755)} {(-d)} {($ VSub_Name "$PIDDIR")})
                (If
                  arms: [
                    (if_arm
                      cond: 
                        (Sentence
                          command: 
                            (Pipeline
                              children: [
                                (C {(start-stop-daemon)} {(--start)} {(--quiet)} {(--oknodo)} {(--exec)} 
                                  {(/usr/sbin/smbd)} {(--)} {(-D)}
                                )
                              ]
                              negated: True
                            )
                          terminator: <Op_Semi ";">
                        )
                      action: (CommandList children:[(C {(log_end_msg)} {(1)})(C {(exit)} {(1)})])
                      spids: [-1 206]
                    )
                  ]
                  spids: [-1 219]
                )
                (C {(log_end_msg)} {(0)})
              ]
            )
          spids: [80 81 228 -1]
        )
        (case_arm
          pat_list: [{(stop)}]
          action: 
            (CommandList
              children: [
                (If
                  arms: [
                    (if_arm
                      cond: (Sentence command:(C {(init_is_upstart)}) terminator:<Op_Semi ";">)
                      action: (C {(exit)} {(0)})
                      spids: [-1 240]
                    )
                  ]
                  spids: [-1 248]
                )
                (C {(log_daemon_msg)} {(DQ ("Stopping SMB/CIFS daemon"))} {(smbd)})
                (C {(start-stop-daemon)} {(--stop)} {(--quiet)} {(--pidfile)} {($ VSub_Name "$SMBDPID")})
                (C {(sleep)} {(1)})
                (If
                  arms: [
                    (if_arm
                      cond: 
                        (AndOr
                          children: [
                            (C {(Lit_Other "[")} {(-f)} {($ VSub_Name "$SMBDPID")} {(Lit_Other "]")})
                            (Pipeline
                              children: [
                                (SimpleCommand
                                  words: [
                                    {(ps)}
                                    {(h)}
                                    {
                                      (CommandSubPart
                                        command_list: (C {(cat)} {($ VSub_Name "$SMBDPID")})
                                        spids: [300 304]
                                      )
                                    }
                                  ]
                                  redirects: [
                                    (Redirect
                                      op_id: Redir_Great
                                      arg_word: {(/dev/null)}
                                      fd: -1
                                      spids: [306]
                                    )
                                  ]
                                )
                              ]
                              negated: True
                            )
                          ]
                          op_id: Op_DAmp
                        )
                      action: (C {(rm)} {(-f)} {($ VSub_Name "$SMBDPID")})
                      spids: [-1 311]
                    )
                  ]
                  spids: [-1 329]
                )
                (C {(log_end_msg)} {(0)})
              ]
            )
          spids: [231 232 339 -1]
        )
        (case_arm
          pat_list: [{(reload)}]
          action: 
            (CommandList
              children: [
                (C {(log_daemon_msg)} {(DQ ("Reloading /etc/samba/smb.conf"))} {(smbd)})
                (C {(start-stop-daemon)} {(--stop)} {(--quiet)} {(--signal)} {(HUP)} {(--pidfile)} 
                  {($ VSub_Name "$SMBDPID")}
                )
                (C {(log_end_msg)} {(0)})
              ]
            )
          spids: [342 343 377 -1]
        )
        (case_arm
          pat_list: [{(restart)} {(force-reload)}]
          action: 
            (CommandList
              children: [
                (If
                  arms: [
                    (if_arm
                      cond: (Sentence command:(C {(init_is_upstart)}) terminator:<Op_Semi ";">)
                      action: (C {(exit)} {(1)})
                      spids: [-1 391]
                    )
                  ]
                  spids: [-1 399]
                )
                (C {($ VSub_Number "$0")} {(stop)})
                (C {(sleep)} {(1)})
                (C {($ VSub_Number "$0")} {(start)})
              ]
            )
          spids: [380 383 417 -1]
        )
        (case_arm
          pat_list: [{(status)}]
          action: 
            (CommandList
              children: [
                (C {(status_of_proc)} {(-p)} {($ VSub_Name "$SMBDPID")} {(/usr/sbin/smbd)} {(smbd)})
                (C {(exit)} {($ VSub_QMark "$?")})
              ]
            )
          spids: [420 421 440 -1]
        )
        (case_arm
          pat_list: [{(Lit_Other "*")}]
          action: 
            (CommandList
              children: [
                (C {(echo)} 
                  {(DQ ("Usage: /etc/init.d/smbd {start|stop|reload|restart|force-reload|status}"))}
                )
                (C {(exit)} {(1)})
              ]
            )
          spids: [443 444 459 -1]
        )
      ]
      spids: [73 77 461]
    )
    (C {(exit)} {(0)})
  ]
)