[Techtalk] check if script parent process is "init"

Dominik Schramm dominik.schramm at gmxpro.net
Tue Apr 13 14:15:15 EST 2004


Hi list,

I'd like to check in a Bash script if it is being run by init,
i.e. directly upon system startup, and not interactively
or from another process -- say, cron.

I tried with looking at $PPID, but this variable seems undefined
when init started the script. This makes me really sad because
it would be such an elegant solution.

Is there another way than interpreting the ps output?

regards,
dominik

_______________________________________________
Programming mailing list
Programming at linuxchix.org
http://mailman.linuxchix.org/mailman/listinfo/programming




More information about the Techtalk mailing list