<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>62606</bug_id>
          
          <creation_ts>2004-09-02 04:50 0000</creation_ts>
          <short_desc>/etc/init.d/autofs reload is not coreutils compatible?</short_desc>
          <delta_ts>2004-09-02 10:57:26 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Applications</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>glen@delfi.ee</reporter>
          <assigned_to>bug-wranglers@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>glen@delfi.ee</who>
            <bug_when>2004-09-02 04:50:16 0000</bug_when>
            <thetext>i run /etc/init.d/autofs reload, and it outputs:


# /etc/init.d/autofs reload
Reloading automounter: checking for changes ...
tail: cannot open `+2&apos; for reading: No such file or directory
Stopping automounter: ==&gt; /var/run/autofs.net.pid &lt;==
6053
/net ?
  D      0:00 /usr/sbin/automount --timeout 1800 /net program /etc/autofs/net.sh
 * WARNING:  &quot;autofs&quot; has already been started.


the problematic line seems to be:
 command=`tail +2 $i`

the same code using &apos;set -x&apos; in bash:

# /etc/init.d/autofs reload
Reloading automounter: checking for changes ...
++ head -n 1 /var/run/autofs.net.pid

  B pid=6053
+ &apos;[&apos; 6053 = &apos;&apos; &apos;]&apos;
++ tail +2 /var/run/autofs.net.pid

  tail: cannot open `+2&apos; for reading: No such file or directory
+ command===&gt; /var/run%2Fautofs.net.pid &lt;==
6053
/net ?        D      0:00 /usr/sbin/automount --timeout 1800 %
  2Fnet program /etc/autofs/net.sh
+ grep -q &apos;^==&gt; /var/run/autofs.net.pid &lt;==
6053
/net ?        D      0:00 /usr/sbin/automount --timeout
  1800 /net program /etc/autofs/net.sh&apos; /var/run/autofs.tmp
+ echo &apos;Stopping automounter:
  ==&gt; /var/run/autofs.net.pid &lt;==
6053
/net ?        D      0:00 /usr/sbin/au
  tomount --timeout 1800 /net program /etc/autofs/net.sh&apos;
Stopping automounter: ==&gt; /var/run/autofs.net.pid &lt;==
6053
/net ?        D      0:00 /usr/sbin/automount --timeout 18
  00 /net program /etc/autofs/net.sh^M
+ kill -USR2 6053
+ rm -f /var/run/autofs.tmp
%
  2B svc_start
+ local retval=0
+ local startfail=no
+ local x=
+ local y=
%
  0D
and the tail command itself:
# tail +2 /var/run/autofs.net.pid
tail:
   cannot open `+2&apos; for reading: No such file or directory
==&gt; /var/run/autofs.net.pid &lt;%3
  D=^M
6053^M
/net ?        D      0:00 /usr/sbin/automount --timeout 1800 /net program /etc/autofs/net.sh


using -n switch:
# tail -n +2 /var/run/autofs.net.pid
/n
  et ?        D      0:00 /usr/sbin/automount --timeout 1800 /net program /etc/autofs/net.sh
%
  0D
and program versions:
# epm -q coreutils autofs
coreutils-5.2
autofs-3.1.7-r5


PS: i&apos;m sorry, the text above is not like the original one used to be, but i posted the original bug, and mozilla responded me that i forgot to choose component, and when i hit back in browser, all the forms were blank. so the text above is extracted with ngrep(1) and perl patterns to decode back from urlencooded data :/

Reproducible: Always
Steps to Reproduce:
1.
2.
3.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>swegener@gentoo.org</who>
            <bug_when>2004-09-02 10:57:26 0000</bug_when>
            <thetext>I changed the tail +2 to tail -n +2 to be comptatible with latest coreutils.
Fixed in CVS. Thanks for reporting.</thetext>
          </long_desc>
      
    </bug>

</bugzilla>