-3

the following short bash program described how to execute the func1 by process ( func1 & )

func1 is function that do some tests and verification on Linux machines

And this program run after reboot from /etc/rc3.d

I want to ask if it possible to create from func1 a process in spite this bash script will ended immediately after process creation? And if this action is illegal?

and if this not illegal please advice about other option ?

I ask this question because after reboot process not created from func1 And I don't know why maybe because this process created before program ended ?

remark – if I run this bash script from console ( without reboot ) then process created without problems

bash script program:

 #!/bin/bash 

 func1 ()
 {
   .
   .
      do something 
   .
   .
 }
 func1 &
Cédric Julien
  • 391
  • 6
  • 12
yael
  • 2,433
  • 5
  • 31
  • 43

1 Answers1

1

There is no general reason why what you are trying to do won't work. You will have to just knuckle down and start debugging the script. Try adding some debug messages to your func1() and capture the output like so

func1 &>/tmp/func1.out &

If that doesn't provide any information then expand the scope of your messages and redirects.

user9517
  • 115,471
  • 20
  • 215
  • 297