home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pipex!unipalm!uknet!mcsun!sunic!corax.udac.uu.se!irfu.se!jhd
- From: jhd@irfu.se (Jan D.)
- Newsgroups: comp.sys.hp
- Subject: Re: POSIX enhancements since HP-UX 6.5: how affects daemonization?
- Keywords: fork() setsid()
- Message-ID: <1992Aug19.213219.8691@irfu.se>
- Date: 19 Aug 92 21:32:19 GMT
- References: <1992Aug19.195733.6344@bmers145.bnr.ca>
- Organization: Swedish Institute of Space Physics, Uppsala, Sweden
- Lines: 21
-
- In article <1992Aug19.195733.6344@bmers145.bnr.ca> tpc@bnr.ca writes:
- >Well, here we go, kicking and screaming into the '90s... :-)
- >
- >The last time I touched applications in HP-UX 6.5 I had to write a daemon,
- >and used Dave Lennert's UnixWorld article (Dec88) to good advantage. That
- >was pre-POSIX. From what I can tell, for HP-UX 8.0, aside from setpgrp now
- >being setsid(), we *still* have to fork() twice (to ensure opening a tty
- >doesn't become a controlling tty). One thing leaves me uneasy: it used to
-
- In POSIX, if you don't want to get a controlling tty, open it with the
- O_NOCTTY flag or:ed in: open(name, O_RDONLY|O_NOCTTY);
-
- >be that orphans (as we forcibly created in pre-POSIX) got PGRP==0; that's
- >not valid under POSIX, so they retain the old PGRP. Does this also mean that
- >they can acquire a controlling tty, or does the old mechanism work (for
- >modified reasons)?
- >
- I don't know about this, but I wouldn't use the old mechanism even if it
- would work. It will probably go away in the future.
-
- Jan D.
-