Date: Sun, 29 Apr 2007 12:06:17 +0200 From: Tobias Brink <tobias.brink@gmail.com> To: onatan@gmail.com Cc: ports@FreeBSD.org Subject: FreeBSD Port: linux-foldingathome-5.02, rc.d script Message-ID: <87hcqzh4va.wl%tobias.brink@gmail.com>
next in thread | raw e-mail | index | archive | help
--Multipart_Sun_Apr_29_12:06:17_2007-1 Content-Type: text/plain; charset=US-ASCII Hello. I use the folding@home client on a machine which runs mostly unattended so it would be a hassle to start it manually after each boot. Therefor I went ahead and created a rc.d script for it. It is attached to this mail. I thought it could be useful enough to be included in the port. You can set a user under which the program will run and a directory where it will be run and store its files. These are currently set to user: root and working dir: /usr/local/share/foldingathome which is like running /usr/local/bin/FoldingAtHome as root. Feel free to contact me for any questions/corrections, I'd be happy to hear any constructive criticism because this is my first rc.d script. Feel also free to use this script in any way you see fit. Regards, Tobias --Multipart_Sun_Apr_29_12:06:17_2007-1 Content-Type: text/plain; charset=US-ASCII Content-Disposition: attachment; filename="fah" #!/bin/sh # PROVIDE: fah # REQUIRE: networking . /etc/rc.subr name="fah" rcvar=`set_rcvar` command="/usr/local/share/foldingathome/FAH502-Linux.exe" #procname="" command_args="> /dev/null 2>&1 &" fah_flags="-freeBSD $fah_flags" start_precmd="${name}_prestart" start_postcmd="${name}_poststart" start_cmd="${name}_start" load_rc_config $name eval "${rcvar}=\${${rcvar}:-'NO'}" fah_workdir=${fah_workdir:-"/usr/local/share/foldingathome/"} fah_user=${fah_user:-"root"} required_dirs="$fah_workdir" fah_prestart() { fah_CURRDIR=`pwd` cd $fah_workdir } fah_poststart() { cd $fah_CURRDIR } fah_start() { su $fah_user -c "nice -n 20 $command $fah_flags $command_args" } run_rc_command "$1" --Multipart_Sun_Apr_29_12:06:17_2007-1--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?87hcqzh4va.wl%tobias.brink>