Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: c3549bf1c5e38ee007f8b19f6a9a0bed0f696b01
Ticket: 218180ffffffffffffffffffffffffffffffffff
bug on exec command
User & Date: nobody on 2000-10-26 00:54:12
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 2331 Bug
    Version: 8.1
    SubmitDate: '1999-07-06'
    LastModified: '1999-12-03'
    Severity: MED
    Status: Closed
    Submitter: techsupp
    ChangedBy: hobbs
    OS: Solaris
    OSVersion: SunOS iplannet 5.5.1 Generic_103640-12 sun4u sparc SUNW,Ultra-2
    Machine: Other
    FixedDate: '2000-10-25'
    ClosedDate: '1999-12-03'
    
    
    Name:
    Alberto Franco de Sa Ribeiro
    
    Extensions:
    scotty
    
    CustomShell:
    tcl core configured with --prefix=/opt/SCRtcl
    
    ReproducibleScript:
    When I start a daemon (PostgreSQL) on a script file, it never finish. The
    same exec works when I try to use in a interactive shell.
    My script:
    
    #!/opt/SCRtcl/bin/tclsh
    
    set env(PGLIB) /opt/PostgreSQL/lib
    set env(PGDATA) /opt/PostgreSQL/data
    
    switch -exact [lindex $argv 0] {
       start {
           if {! [catch { exec su pgsql -c  "/opt/PostgreSQL/bin/postmaster -b /opt/PostgreSQL/bin/postgres -D
                    /opt/PostgreSQL/data -S -o -e" }]} {
               puts "PostgreSQL iniciado corretamente"
           } else {
               puts "Falha na inicializacao do PostgreSQL"
           }
           # Bug do tcl: processos em background impedem shell de terminar
           exec kill -HUP [pid]
       }
       stop  {
           if [catch {set l1 [split [exec /usr/ucb/ps -aux | /usr/bin/grep "^pgsql"] \n]}] {
               puts "Nao foi encontrado nenhum processo do usuario pgsql"
           } else {
               foreach l $l1 {
                   set pid [lindex [split $l] 5]
                   if {! [catch {exec kill -INT $pid}]} {
                       puts "Enviado sinal INT ao pid $pid"
                   }
               }
           }
       }
       default {
           puts "utilize: $argv0 (start|stop)"
       }
    }
    # end of script
    
    PS: tkined is also not finishing.
    
    DesiredBehavior:
    scripts finishing when there are no more commands
    
    
    
    The user should verify that the same commands are really being
    called.  In an interactive shell, the 'unknown' command will kick
    in when something is not recognized.  The behavior is different
    in a standard script. 
    -- 12/03/1999 hobbs
    
  4. foundin changed to: "obsolete: 8.1"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "60. NRE and coroutines"
  10. title changed to: "bug on exec command"
  11. type changed to: "Bug"