Bug 37944

Summary: systemd breaks mythbackend startup script
Product: systemd Reporter: udo <udovdh>
Component: generalAssignee: Lennart Poettering <lennart>
Status: RESOLVED WORKSFORME QA Contact:
Severity: major    
Priority: medium    
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description udo 2011-06-05 02:38:10 UTC
After upgrading to fedora 15 we get systemd which breaks the startup of mythbackend SysV script.

Version-Release number of selected component (if applicable):
systemd-26-2.fc15.x86_64

How reproducible:
Have nicely running Fedora 14 box with mysql and mythTV.
Upgrade to Fedora 15.
After booting into upgraded box notice no mysql and no mythTV.

Actual results:
Failure of mysql to start due to removed pid directory.
After correcting this manually:
Failure of mythbackend to start even though systemctl shows 'ok'.

Expected results:
Started mysql, mythbackend

Additional info:
[root@recorder user]# service mysqld start
Starting mysqld (via systemctl):                           [  OK  ]
[root@recorder user]# service mythbackend start
Starting mythbackend (via systemctl):                      [  OK  ]
[root@recorder user]# ps -ef|grep myth
root      4075  2913  0 09:41 pts/0    00:00:00 grep --color=auto myth
[root@recorder user]# ps -ef|grep back
root      4079  2913  0 09:41 pts/0    00:00:00 grep --color=auto back

Here's the script that now fails:

# cat /etc/rc.d/init.d/mythbackend 
#!/bin/bash -
#
# Startup script for mythbackend
#
# chkconfig: - 86 14
# description: mythbackend.
# processname: mythbackend
# pidfile: /var/run/mythbackend.pid
# config: 

# Source function library.
. /etc/rc.d/init.d/functions

if [ -f /etc/sysconfig/mythbackend ]; then
        . /etc/sysconfig/mythbackend
fi

export HOME
## Defaults, override them in /etc/sysconfig/mythbackend
: ${MYTHTV_HOME=/var/lib/mythtv}

binary=/usr/bin/mythbackend
prog=mythbackend
RETVAL=0
OPTIONS="$OPTIONS --daemon --logfile /var/log/mythtv/$prog.log --pidfile
/var/run/$prog.pid"

start() {
  echo -n $"Starting $prog: "
  touch /var/run/mythbackend.pid; chown mythtv:mythtv /var/run/mythbackend.pid
  # Does not work on Red Hat, do to to missing audio/video groups.
  cd $MYTHTV_HOME && daemon $binary $OPTIONS
  RETVAL=$?
  echo
  [ $RETVAL = 0 ] && touch /var/lock/subsys/$prog
  return $RETVAL
}

stop() {
  echo -n $"Stopping $prog: "
  killproc $binary
  RETVAL=$?
  echo
  [ $RETVAL = 0 ] && rm -f /var/lock/subsys/$prog /var/run/$prog.pid
}

# See how we were called.
case "$1" in
  start)
 start
 ;;
  stop)
 stop
 ;;
  restart)
 stop
 start
 ;;
  status)
 status $prog
 ;;
  *)
 echo $"Usage: $prog {start|stop|status|restart}"
 exit 1
esac

exit $RETVAL

Also see https://bugzilla.redhat.com/show_bug.cgi?id=710840
Comment 1 Lennart Poettering 2012-03-13 19:17:47 UTC
The bug on rhbz appears to be closed now, so i guess we can close this one too.

https://bugzilla.redhat.com/show_bug.cgi?id=710840

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.