Proper way to start a program at log-on

Eric Crist ecrist at secure-computing.net
Sun May 23 21:51:29 PDT 2004


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
> gerard-seibert at rcn.com


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




More information about the freebsd-questions mailing list