Starting program at startup

Starting program at startup

Post by Cruinn » Tue, 17 Dec 2002 18:55:24



I know this is going to be a too simple question and maybe answered in
lots of FAQs I just don't find but I'm a newbie to FreeBSD
administration and, well, I just need this...

Which should be the **right** place/script to tell FreeBSD (4.7) to
start a program as a non-root user on startup?

Clue: it's not a system daemon with a pretty whatever_enable option in
/etc/rc.conf.

Thanks a lot.

Cruinne.

 
 
 

Starting program at startup

Post by Ray Kohle » Tue, 17 Dec 2002 20:49:18



> I know this is going to be a too simple question and maybe answered in
> lots of FAQs I just don't find but I'm a newbie to FreeBSD
> administration and, well, I just need this...

> Which should be the **right** place/script to tell FreeBSD (4.7) to
> start a program as a non-root user on startup?

> Clue: it's not a system daemon with a pretty whatever_enable option in
> /etc/rc.conf.


--

"His super power is to turn into a scotch terrier."

 
 
 

Starting program at startup

Post by Simon Barne » Tue, 17 Dec 2002 21:06:19


Hello Cruinne,

Quote:> Which should be the **right** place/script to tell FreeBSD (4.7) to
> start a program as a non-root user on startup?

> Clue: it's not a system daemon with a pretty whatever_enable option in
> /etc/rc.conf.

This belongs to /usr/local/etc/rc.d

Here is a skeleton for a smell shell script (don't forget to chmod a+x it)
#!/bin/sh
case "$1" in
        start)
                                # command to start service goes here
                echo -n " my service"
        ;;
        stop)
                # command to stop service goes here
        ;;
        *)
                echo "Usage: `basename $0` {start|stop}" 1>&2
                exit 64
        ;;
esac

exit 0

To your service as a different user you can use su(1).

HTH,
 Simon

 
 
 

Starting program at startup

Post by Cruinn » Wed, 18 Dec 2002 23:31:15


Yes! Thanks a lot. That was exactly what I needed.

Cruinne.


> Hello Cruinne,

>>Which should be the **right** place/script to tell FreeBSD (4.7) to
>>start a program as a non-root user on startup?

>>Clue: it's not a system daemon with a pretty whatever_enable option in
>>/etc/rc.conf.

> This belongs to /usr/local/etc/rc.d

> Here is a skeleton for a smell shell script (don't forget to chmod a+x it)
> #!/bin/sh
> case "$1" in
>         start)
>                            # command to start service goes here
>                 echo -n " my service"
>         ;;
>         stop)
>                 # command to stop service goes here
>         ;;
>         *)
>                 echo "Usage: `basename $0` {start|stop}" 1>&2
>                 exit 64
>         ;;
> esac

> exit 0

> To your service as a different user you can use su(1).

> HTH,
>  Simon

 
 
 

1. Starting programs at startup

Hi, I was wondering, how would I go about setting up two programs I on
my machine to run at startup.  The first one I would like to have run
is my dns2go client.  The other is a java server I wrote for a chat
room.  Is there a way that I can have these start running at startup?
Thank you,
Jason

2. Java

3. starting a program other than mingetty in inittab at startup?

4. DHCPCD, default gateway on Cablemodem question.

5. Starting a program at login or startup

6. unsubscribe me please

7. "Starting lpd..." failure at boot/start-up

8. nasty hd? partition? problem

9. How to start start xdm from startup script?

10. start a task in back-ground at start-up

11. Can a badly written start up script hang the start-up?

12. Adsl-start as start-up script

13. !!Getting rid of auto start programs at start/Dialing up freeserve!!