On Thu, Jul 03, 2014 at 02:13:46PM +1000, Ian McWilliam wrote: > Hi all, > > Need some advice on the rc script infrastructure and the best way to detect > running processes. > > is some like the following acceptable practice or are there some existing > functions that will do the > equivalent. > > rc_pre() { > pgrep -fq "${TRUEPREFIX}/bin/samba" > if [[ $? == 0 ]]; then > rc_err "$0: Cannot run while AD Server Running" > fi > }
I am not sure what you are looking for here. You want to make sure one cannot start samba if it's already running? If so, rc_check() does what you want. If you meant something else, please elaborate :-) > Secondly is it acceptable to create a common rc script to hold common subs > used amongst multiple rc > script for a port, eg samba.subr that will be used by smbd and nmbd rc > scripts? No, the only time we use a common rc script is to start all processes of a common package (like we do with samba3 already). -- Antoine