Detaching controlling TTY under HP-UX 10.20

Detaching controlling TTY under HP-UX 10.20

Post by David Gillie » Thu, 28 May 1998 04:00:00



Hi,

I am currently writing a simple server daemon under HP-UX 10.20.

I would like to be a good citizen and detach the controlling TTY

from the server process. The way I would normally do this is:

ttyFD=open("/dev/tty",O_RDWR);

ioctl(ttyFD,TIOCNOTTY,0);

close(ttyFD);

However TIOCNOTTY does not seem to be defined. What is the official,

HP-UX sanctioned way of doing this?

Thanks,

--
______________________________________________________________________

      University of Bradford, Bradford, West Yorkshire, England
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

 
 
 

Detaching controlling TTY under HP-UX 10.20

Post by Tony O'Brya » Thu, 28 May 1998 04:00:00



> Hi,

> I am currently writing a simple server daemon under HP-UX 10.20.

> I would like to be a good citizen and detach the controlling TTY

> from the server process. The way I would normally do this is:

> ttyFD=open("/dev/tty",O_RDWR);

> ioctl(ttyFD,TIOCNOTTY,0);

> close(ttyFD);

> However TIOCNOTTY does not seem to be defined. What is the official,

> HP-UX sanctioned way of doing this?

> Thanks,

This is covered in the comp.unix.programmer FAQ in section 1.7 (How do
I get my program to act like a daemon?).

 
 
 

Detaching controlling TTY under HP-UX 10.20

Post by Andrew Giert » Thu, 28 May 1998 04:00:00


 David> Hi,
 David> I am currently writing a simple server daemon under HP-UX 10.20.
 David> I would like to be a good citizen and detach the controlling TTY
 David> from the server process. The way I would normally do this is:
 David> ttyFD=open("/dev/tty",O_RDWR);
 David> ioctl(ttyFD,TIOCNOTTY,0);

 David> However TIOCNOTTY does not seem to be defined. What is the
 David> official, HP-UX sanctioned way of doing this?

Dunno about HP-UX specifically, but the general solution is setsid()

See examples in the FAQ.

--
Andrew.

comp.unix.programmer FAQ: see <URL: http://www.erlenstar.demon.co.uk/unix/>
                           or <URL: http://www.whitefang.com/unix/>

 
 
 

1. Difference between HP-UX 10.10 and HP-UX 10.20

Hello,

what are the differences between HP-UX 10.10 and HP-UX 10.20?

I ask because one of our customers want to evalute our software
(which was developed on 10.10) on HP-UX 10.20. Is there full
backward compatibility?

Thanks for your helps

        Rainer

--
--
Rainer Freis    -       Systemadministrator

santix software GmbH
Max-Planck-Str. 7
D-85716 Unterschleissheim

Phone: (+49) 89 321506-24
Fax  : (+49) 89 321506-99

You don't know what real time-critical software is until
you're responsible for the paychecks of a battalion of
heavily armed Marines.

        (somebody in alt.sysadmin.recovery)

2. Kernel Panic, tried everything

3. Xmodem on a HP 9000 712/60 running HP-UX 10.20

4. Log TCP Communication between client and Server (tee for TCP)

5. HP hangs with NCR-SCSI error messages on HP-UX 10.20 & 11.00

6. Pentium I 233 with linux?

7. QUESTION: Device Driver for VME/DMA parms on HP-UX 10.20 743i

8. pptp without ping

9. Successful compiled Apache 1.3.3 with mod_jserv in HP-UX 10.20?

10. kview question under HP-UX 10.20

11. Unresolved symbol: HP-UX 10.20

12. Crack 5 and HP-UX 10.20

13. Restricted shells in HP-UX 10.20 (rksh)