Re: rc.subr startup question

2005-03-15 Thread Doug Poland
On Tue, Mar 15, 2005 at 08:19:17AM +0200, Giorgos Keramidas wrote:
 On 2005-03-14 15:56, Doug Poland [EMAIL PROTECTED] wrote:
 
  I'm running 5.3-STABLE and I want to write a startup script for
  ports/sysutils/mcron.  The twis is, I want an mcron process for
  each user I specify in an external file.  For example...
 
... snip ...
 
  This does not work because run_rc_command checks to see if the process
  is already running before attempting to launch another instance.
 
 Are you, by any chance, setting $pidfile to anything that is not shown
 above?  The check_pidfile() check is disabled when $pidfile is empty.
 
no

  Perhaps this is something best accomplished in /etc/rc.local?
 
 Probably.
 
That's what I did.  Not as elegant, but quick, easy, and it works.
Thanks for your help.


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


rc.subr startup question

2005-03-14 Thread Doug Poland
Hello,

I'm running 5.3-STABLE and I want to write a startup script for
ports/sysutils/mcron.  The twis is, I want an mcron process for
each user I specify in an external file.  For example...

/usr/local/etc/mcron.conf:
$usernames=user1 user2 user3


/usr/local/etc/rc.d/mcron.sh
#!/bin/sh

# $Id$

# PROVIDE: mcron
# REQUIRE: LOGIN
# KEYWORD: FreeBSD shutdown
#
. /etc/rc.subr

name=mcron
prefix=/usr/local
command=${prefix}/bin/${name}
mcron_enable=${mcron_enable:-NO}
mcron_flags=${mcron_flags--d}


# Load user names from conf file
#
. ${prefix}/etc/${name}.conf

rcvar=`set_rcvar`

load_rc_config $name

for user in ${usernames}; do

mcron_user=${user}
run_rc_command $1

done


This does not work because run_rc_command checks to see if the process
is already running before attempting to launch another instance.  I've
read rc.subr(8) and it's not apparent if I can use the rc.subr tools in
this scenario.  Perhaps this is something best accomplished in
/etc/rc.local?  Any and all suggestions welcome.

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


Re: rc.subr startup question

2005-03-14 Thread Giorgos Keramidas
On 2005-03-14 15:56, Doug Poland [EMAIL PROTECTED] wrote:
 Hello,

 I'm running 5.3-STABLE and I want to write a startup script for
 ports/sysutils/mcron.  The twis is, I want an mcron process for
 each user I specify in an external file.  For example...

 /usr/local/etc/mcron.conf:
 $usernames=user1 user2 user3

 /usr/local/etc/rc.d/mcron.sh
 #!/bin/sh

 # $Id$

 # PROVIDE: mcron
 # REQUIRE: LOGIN
 # KEYWORD: FreeBSD shutdown
 #
 . /etc/rc.subr

 name=mcron
 prefix=/usr/local
 command=${prefix}/bin/${name}
 mcron_enable=${mcron_enable:-NO}
 mcron_flags=${mcron_flags--d}

 # Load user names from conf file
 #
 . ${prefix}/etc/${name}.conf

 rcvar=`set_rcvar`

 load_rc_config $name

 for user in ${usernames}; do
   mcron_user=${user}
   run_rc_command $1
 done

 This does not work because run_rc_command checks to see if the process
 is already running before attempting to launch another instance.

Are you, by any chance, setting $pidfile to anything that is not shown
above?  The check_pidfile() check is disabled when $pidfile is empty.

 Perhaps this is something best accomplished in /etc/rc.local?

Probably.

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