what do you mean pid 1 should exit right away? pid 1 is the init process and is the first and last process in the OS life cycle. All other processes run as child processes of init.
Ah, sorry, that was badly written. What I meant was that it looks like the shell script exits almost immediately, i.e. pid 1 forks the app process but then exits itself...
got it. The confusion then is spawning(no pun) from the assumption that pid 1 script forks while it doesn't. It calls a program and wait for it to exit. Only then pid 1 exits and the system shuts down.