Re: problems with a rc.d script I'm creating

2007-09-02 Thread Gerard
On September 01, 2007 at 11:17PM Jim Stapleton wrote:


> akpop3d_enable=${akpop3d_enable-"NO"}
> akpop3d_pidfile=${akpop3d_pidfile-"/var/run/akpop3d.pid"}
> akpop3d_flags=${akpop3d_flags-"-d -s -L .akpop3d"}
> akpop3d_conffile=${akpop3d_conffile-""}
> akpop3d_flush_cache=${akpop3d_flush_cache-"NO"}

I believe you have to precede these with a colon and space; i.e. ": "
for it to work correctly.

-- 
Gerard
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: problems with a rc.d script I'm creating

2007-09-02 Thread Jim Stapleton
Thanks, I'll play with that a bit more.

-Jim Stapleton

On 9/2/07, Mel <[EMAIL PROTECTED]> wrote:
> On Sunday 02 September 2007 14:18:17 Jim Stapleton wrote:
> > > I haven't figured out the proper way myself, but the problem is that the
> > > defaults you set at top, override the rc.conf variables, because they
> > > don't exist yet. What I do is move load_rc_config before setting
> > > defaults. General order becomes:
> > > name=foo
> > > rcvar=`set_rcvar`
> > > load_rc_config ${name}
> > > foo_default=${foo_default:-"default value"}
> > > run_rc_command "$1"
> > >
> > > Seems to work, maybe I'll figure out the proper way once I finish
> > > reading:
> > > http://www.freebsd.org/doc/en_US.ISO8859-1/articles/rc-scripting/index.ht
> > >ml
> >
> > Thanks.
> >
> > Putting this before anything else butt he #!/bin/sh and the intro
> > comments "worked" but spat out some errors.
> > 
> > name=akpop3d
> > rcvar=`set_rcvar`
> > load_rc_config ${name}
> > 
> > [EMAIL PROTECTED] /usr/local/etc/rc.d]# ./akpop3d start
> > set_rcvar: not found
> > load_rc_config: not found
> > Starting akpop3d.
> > 
> >
> >
> > So, I tried putting the `. /etc/rc.subr` before that, but it didn't
> > even start the server (processed with no errors, and a ps -A showed no
> > server)
>
> That's weird. Here's my qpopper one, that works. Maybe you can find what's
> causing the errors for you:
> #!/bin/sh
> # PROVIDE: qpopper
> # REQUIRE: DAEMON
>
> . /etc/rc.subr
>
> name="qpopper"
> rcvar=`set_rcvar`
> load_rc_config $name
>
> qpopper_config=${qpopper_config:-"/usr/local/etc/qpopper.config"}
> qpopper_host=${qpopper_host:-"127.0.0.1"}
> qpopper_port=${qpopper_port:-"110"}
>
> command="/usr/local/libexec/${name}"
> command_args="-f ${qpopper_config} ${qpopper_host}:${qpopper_port}"
> required_files=${qpopper_config}
>
> run_rc_command "$1"
>
> > Also, if you reply, could you please reply-all? Sorry, I have this
> > list in digest mode due to volume, and I can't do a proper reply that
> > keeps thread information without having a normal copy.
>
> Ah. Done.
>
>
> --
> Mel
>
> People using reply to all on lists, must think I need 2 copies.
>
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: problems with a rc.d script I'm creating

2007-09-02 Thread Mel
On Sunday 02 September 2007 14:18:17 Jim Stapleton wrote:
> > I haven't figured out the proper way myself, but the problem is that the
> > defaults you set at top, override the rc.conf variables, because they
> > don't exist yet. What I do is move load_rc_config before setting
> > defaults. General order becomes:
> > name=foo
> > rcvar=`set_rcvar`
> > load_rc_config ${name}
> > foo_default=${foo_default:-"default value"}
> > run_rc_command "$1"
> >
> > Seems to work, maybe I'll figure out the proper way once I finish
> > reading:
> > http://www.freebsd.org/doc/en_US.ISO8859-1/articles/rc-scripting/index.ht
> >ml
>
> Thanks.
>
> Putting this before anything else butt he #!/bin/sh and the intro
> comments "worked" but spat out some errors.
> 
> name=akpop3d
> rcvar=`set_rcvar`
> load_rc_config ${name}
> 
> [EMAIL PROTECTED] /usr/local/etc/rc.d]# ./akpop3d start
> set_rcvar: not found
> load_rc_config: not found
> Starting akpop3d.
> 
>
>
> So, I tried putting the `. /etc/rc.subr` before that, but it didn't
> even start the server (processed with no errors, and a ps -A showed no
> server)

That's weird. Here's my qpopper one, that works. Maybe you can find what's 
causing the errors for you:
#!/bin/sh
# PROVIDE: qpopper
# REQUIRE: DAEMON

. /etc/rc.subr

name="qpopper"
rcvar=`set_rcvar`
load_rc_config $name

qpopper_config=${qpopper_config:-"/usr/local/etc/qpopper.config"}
qpopper_host=${qpopper_host:-"127.0.0.1"}
qpopper_port=${qpopper_port:-"110"}

command="/usr/local/libexec/${name}"
command_args="-f ${qpopper_config} ${qpopper_host}:${qpopper_port}"
required_files=${qpopper_config}

run_rc_command "$1"

> Also, if you reply, could you please reply-all? Sorry, I have this
> list in digest mode due to volume, and I can't do a proper reply that
> keeps thread information without having a normal copy.

Ah. Done.


-- 
Mel

People using reply to all on lists, must think I need 2 copies.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: problems with a rc.d script I'm creating

2007-09-02 Thread Jim Stapleton
> I haven't figured out the proper way myself, but the problem is that the
> defaults you set at top, override the rc.conf variables, because they don't
> exist yet. What I do is move load_rc_config before setting defaults. General
> order becomes:
> name=foo
> rcvar=`set_rcvar`
> load_rc_config ${name}
> foo_default=${foo_default:-"default value"}
> run_rc_command "$1"
>
> Seems to work, maybe I'll figure out the proper way once I finish reading:
> http://www.freebsd.org/doc/en_US.ISO8859-1/articles/rc-scripting/index.html

Thanks.

Putting this before anything else butt he #!/bin/sh and the intro
comments "worked" but spat out some errors.

name=akpop3d
rcvar=`set_rcvar`
load_rc_config ${name}

[EMAIL PROTECTED] /usr/local/etc/rc.d]# ./akpop3d start
set_rcvar: not found
load_rc_config: not found
Starting akpop3d.



So, I tried putting the `. /etc/rc.subr` before that, but it didn't
even start the server (processed with no errors, and a ps -A showed no
server)


At least I have something that *works* now, even if it spews errors. Thank you.

Also, if you reply, could you please reply-all? Sorry, I have this
list in digest mode due to volume, and I can't do a proper reply that
keeps thread information without having a normal copy.

Thanks,
-Jim Stapleton
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: problems with a rc.d script I'm creating

2007-09-02 Thread Mel
On Sunday 02 September 2007 05:17:08 Jim Stapleton wrote:
> I'm trying to create an rc.d script to start akpop3d (it doesn't seem
> to come with one).
>
> According to the documentation on run_rc_command in /etc/rc.subr, I
> thought this should work. However I get no response when I run
> '/usr/local/etc/rc.d/akpop3d start', and ps -A doesn't show an akpop3d
> process. When I run it manually (akpop3d -d -s -L .akpop3d), it starts
> just fine.
>
> Could anyone suggest what I am missing here?
>
> Thanks,
> -Jim Stapleton
>
> The script:
>
> #!/bin/sh
> #
> # $FreeBSD: N/A
> #
> # PROVIDE: akpop3d
> # REQUIRE: DAEMON
> #
> # Add the following line to /etc/rc.conf to enable akpop3d:
> #
> # akpop3d_enable="YES"
> #
>
>
> akpop3d_enable=${akpop3d_enable-"NO"}
> akpop3d_pidfile=${akpop3d_pidfile-"/var/run/akpop3d.pid"}
> akpop3d_flags=${akpop3d_flags-"-d -s -L .akpop3d"}
> akpop3d_conffile=${akpop3d_conffile-""}
> akpop3d_flush_cache=${akpop3d_flush_cache-"NO"}
>
> . /etc/rc.subr
>
>
> if [ ! -z $(check_pidfile $akpop3d_pidfile akpop3d) ]
> then
>
> else
>
> fi
>
> name=akpop3d
> rcvar=`set_rcvar`
>
> command=/usr/local/bin/${name}
> pidfile=${akpop3d_pidfile}
> #start_precmd=akpop3d_precmd
>
> load_rc_config ${name}
>
>
>
> run_rc_command "$1"

I haven't figured out the proper way myself, but the problem is that the 
defaults you set at top, override the rc.conf variables, because they don't 
exist yet. What I do is move load_rc_config before setting defaults. General 
order becomes:
name=foo
rcvar=`set_rcvar`
load_rc_config ${name}
foo_default=${foo_default:-"default value"}
run_rc_command "$1"

Seems to work, maybe I'll figure out the proper way once I finish reading:
http://www.freebsd.org/doc/en_US.ISO8859-1/articles/rc-scripting/index.html


-- 
Mel

People using reply to all on lists, must think I need 2 copies.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"