← Back to team overview

touch-packages team mailing list archive

[Bug 1337576] Comment bridged from LTC Bugzilla

 

------- Comment From vcd0a5@xxxxxxxxxx 2014-10-20 16:04 EDT-------
(In reply to comment #8)
> This is mandated by POSIX, see
> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html

Further research explores the problem with shell link:
root@ucrypt:/# ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Sep 16 10:54 /bin/sh -> dash

In other words, it is dash (a slim shell to provide faster boot times)
that can not execute a binary command to override itself.

You may see the different behaviors of dash vs bash:
root@ucrypt:/# /bin/dash -c cat
... ...
root@ucrypt:~# ps -ef | grep cat       # at another terminal
root      6611  6462  0 15:45 pts/0    00:00:00 /bin/dash -c cat
root      6612  6611  0 15:45 pts/0    00:00:00 cat

root@ucrypt:/# /bin/bash -c cat
... ...
root@ucrypt:/# ps -ef | grep cat        # at another terminal
root      6615  6462  0 15:47 pts/0    00:00:00 cat

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to cron in Ubuntu.
https://bugs.launchpad.net/bugs/1337576

Title:
  dash inability - cron start binary with /bin/sh

Status in “cron” package in Ubuntu:
  New

Bug description:
  -- Problem Description --
  CRON uses shell to start a binary executable defined in crontab, which is a waste of the resources for the extra shell process hanging in the system. It's supposed to run it directly with exec system call.

  *** Here are some command outputs to see the extra process(12327) and relevant information: ***
  # ps -ef | grep -e CRON -e PMLnx
  root     12326   771  0 13:59 ?        00:00:00 CRON
  root     12327 12326  0 13:59 ?        00:00:00 /bin/sh -c /var/perf/pm/bin/daemon_PMLnx      <--- extra layer, a waste
  root     12328 12327  0 13:59 ?        00:00:00 /var/perf/pm/bin/daemon_PMLnx

  # crontab -l
  59 * * * * /var/perf/pm/bin/daemon_PMLnx

  # file /var/perf/pm/bin/daemon_PMLnx
  /var/perf/pm/bin/daemon_PMLnx: ELF 64-bit LSB  executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 3.0.0, BuildID[sha1]=1761d6d97eabb4e52870cb517fe6bf457e5bf89e, stripped

  # uname -a
  Linux ubuntu 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:09:21 UTC 2014 ppc64le ppc64le ppc64le GNU/Linux

  # dpkg -l cron
      Name  Version            Architecture  Description
  +++-=====-==================-=============-=========================
  ii  cron  3.0pl1-124ubuntu2  ppc64el       process scheduling daemon

  *** Expect cron to directly execute a binary like this ***
  # ps -ef | grep -e CRON -e PMLnx
  root      2293  2223  0 09:59 ?        00:00:00 /usr/sbin/CRON -n
  root      2294  2293  0 09:59 ?        00:00:00 /var/perf/pm/bin/daemon_PMLnx

  # uname -a
  Linux hulala 3.12.15-3-default #1 SMP Wed Apr 2 17:08:55 UTC 2014 (69c2ea8) ppc64le ppc64le ppc64le GNU/Linux

  # cat /etc/SuSE-release
  SUSE Linux Enterprise Server 12 (ppc64le)
  VERSION = 12
  PATCHLEVEL = 0

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