Date: Tue, 28 Nov 2000 14:46:37 +0300 From: "Igor' Robul'" <igor@raduga.dyndns.org> To: mattman@mattcave.net Cc: freebsd-questions@freebsd.org Subject: Re: The real Unix problem Message-ID: <20001128144637.A26709@linux.rainbow> In-Reply-To: <001501c05758$4eea7260$3200a8c0@mattcave.net>; from mattman@mattcave.net on Sat, Nov 25, 2000 at 09:23:54PM -0600 References: <001501c05758$4eea7260$3200a8c0@mattcave.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Hello, On Sat, Nov 25, 2000 at 09:23:54PM -0600, mattman@mattcave.net wrote: >Here's something I don't know. How do you get a fucking program to load at >startup on freebsd? Where on your fucking website do you have that. There are 3 ways to load some program on startup: 1) create /etc/rc.local and add command to it, for example, I'll give full instructions: Make sure you are root, then cd /etc ls rc.local If there is rc.local, then edit this file with your favorite text editor. If there is not rc.loc, then cat >rc.local #!/bin/sh echo Starting _some daemon_: /usr/local/sbin/daemon_name Of course, you need use _path to your daemon_ :-) Press ^D (This mean Press and don't release Ctrl key, then press D) chmod +x rc.local 2) Second way is more modern way (sorry for not good English) :-) Go to /usr/local/etc/rc.d directory Copy one of files you find in it to (for example) my_daemon.sh Then edit my_daemon.sh so it will start your daemon. Also, most ports intall daemon.sh.sample into /usr/local/etc/rc.d so you can use it. Of course, it will be named not daemon.sh :-) For example Samba port installs samba.sh.sample 3) This is not really "starting on system boot", but "starting on request". To do this edit /etc/inetd.conf (use command man inetd.conf to get help about inetd.conf structure) But you can just use entries in this file as example. Also don't forget restart inetd daemon after editing this file. Do "killall -HUP inetd" at shell prompt while you are "root" user. Yet again, most ports do this for you (except, maybe restarting inetd). Most POP3 servers use this way to start. >I want to set up a Unix POP3 server. The instructions tell me how to compile. After you install most POP3 servers just edit /etc/inetd.conf, add this line at end of file. pop3 stream tcp nowait root /usr/local/libexec/popa3d popa3d This is from my /etc/inetd.conf so in your case you maybe will need other daemon name. After you have edited /etc/inetd.conf restart inted daemon: killall -HUP inetd # This is for FreeBSD 4.x and most Linuxes Or: ps xa| grep inetd # This will give you PID of inetd process kill -HUP _PID_OF_INETD_ # Replace _PID_OF_INETD_ with real value >The only thing I've found on your website is how great freebsd is >and you can do it but it depends on your version. I know my version... >how do I fucking do it? Then you can check your setup. Do as normal user or as root: telnet localhost 110 Trying 127.0.0.1... Connected to localhost.rainbow. Escape character is '^]'. +OK QUIT +OK Connection closed by foreign host. This is of course in case of POP3 server. Also I recommend you read some good book about UNIX, for example: "UNIX SECRETS" by James C. Armstrong, Jr. IDG Books Worldwide, Inc I have only Russian version of this book, so I can't give you ISBN info. Good luck! PS. A lot of "f*ck" remembered me speach of some russian militaries :-) But they had used Russian equivalents of course: ebat', huj, bljad', etc :-))) -- Igor' Robul', Unix System Administrator & Programmer @ sanatorium "Raduga", Sochi, Russia http://www.brainbench.com/transcript.jsp?pid=304744 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001128144637.A26709>