Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Starting daemons z/OS UNIX System Services Planning GA32-0884-00 |
|
Daemons can be started by JCL and also by the shell. Some daemons such as inetd can also be started by the shell. Interactive login shells, shell scripts run as background jobs from a login shell, and batch jobs using BPXBATCH to run the shell all can start daemons. BPXBATSL is provided as an alias for BPXBATCH. BPXBATSL performs a local spawn but does not require the resetting of environment variables. BPXBATSL behaves exactly like BPXBATCH, and allows local spawning whether the current environment is set up or not. Many daemons can be started from the shell, both interactively and from shell scripts. In general, processes started from the shell complete (either successfully or with some error) before the parent shell itself exits. Any processes still running receive a SIGHUP signal when the parent shell exits. The default action for SIGHUP is to terminate the process. That is, when the shell exits, the system terminates all running processes started by the shell. Daemon processes are long-running and generally must continue to run even after the invoking shell terminates. Those daemons started using the shell are therefore written to ignore SIGHUP signals. They are also typically written to return control to the shell immediately. If they did not return, the shell script would wait forever for the daemon to exit. Rules:
A shell script that starts a more simple daemon called slowpoke that
does not return control immediately to the shell would look like this:
In summary, a shell script that starts the syslogd and cron daemons
would look like the following:
Although cron and syslogd return
immediately and protect themselves from SIGHUP, the & is included
with syslogd because this is the only method of getting
_BPX_JOBNAME to take effect. |
Copyright IBM Corporation 1990, 2014
|