From: Roger B. <rog...@te...> - 2002-04-22 22:23:36
|
Kevin, Thanks for this post. It solved my problem I asked about earlier on this list. I now have this working fine on my SuSE system. I have done 3 modifications to the script. 1. I'm running one of my systems as a server only (no windows manager) which mean it runs in runlevel 3 and not 5. By modifying these lines the script will work in all instances: ===== # Default-Start: 3 5 # Default-Stop: 3 5 # Description: Start mh in run level 3 and 5 ===== 2. The restart option does not work since the stop command is not a function. I have added this: ===== stop () { killproc $MH_BIN } ===== and modified the stop case part: ===== stop) echo -n "Shutting down Mister-House" ## Stop daemon with killproc(8) and if this fails ## set echo the echo return value. stop # Remember status and be verbose rc_status -v ;; ===== 3. I have exported the mh_parms in /etc/profile (/etc/profile.local in SuSE) to where I have my ini file. It seems that this is not picked up when mh is started through the script. I have to add the export in the start section: ===== start() { export mh_parms=/home/mhrb/mh.private.ini startproc -u mh -g 102 $MH_BIN -log_file $MH_LOG -tk 0 > /dev/null 2>&1 & RETVAL=$? return $RETVAL } ===== Thanks again Kevin ! Regards Roger ----- Original Message ----- From: "kevin wambsganz" <wa...@at...> To: <mis...@li...> Sent: Wednesday, April 10, 2002 5:48 AM Subject: [misterhouse-users] Auto starting mh during boot for SuSE Linux 7.3 > > Hi All, > > SuSE Linux has to be setup uniquely for mister house because of the Symbolic > Links. The instructions are located in the attached file but are listed > below as well. Place attached script in the /etc/init.d directory and make > sure root has execution access by "chmod u+rwx mh" Note, The following > instructions and file were used on SuSE 7.3, I think there may be some > changes to the init.d symbolic links on previous version of SuSE, but I'm > not sure. > > Kevin > > > Bruce, Please add the attached file in the mh/bin directory using the a file > name with SuSe in it. > > Thanks, > Kevin > > > Always test the script before you restart you computer. If the script has a > major problem then you computer may not boot up. See the example below of > how to start/stop and check status. > > homeauto:/etc/init.d # ./mh stop > Shutting down Mister-House > done > homeauto:/etc/init.d # ./mh start > Starting Mister-House > done > homeauto:/etc/init.d # ./mh status > Checking for Mister-House: > running > > # > # System startup service for mister house using SuSE with > # A user (mh) and group are created using yast2. The user and group are > optional > # but make it easier to separate production from development work. > # If you don't use the new group, then remove "-u mh -g 102" from startproc. > # If you add a new user, then you copy the mister house files into the mh > directory. > # This script assumes that mh is in the default /home/mh directory, if not > then > # change the "MH_LOG=/home/mh/data/logs/startup.txt" and > "MH_BIN=/home/mh/bin/mh" lines. > # > # This script supports starting/stopping/restarting, and status. > # This script should be executed at runlevel 5 and the symbolic links in the > must > # be created using the insserv command. Execute "insserv -d /etc/init.d/mh" > # to setup the links as root. You must use this command, otherwise SuSE will > overwrite > # the symbolic links if you create them manually. At least thats what I read > it > # would do, I have not tried it. > # > # You can run this script from /etc/init.d by ./mh start or ./mh stop. > # You must be root to run this script. > # > # Note, my mh uses mysql as a Database. If you have any dependencies > add/remove > # from the "Required-Start:" line. > # > # This entire script goes into /etc/rc.d/init.d/mh file. > > > > > > |