Re: Proper way to start a program at log-on
On Monday 24 May 2004 19:23, you wrote: > ** Reply Separator ** > Monday, May 24, 2004 8:18:06 PM > > Sorry Eric, but I am not the well versed in this OS yet. I was able to > create a simple script that works. The program is started at log-on and > stopped at shutdown without incident. > > However, I have no idea how to use 'setuid'. I looked it up in the > manual pages, and it seems to be a "C" library function. I know nothing > about how that works. Perhaps yo can give me a quick course on how to > use this function so that the program runs correctly. > > Thanks! > > Gerard Seibert > [EMAIL PROTECTED] Gerard, I just installed the dnetc program from ports (/usr/ports/misc/dnetc) and it actually installs a script in the /usr/local/etc/rc.d directory for you. Check that out. Your best bet is always using the ports tree. If you're not familiar with that, check out the freebsd site and the documentation on it. HTH -- A man goes to a tailor to try on a new custom-made suit. The first thing he notices is that the arms are too long. "No problem," says the tailor. "Just bend them at the elbow and hold them out in front of you. See, now it's fine." "But the collar is up around my ears!" "It's nothing. Just hunch your back up a little ... no, a little more ... that's it." "But I'm stepping on my cuffs!" the man cries in desperation. "Nu, bend you knees a little to take up the slack. There you go. Look in the mirror -- the suit fits perfectly." So, twisted like a pretzel, the man lurches out onto the street. Reba and Florence see him go by. "Oh, look," says Reba, "that poor man!" "Yes," says Florence, "but what a beautiful suit." -- Arthur Naiman, "Every Goy's Guide to Yiddish" ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Proper way to start a program at log-on
At 2004-05-24T18:51:18Z, Christopher Nehren <[EMAIL PROTECTED]> writes: > No, it is anything _but_ fine. Ack - I saw "rc.shutdown" and mentally replaced it with ~/.bash_logout , which would've been fine. The "real" way is decidedly not fine. -- Kirk Strauser pgpt7jOKNGNV8.pgp Description: PGP signature
Re: Proper way to start a program at log-on
On Sun, May 23, 2004 at 21:42:04 EDT, Kirk Strauser scribbled these curious markings: > Nope, that's fine. Of course, you *could* just leave it running forever, if > you really wanted to. No, it is anything _but_ fine. If Gerard makes a mistake with mergemaster, his shutdown changes are lost. The proper way to do so is, as others have suggested, to place a script in /usr/local/etc/rc.d/. If you want to do it completely properly, using rcNG (with rc.subr and rc.conf) is the way to go. Generally speaking, any well-behaved port leaves /etc alone completely. The only change that you should ever have to make to anything in /etc is a ${portname}_enable="YES" in /etc/rc.conf, if the port uses rcNG. Having third-party software muck around in /etc (especially things like a shutdown script) is a Linux prob ... er ... methodology. I'd hate to think of what would happen if an entry in /etc/rc.shutdown was incorrect, and caused the script to fail, thus not returning 0... -- I abhor a system designed for the "user", if that word is a coded pejorative meaning "stupid and unsophisticated". -- Ken Thompson - Unix is user friendly. However, it isn't idiot friendly. - Please CC me in all replies, even if I'm on the relevant list(s). pgp5hBJkoW4Qi.pgp Description: PGP signature
RE: Proper way to start a program at log-on
Make a shell script like the ones in /usr/local/etc/rc.d to start and stop the process. The script MUST be named whatever.sh and must be executable. It must accept start and stop as parameters. This is the general solution. There is probably a doc reference for it but I havent looked. mjt On Mon, 2004-05-24 at 07:58, Gerard Seibert wrote: > Since I am still new to this OS, I thought that I would check to make > sure > that I am doing this correctly. > > On my WinXP machine, I run the Distributed Net 'dnetc' program. > Further > information regarding this program is available here: > http://www.distributed.net//docs/tutor_clients.php. > > To start the program in the background I need to issue the following > command: 'dnetc -quiet'. Since I want to start this program automatically > each time I log on, I placed that command at the end of my '.bash_profile' > file. I then placed the shutdown command 'dnetc -shutdown' in the > '/etc/rc.shutdown' file. > > Since everything seems to be workings correctly, I assume that I have > done > this correctly. If there is a better way to do this, I would appreciate > receiving the information. > > Thanks! > > Gerard E. Seibert > [EMAIL PROTECTED] I would do it this way myself. You can use the other scripts in this directory as an example. If permissions are an issue, I would setuid for the user you want this to run as, but not root. Back in 1998, I used to run this very program, and this was my solution. HTH Eric F Crist President AdTech Integrated Systems, Inc (612) 998-3588 ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Proper way to start a program at log-on
Make a shell script like the ones in /usr/local/etc/rc.d to start and stop the process. The script MUST be named whatever.sh and must be executable. It must accept start and stop as parameters. This is the general solution. There is probably a doc reference for it but I havent looked. mjt On Mon, 2004-05-24 at 07:58, Gerard Seibert wrote: > Since I am still new to this OS, I thought that I would check to make sure > that I am doing this correctly. > > On my WinXP machine, I run the Distributed Net 'dnetc' program. Further > information regarding this program is available here: > http://www.distributed.net//docs/tutor_clients.php. > > To start the program in the background I need to issue the following > command: 'dnetc -quiet'. Since I want to start this program automatically > each time I log on, I placed that command at the end of my '.bash_profile' > file. I then placed the shutdown command 'dnetc -shutdown' in the > '/etc/rc.shutdown' file. > > Since everything seems to be workings correctly, I assume that I have done > this correctly. If there is a better way to do this, I would appreciate > receiving the information. > > Thanks! > > Gerard E. Seibert > [EMAIL PROTECTED] > > > > ___ > [EMAIL PROTECTED] mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "[EMAIL PROTECTED]" > > > This Email has been scanned for Viruses by MailMarshal. > -- Murray Taylor Special Projects Engineer - Bytecraft Systems & Entertainment P: +61 3 8710 2555 F: +61 3 8710 2599 D: +61 3 9238 4275 M: +61 417 319 256 E: [EMAIL PROTECTED] or visit us on the web http://www.bytecraftsystems.com http://www.bytecraftentertainment.com This Email has been scanned for Viruses by MailMarshal. ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Proper way to start a program at log-on
At 2004-05-23T21:58:06Z, Gerard Seibert <[EMAIL PROTECTED]> writes: > Since everything seems to be workings correctly, I assume that I have done > this correctly. If there is a better way to do this, I would appreciate > receiving the information. Nope, that's fine. Of course, you *could* just leave it running forever, if you really wanted to. -- Kirk Strauser "94 outdated ports on the box, 94 outdated ports. Portupgrade one, an hour 'til done, 82 outdated ports on the box." pgpH1L9uMvBiX.pgp Description: PGP signature
Proper way to start a program at log-on
Since I am still new to this OS, I thought that I would check to make sure that I am doing this correctly. On my WinXP machine, I run the Distributed Net 'dnetc' program. Further information regarding this program is available here: http://www.distributed.net//docs/tutor_clients.php. To start the program in the background I need to issue the following command: 'dnetc -quiet'. Since I want to start this program automatically each time I log on, I placed that command at the end of my '.bash_profile' file. I then placed the shutdown command 'dnetc -shutdown' in the '/etc/rc.shutdown' file. Since everything seems to be workings correctly, I assume that I have done this correctly. If there is a better way to do this, I would appreciate receiving the information. Thanks! Gerard E. Seibert [EMAIL PROTECTED] ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"