gmoniey wrote:
thanks for the ideas, i tried both of your suggestions...i manually ran the file, and everything worked as i dumped the output to .sh file looks as such:

[ trim ]

the weird part is that the Rails found stop never printed...and im not sure
why the mongrel_rails fails (im assuming that the kldload works fine as it
doesn't print out any error messages if it is successfull)

i guess i will just keep playing with it...

Let's try a different approach. The following is a working script of your rails:


# PROVIDE: rails
# KEYWORD: nojail shutdown

. /etc/rc.subr

start_cmd="${name} start"
stop_cmd="${name} stop"

rails() {
        case ${rc_arg} in
                        echo -n "Starting ${name}: "
                        echo -n "1 "
                        echo -n "2 "
                        echo "3"
                        echo -n "Stopping ${name}: "
                        echo -n "3 "
                        echo -n "2 "
                        echo "1"
                        echo "dddzzzzz"

load_rc_config ${name}
run_rc_command "${1}"

It looks different, but this is the new way how the OS fires things up. Place this script as "/usr/local/etc/rc.d/rails". Don't add the extension to it (.sh). The use of extensions is old school. Chmod it to 555 (or 755).

Now give it a spin:

# /usr/local/etc/rc.d/rails start
# /usr/local/etc/rc.d/rails stop
# /usr/local/etc/rc.d/rails restart
# /usr/local/etc/rc.d/rails blah

See what happens and then boot your machine. You'll see how it starts and stops. Once you're satisfied, tweak it to your needs.

If you want to control all aspects of the thing then you should read:

Also read the rc.d(8) and all of its rc.* related man pages.

You can get lots of good examples in "/etc/rc.d/". For instance "/etc/rc.d/usbd" is the simplest of them all.

Let us know how it goes.


Mikhail Goriachev

Telephone: +61 (0)3 62252501
Mobile Phone: +61 (0)4 38255158
_______________________________________________ mailing list
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to