Quantcast

mh not restarting after crash

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

mh not restarting after crash

David Worenklein (@work)
Hi, all.  Not sure if this is a plain old Linux question, or related to mh being a perl script (i.e. it shows up in the process table as "/usr/bin/perl mh") and/or putting itself into the background, so apologies in advance.

My mac crashed so I'm rebuilding my mh machine on an old PC running ubuntu 16.04.2

There are three variations of start-stop-daemon in mh/bin (_Gentoo.rc, _mark.rc and plain old misterhouse.rc) and I've tried various incarnations of all three.

When I run "sudo /etc/init.d/mh start", mister house starts up fine, but if I kill it (or it crashes on its own), it does not restart.

P.S. mh drops its pid file in the default location $config_parms{data_dir}/mh.pid

Here is my latest /etc/init.d/mh.  Thanks in advance for any help

#!/bin/sh
## BEGIN INIT INFO
# Provides: mh
# Required-Start: $syslog
# Required-Stop: $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: mh server
# Description: Start/stop the misterhouse service
### END INIT INFO
MHHOME=/GrandCentral/MisterHouse/misterhouse
PIDFILE=/var/run/mh.pid # Let start-stop-daemon create its own pid, rather than relying on the pid created by mh
#PIDFILE=${MHHOME}/data/mh.pid -- tried this, too, no better
PGM=${MHHOME}/bin/mh

test -x $PGM || exit 0 

if [ "$(id -u)" != "0" ]
then
  echo "You must be root to start, stop or restart Mr. House"
  exit 1
fi

# routines to start and stop Misterhouse
# Start mh
start(){
 echo "Starting Misterhouse: ${PGM}"
 export mh_parms=${MHHOME}/worenklein/mh.private.ini
# Have start-stop-daemon create its own pid file...remove make-pidfile if relying on mh's pid file
 /sbin/start-stop-daemon --start --background --chuid mh --make-pidfile --pidfile ${PIDFILE} --exec ${PGM}
}

# Stop mh
stop(){
 echo "Stopping Misterhouse"
 /sbin/start-stop-daemon --stop --pidfile ${PIDFILE}
}

# deal with the command line variables
case "$1" in
 start) start ;;
 stop) stop ;;
 restart) stop sleep 5 start ;;
 *)
 # invalid command, so display the usage options.
   echo "Usage: /etc/init.d/mh {start|stop|restart}"
   exit 1 ;;
esac
exit 0


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: mh not restarting after crash

H Plato
Try using

PGM=${MHHOME}/bin/mhl


> On Feb 20, 2017, at 7:42 PM, David Worenklein (@work) <[hidden email]> wrote:
>
> Hi, all.  Not sure if this is a plain old Linux question, or related to mh being a perl script (i.e. it shows up in the process table as "/usr/bin/perl mh") and/or putting itself into the background, so apologies in advance.
>
> My mac crashed so I'm rebuilding my mh machine on an old PC running ubuntu 16.04.2
>
> There are three variations of start-stop-daemon in mh/bin (_Gentoo.rc, _mark.rc and plain old misterhouse.rc) and I've tried various incarnations of all three.
>
> When I run "sudo /etc/init.d/mh start", mister house starts up fine, but if I kill it (or it crashes on its own), it does not restart.
>
> P.S. mh drops its pid file in the default location $config_parms{data_dir}/mh.pid
>
> Here is my latest /etc/init.d/mh.  Thanks in advance for any help
>
> #!/bin/sh
> ## BEGIN INIT INFO
> # Provides: mh
> # Required-Start: $syslog
> # Required-Stop: $syslog
> # Default-Start: 2 3 4 5
> # Default-Stop: 0 1 6
> # Short-Description: mh server
> # Description: Start/stop the misterhouse service
> ### END INIT INFO
> MHHOME=/GrandCentral/MisterHouse/misterhouse
> PIDFILE=/var/run/mh.pid # Let start-stop-daemon create its own pid, rather than relying on the pid created by mh
> #PIDFILE=${MHHOME}/data/mh.pid -- tried this, too, no better
> PGM=${MHHOME}/bin/mh
>
> test -x $PGM || exit 0
>
> if [ "$(id -u)" != "0" ]
> then
>   echo "You must be root to start, stop or restart Mr. House"
>   exit 1
> fi
>
> # routines to start and stop Misterhouse
> # Start mh
> start(){
>  echo "Starting Misterhouse: ${PGM}"
>  export mh_parms=${MHHOME}/worenklein/mh.private.ini
> # Have start-stop-daemon create its own pid file...remove make-pidfile if relying on mh's pid file
>  /sbin/start-stop-daemon --start --background --chuid mh --make-pidfile --pidfile ${PIDFILE} --exec ${PGM}
> }
>
> # Stop mh
> stop(){
>  echo "Stopping Misterhouse"
>  /sbin/start-stop-daemon --stop --pidfile ${PIDFILE}
> }
>
> # deal with the command line variables
> case "$1" in
>  start) start ;;
>  stop) stop ;;
>  restart) stop sleep 5 start ;;
>  *)
>  # invalid command, so display the usage options.
>    echo "Usage: /etc/init.d/mh {start|stop|restart}"
>    exit 1 ;;
> esac
> exit 0
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot________________________________________________________
> To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users
>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users

Loading...