Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 62606 - /etc/init.d/autofs reload is not coreutils compatible?
Summary: /etc/init.d/autofs reload is not coreutils compatible?
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-02 04:50 UTC by Elan Ruusamäe
Modified: 2004-09-02 10:57 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 Elan Ruusamäe 2004-09-02 04:50:16 UTC
i run /etc/init.d/autofs reload, and it outputs:


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


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

the same code using 'set -x' in bash:

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

  B pid=6053
+ '[' 6053 = '' ']'
++ tail +2 /var/run/autofs.net.pid

  tail: cannot open `+2' for reading: No such file or directory
+ command===> /var/run%2Fautofs.net.pid <==
6053
/net ?        D      0:00 /usr/sbin/automount --timeout 1800 %
  2Fnet program /etc/autofs/net.sh
+ grep -q '^==> /var/run/autofs.net.pid <==
6053
/net ?        D      0:00 /usr/sbin/automount --timeout
  1800 /net program /etc/autofs/net.sh' /var/run/autofs.tmp
+ echo 'Stopping automounter:
  ==> /var/run/autofs.net.pid <==
6053
/net ?        D      0:00 /usr/sbin/au
  tomount --timeout 1800 /net program /etc/autofs/net.sh'
Stopping automounter: ==> /var/run/autofs.net.pid <==
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' for reading: No such file or directory
==> /var/run/autofs.net.pid <%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'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.
Comment 1 Sven Wegener gentoo-dev 2004-09-02 10:57:26 UTC
I changed the tail +2 to tail -n +2 to be comptatible with latest coreutils.
Fixed in CVS. Thanks for reporting.