[Bug 1311810] [NEW] /etc/init.d/rsyslog is an init script not a link to /lib/init/upstart-job

Joshua Timberman 1311810 at bugs.launchpad.net
Wed Apr 23 17:58:39 UTC 2014


Public bug reported:

Using Canonical-provided AMI of Ubuntu 14.04, or the LXC Ubuntu 14.04
template, /etc/init.d/rsyslog is an init script. In Ubuntu 10.04 or
12.04, /etc/init.d/rsyslog was a symbolic link to /lib/init/upstart-job.

The problem here is that the init script does this:

. /lib/lsb/init-functions

And that file has this function, used later in /etc/init.d/rsyslog:

init_is_upstart()
{
   if [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | /bin/grep -q upstart; then
       return 0
   fi
   return 1
}

Running /etc/init.d/rsyslog with start or restart commands results in a
return code of 1 because the case statement for these uses the
init_is_upstart function:

        if init_is_upstart; then
                exit 1
        fi

I modified /etc/init.d/rsyslog on an instance to add "set -x", and
here's the results of running /etc/init.d/rsyslog start

ubuntu at rsyslog-bug:~$ sudo /etc/init.d/rsyslog start
+ PATH=/sbin:/usr/sbin:/bin:/usr/bin
+ DESC=enhanced syslogd
+ NAME=rsyslog
+ RSYSLOGD=rsyslogd
+ DAEMON=/usr/sbin/rsyslogd
+ PIDFILE=/var/run/rsyslogd.pid
+ SCRIPTNAME=/etc/init.d/rsyslog
+ [ -x /usr/sbin/rsyslogd ]
+ [ -r /etc/default/rsyslog ]
+ . /etc/default/rsyslog
+ RSYSLOGD_OPTIONS=
+ . /lib/lsb/init-functions
+ run-parts --lsbsysinit --list /lib/lsb/init-functions.d
+ [ -r /lib/lsb/init-functions.d/20-left-info-blocks ]
+ . /lib/lsb/init-functions.d/20-left-info-blocks
+ [ -r /lib/lsb/init-functions.d/50-ubuntu-logging ]
+ . /lib/lsb/init-functions.d/50-ubuntu-logging
+ LOG_DAEMON_MSG=
+ FANCYTTY=
+ [ -e /etc/lsb-base-logging.sh ]
+ true
+ init_is_upstart
+ [ -x /sbin/initctl ]
+ /bin/grep -q upstart
+ /sbin/initctl version
+ return 0
+ exit 1

The fix here is to properly create a symlink of /lib/init/upstart-job to
/etc/init.d/rsyslog, which will provide the sysv/lsb compatible
interface to manage the upstart job. This should be done in the package,
not by end users who are attempting to control their rsyslog service.

** Affects: rsyslog (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to rsyslog in Ubuntu.
https://bugs.launchpad.net/bugs/1311810

Title:
  /etc/init.d/rsyslog is an init script not a link to /lib/init/upstart-
  job

Status in “rsyslog” package in Ubuntu:
  New

Bug description:
  Using Canonical-provided AMI of Ubuntu 14.04, or the LXC Ubuntu 14.04
  template, /etc/init.d/rsyslog is an init script. In Ubuntu 10.04 or
  12.04, /etc/init.d/rsyslog was a symbolic link to /lib/init/upstart-
  job.

  The problem here is that the init script does this:

  . /lib/lsb/init-functions

  And that file has this function, used later in /etc/init.d/rsyslog:

  init_is_upstart()
  {
     if [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | /bin/grep -q upstart; then
         return 0
     fi
     return 1
  }

  Running /etc/init.d/rsyslog with start or restart commands results in
  a return code of 1 because the case statement for these uses the
  init_is_upstart function:

          if init_is_upstart; then
                  exit 1
          fi

  I modified /etc/init.d/rsyslog on an instance to add "set -x", and
  here's the results of running /etc/init.d/rsyslog start

  ubuntu at rsyslog-bug:~$ sudo /etc/init.d/rsyslog start
  + PATH=/sbin:/usr/sbin:/bin:/usr/bin
  + DESC=enhanced syslogd
  + NAME=rsyslog
  + RSYSLOGD=rsyslogd
  + DAEMON=/usr/sbin/rsyslogd
  + PIDFILE=/var/run/rsyslogd.pid
  + SCRIPTNAME=/etc/init.d/rsyslog
  + [ -x /usr/sbin/rsyslogd ]
  + [ -r /etc/default/rsyslog ]
  + . /etc/default/rsyslog
  + RSYSLOGD_OPTIONS=
  + . /lib/lsb/init-functions
  + run-parts --lsbsysinit --list /lib/lsb/init-functions.d
  + [ -r /lib/lsb/init-functions.d/20-left-info-blocks ]
  + . /lib/lsb/init-functions.d/20-left-info-blocks
  + [ -r /lib/lsb/init-functions.d/50-ubuntu-logging ]
  + . /lib/lsb/init-functions.d/50-ubuntu-logging
  + LOG_DAEMON_MSG=
  + FANCYTTY=
  + [ -e /etc/lsb-base-logging.sh ]
  + true
  + init_is_upstart
  + [ -x /sbin/initctl ]
  + /bin/grep -q upstart
  + /sbin/initctl version
  + return 0
  + exit 1

  The fix here is to properly create a symlink of /lib/init/upstart-job
  to /etc/init.d/rsyslog, which will provide the sysv/lsb compatible
  interface to manage the upstart job. This should be done in the
  package, not by end users who are attempting to control their rsyslog
  service.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/rsyslog/+bug/1311810/+subscriptions



More information about the foundations-bugs mailing list