On Thu, Jul 3rd, 2014 at 4:07 PM, Antoine Jacoutot <ajacou...@bsdfrog.org> wrote:
> 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 :-) > OK. Samba4 contains the /usr/local/bin/samba which is the full blown Active Directory Server. The RC script for that (when I write it) will need checks to make sure that smbd / nmbd / winbindd are not running as those daemons are not used in an ADS setup. The above example is to check when starting the old file / print / winbind servers that the ADS server is not running incase you accentually started any of them while running an ADS setup. For those people just wanting smb file / print services or the old NT domain setup, you can still use smbd / nmbd / winbind. Hope that describes the scenarios that the samba4 stuff will give us. > > 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). > OK, in that case, common functions will be duplicated 3 times in each of the smbd, nmbd, winbindd rc scripts. -- Ian McWilliam