Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!think!ames!ucsd!ucsdhub!esosun!seismo!uunet!sco!stephm From: stephm@sco.COM (Stephen P. Marr) Newsgroups: comp.unix.xenix Subject: Re: How to make a daemon Keywords: init respawn Message-ID: <549@scovert.sco.COM> Date: 12 May 88 18:57:53 GMT References: <194@ssbn.WLK.COM> Reply-To: stephm@sco.COM (Stephen P. Marr) Distribution: na Organization: The Santa Cruz Operation, Inc. Lines: 40 In article <194@ssbn.WLK.COM> bill@ssbn.WLK.COM (Bill Kennedy) writes: =>I am in a bit of a quandry and it appears that the net is going to be =>able to respond before SCO will, so here's my m'aidez - Surprise! SCO Calling! =>I need to respawn a process like a getty so that's there's nearly always =>a copy active. In straight ahead System V (I have SCO Vr2.2.3 80386) I =>just put an entry in /etc/inittab that says => =>30:23:respawn:/usr/lib/clubs/omron ttym07 => =><...> => =>I joked to my SCO sales rep today that if it wasn't for this group, they'd =>be three weeks behind instead of just three days. Thanks, =>-- =>Bill Kennedy usenet {rutgers,ihnp4!killer,cbosgd}!ssbn!bill => internet bill@ssbn.WLK.COM Here's a way to do it (albeit certainly not the only way): set up an entry in /etc/gettydefs which utilizes the AUTO option e.g. z # B9600 HUPCL # B9600 CS8 SANE TAB3 ECHOE IXANY # # p # AUTO prog_name and then modify an entry in /etc/ttys to use this gettydef entry and enable that port. What will happen is this: init will spawn a getty which will see the AUTO keyword and fork (login by default) the specified program. Note that argv[1] is going to be the basename of the controlling tty, and that there is no utmp entry or any real environment to speak of. Your uid and gid are 0 at this point so standard setuid-root paranoia should be applied. More info could be gleaned from gettydefs(F) init(M) and getty(M). SCO support has further info if you need it. Good luck. -- Steph Marr, The Santa Cruz Operation Inc., ...!{uunet,ihnp4,ucscc}!sco!stephm Internet: (MX Handlers) stephm@sco.COM (Others) @ucscc.ucsc.edu:stephm@sco.COM "There was coffee. Life would go on." --William Gibson