Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 455476 - sys-process/cronie-1.4.9-r5 ships a non-working crontab
Summary: sys-process/cronie-1.4.9-r5 ships a non-working crontab
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Lars Wendler (Polynomial-C) (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-04 17:57 UTC by Michelangelo Scopelliti
Modified: 2013-02-07 07:12 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michelangelo Scopelliti 2013-02-04 17:57:18 UTC
The crontab file shipped with the ebuild (cronie-1.2-crontab) has 7 fields, the 6th being the user (root) ant the 7th the command to be executed.
According to the manpage, the fields should be 6 (leaving off the user).
As it is, the crontab is not working; the user has to manually remove the 'root' entry.

Reproducible: Always




Portage 2.2.0_alpha161 (default/linux/amd64/13.0, gcc-4.7.2, glibc-2.16.0, 3.7.5 x86_64)
=================================================================
System uname: Linux-3.7.5-x86_64-AMD_Phenom-tm-_II_X6_1055T_Processor-with-gentoo-2.2
KiB Mem:     7653908 total,   4213876 free
KiB Swap:     524284 total,    524284 free
Timestamp of tree: Mon, 04 Feb 2013 08:15:01 +0000
ld ld di GNU (GNU Binutils) 2.23.1
app-shells/bash:          4.2_p42
dev-java/java-config:     2.1.12-r1
dev-lang/python:          2.7.3-r3, 3.2.3-r2
dev-util/cmake:           2.8.10.2-r1
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.11.6, 1.13.1
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.7.2
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.7 (virtual/os-headers)
sys-libs/glibc:           2.16.0
Repositories: gentoo science kernelpanic
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA @EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/polkit-1/actions"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/var/portage/distfiles"
FCFLAGS="-march=native -O2 -pipe"
FEATURES="assume-digests binpkg-logs candy clean-logs compress-build-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms split-elog split-log strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-march=native -O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="it_IT.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j7"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/science /usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext SECURITY_HAZARD X a52 aac aalib acl adolc aio alisp alsa amd64 amr anacron ao apng audiofile bazaar berkdb bidi bitmap bittorrent blas branding bs2b bzip2 cairo calendar caps cblas-external cdda cdio chm cjk cli clucene compact conntrack consolekit context contrast contrib corefonts cracklib crypt ctypes-python cups curl cvs cxx cycles dbus dconf demosaic detex device-mapper devil dga dhcp dhcp-tools dia dirac djbfft djvu dri dts dv dvb dvd dvi dvi2tty dvipdfm ebook ecdsa eigen emf encode epspdf excel exif extensions extra extra-tools extras faac facedetect ffmpeg fftw fits flac flatfile fltk fluidsynth fontconfig fontforge fortran fortran2003 fpx frei0r ftp fts3 fuse g3dvl games gbm gcj gd gdbm geoip gflags gif gimp git gl2ps glut gmp gnuplot gnutls go gold gost gpg gphoto2 gpm graphics graphicsmagick graphite graphviz gsl gsm gstreamer gtk gtk3 gtkstyle gts gudev guile hdf hdf5 hdri heterogeneous hfs highlight hpn http humanities hwdb i18n iconv icu id3 id3tag idn imagemagick imaging inkjar inotify int-quality ios ipv6 ipython ithreads ivorbis jadetex jbig jemalloc jpeg jpeg2k json kdrive keymap kmod kpathsea ladspa lame lapack lasi latex lcms ldns lensfun libass libcaca libkms libnl libnotify libproxy libsamplerate libv4l llvm lpsol lqr lua luatex lynxkeymap lzma lzo mad math mathml matplotlib matroska mdev mem-scramble mercurial metalink metapost metis metric midi minizip mjpeg mmap mms mmx mmxext mng mod modplug modules mount mp3 mp3rtp mp4 mpeg mpi mpi-threads mudflap multicall multilib multimedia multitarget musepack music musicbrainz mysql mysqli mysqlnd nat-pmp natspec ncat ncurses ndiff netlink nettle network network-cron networking newnet nls normalize nping nptl nsplugin ntfs numpy nut nuv objc objc++ objc-gc ocr odk offensive offlinehelp ofx ogg ogm openal opencolorio opencv openexr opengl openmp openvg opus osmesa pam pango passwdqc pcap pch pcre pcre16 pdf pdfannotextractor pdfimport pdo perl pgf phonon plotutils plugins png pnm policykit postgres postproc postscript pstricks pth publishers pvr pyglet python python3 q16 q32 q64 q8 qt-faststart qt3support quicktime quvi rar raw readline reencrypt reiserfs replaygain rle romio rpc rtaudio rtmp ruby scale0tilt scanner schroedinger science script sctp sdl sdlgfx secure-delete session simage smi smp sndfile soap sockets soundex sox speex spell spoof-source sql sqlite srt sse sse2 sse3 ssl startup-notification subversion suid svg system-jpeg system-sqlite sysvipc szip t1lib taglib tbb tcl templates tex4ht tftp tga theora thin-splines threads tidy tiff timezone tk tls tools transparent-proxy truetype twolame type3 udev udis86 udisks umfpack unicode unlock-notify urandom usb utils uuid v4l v8 vaapi vala vcd vdr video vim vim-syntax vorbis vpx wav wavpack web webdav webgl webp wmf wxwidgets x264 xa xanim xcb xcomposite xdg xetex xft xml xmlpatterns xmlreader xmlrpc xmlwriter xmp xorg xpm xps xscreensaver xsl xv xvfb xvid xvmc yuv4mpeg zip zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CURL_SSL="gnutls" ELIBC="glibc" FOO2ZJS_DEVICES="sa300" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="nlpsolver presenter-minimizer scripting-beanshell wiki-publisher" LINGUAS="it en fr" OPENMPI_FABRICS="knem" PHP_TARGETS="php5-4" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" QEMU_SOFTMMU_TARGETS="arm i386 x86_64" QEMU_USER_TARGETS="arm i386 x86_64" RUBY_TARGETS="ruby19" SANE_BACKENDS="xerox_mfp" USERLAND="GNU" VIDEO_CARDS="r600 radeon v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2013-02-04 18:44:57 UTC
Paradoxically the /etc/crontab file is exactly working for me like this:

  */2 * * * *    nonrootuser  echo "$(date)" >> /home/nonrootuser/crontestfile

results in the date/time being written into the given file every two minutes as the specified user.
So I rather suppose that the man page is missing the special treatment of the syscrontab (/etc/crontab) file.

Please check if you really need to remove the user from the file to make it working.
Comment 2 Michelangelo Scopelliti 2013-02-04 19:03:16 UTC
with the 'root' field in /etc/crontab, my 'dead.letter' showed a periodic "root: command not found". Besides that, in cron.log I had

Jan 28 10:40:01 qlipah CROND[12357]: (root) CMD (root^Itest -x /usr/sbin/run-cro
ns && /usr/sbin/run-crons )

over and over.
Moreover, no periodic operations (e.g. log rotations) were made.

The problem disappeared after removing the 6th field for /etc/crontab.
Comment 3 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2013-02-04 19:42:58 UTC
I still cannot reproduce your problem. Even as user root the command from my previous post works flawlessly here.

Please attach the broken crontab file to this bug.
Comment 4 Michelangelo Scopelliti 2013-02-05 09:23:25 UTC
ok, some additional info:
I've just re-emerged cronie:
results of emerge -pqv cronie:
[ebuild   R   ] sys-process/cronie-1.4.9-r5  USE="inotify pam -anacron (-selinux)"

the crontab is the default one, /usr/portage/sys-process/cronie/files/cronie-1.2-crontab

after the install, as root:

# crontab /etc/crontab
# /etc/init.d/cronie restart

so, the stock one, no modification at all.

After some time,
# cat /root/dead.letter


/bin/bash: root: command not found

(tho empty lines, then the message).

relevant lines in /var/log/cron.log:

Feb  5 10:08:01 qlipah crond[1705]: (*system*) RELOAD (/etc/crontab)
Feb  5 10:08:01 qlipah crond[1705]: (cron.update) ORPHAN (no passwd entry)
Feb  5 10:08:52 qlipah crontab[17949]: (root) REPLACE (root)
Feb  5 10:09:00 qlipah crond[18148]: (CRON) STARTUP (1.4.9)
Feb  5 10:09:00 qlipah crond[18148]: (cron.update) ORPHAN (no passwd entry)
Feb  5 10:09:00 qlipah crond[18148]: (CRON) INFO (running with inotify support)
Feb  5 10:09:00 qlipah crond[18148]: (CRON) INFO (@reboot jobs will be run at computer's startup.)
Feb  5 10:10:01 qlipah CROND[18178]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )
Feb  5 10:10:01 qlipah CROND[18179]: (root) CMD (root^Itest -x /usr/sbin/run-crons && /usr/sbin/run-crons )
Feb  5 10:10:01 qlipah CROND[18176]: (root) MAIL (mailed 35 bytes of output but got status 0x0001

...and that's my situation at the moment.
Again, nothing of this happens if I edit the crontab.

Do you need something else?
btw, thank you for your help.
Comment 5 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2013-02-06 10:16:31 UTC
(In reply to comment #4)
>
> Feb  5 10:10:01 qlipah CROND[18178]: (root) CMD (test -x /usr/sbin/run-crons
> && /usr/sbin/run-crons )
> Feb  5 10:10:01 qlipah CROND[18179]: (root) CMD (root^Itest -x
> /usr/sbin/run-crons && /usr/sbin/run-crons )
> 
And that's what confuses me. According to these two lines, the command will first be executed successfully (without the "root" being prepended) and then something is prepending the command with "root" which fails. Did you check that there's no other crontab which might contain that command? ("crontab -l" as root for example)
> 
> btw, thank you for your help.

You're welcome :)
Comment 6 Michelangelo Scopelliti 2013-02-06 16:06:32 UTC
(In reply to comment #5)
> (In reply to comment #4)
> >
> > Feb  5 10:10:01 qlipah CROND[18178]: (root) CMD (test -x /usr/sbin/run-crons
> > && /usr/sbin/run-crons )
> > Feb  5 10:10:01 qlipah CROND[18179]: (root) CMD (root^Itest -x
> > /usr/sbin/run-crons && /usr/sbin/run-crons )
> > 
> And that's what confuses me. According to these two lines, the command will
> first be executed successfully (without the "root" being prepended) and then
> something is prepending the command with "root" which fails. Did you check

It was my impression too, but I was not able to undertend how.

> that there's no other crontab which might contain that command? ("crontab
> -l" as root for example)

# crontab -l

# for cronie
# $Header: /var/cvsroot/gentoo-x86/sys-process/cronie/files/cronie-1.2-crontab,v 1.2 2009/05/12 09:10:59 bangert Exp $

# Global variables
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly
59  *  * * *    rm -f /var/spool/cron/lastrun/cron.hourly
9  3  * * *     rm -f /var/spool/cron/lastrun/cron.daily
19 4  * * 6     rm -f /var/spool/cron/lastrun/cron.weekly
29 5  1 * *     rm -f /var/spool/cron/lastrun/cron.monthly
*/10  *  * * *  test -x /usr/sbin/run-crons && /usr/sbin/run-crons
Comment 7 Michelangelo Scopelliti 2013-02-06 18:18:34 UTC
...oops!
It's really what I should say, beside "I'm sorry".
My error was to call

# crontab /etc/crontab

after the installation; this way causing the duplication of the commands in the logs.

Since I used other cron daemons, I did add mechanically this command (see comment #4). Besides that, I assume that 'personal' crontab were executed first (with errors), then removed from list, leaving syscrontab unable to do anything. Hopefully, it's fixed now.

Again, I'm sorry for twasting your time.

Thank you.
Comment 8 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2013-02-07 07:12:19 UTC
(In reply to comment #7)
> ...oops!
> It's really what I should say, beside "I'm sorry".

Don't worry. This happened to all of us once or twice :)

> My error was to call
> 
> # crontab /etc/crontab
> 
> after the installation; this way causing the duplication of the commands in
> the logs.

Yeah, that's not how the /etc/crontab file is supposed to be used. 

> Since I used other cron daemons, I did add mechanically this command (see
> comment #4). Besides that, I assume that 'personal' crontab were executed
> first (with errors), then removed from list, leaving syscrontab unable to do
> anything. Hopefully, it's fixed now.
> 
> Again, I'm sorry for twasting your time.
> 
> Thank you.

I'm glad you figured the problem out.

Happy Gentooin' and have a nice day :)