ADSM-L

starting dsmc at boot time (our workaround)

1994-06-20 17:43:03
Subject: starting dsmc at boot time (our workaround)
From: Christian Finger <Christian.Finger AT RZ.UNI-KARLSRUHE DOT DE>
Date: Mon, 20 Jun 1994 21:43:03 MESZ
The systems I'm talking about are running HP-UX 8.x and 9.x, but the principles
should be the same on other Unix flavors.

It looks to me as if the designer of dsmc did not consider the necessity
of starting the ADSM scheduler automatically.
Every software intended to be activated at boot time creates a new process
and detaches this process to protect it against signals like SIGHUP.
We did not find a word about starting dsmc at boot time, and after we
digged deep enough we found the example with "nohup dsmc SCHedule .... &".

But this alone does not do the job.

With v1r2 we used an old trick:
we put the line:
        (cd /usr/adsm; nohup ./dsmc schedule -quiet > /dev/null 2>&1 <&1) &
into /etc/rc and a
        sleep 10
at the end (does not work without it).
(I think that dsmc first installs it's own SIGHUP handler and restores the
old setting (SIG_IGN) later -- any comments from the authors ?)

But with v1r2m1 dsmc always used it's own signal handler... the "nohup"
command became ineffective.
So I wrote a small programm, that detaches the process from the console,
so init's SIGHUP does not reach it, after the rc ended

Wouldn't it be a good idea to put this functionality into dsmc ?
(If you do not want to wait for IBM and know how to start a C compiler, you
can use the source at the end of this text)

Christian Finger
--
  .     Christian Finger                     Computer Center (G20.21 R318)
  .     Christian Finger                     Computer Center (G20.21 R318)
 |||    EMail : finger AT rz.uni-karlsruhe DOT de   University of Karlsruhe
\|||    Tel   : (+49) 721/608-4038           Postfach 6980
    /   Fax   : (+49) 721/32550              D-76128 Karlsruhe, Germany


/*                                                                         */
/*  D E T A C H                                                            */
/*                                                                         */
/*                                                                         */
/*  Detach process from controlling terminal -- finger AT rz.uni-karlsruhe DOT 
de */
/*                                                                         */

#include <stdio.h>
#include <unistd.h>

main(argc,argv)
int             argc;
char    **argv;

{
        if (argc<2) {
                fprintf(stderr,"Usage: detach command [parameter ...]\n");
                exit(1);
        }

        setsid();

        execv(argv[1],argv+1);
        perror("exec");
        return(1);
}
<Prev in Thread] Current Thread [Next in Thread>
  • starting dsmc at boot time (our workaround), Christian Finger <=