LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-29-2010, 03:59 AM   #1
dick1690
LQ Newbie
 
Registered: Jul 2010
Posts: 2

Rep: Reputation: 0
autofs: -Dvariable=value not working?


I've got a Suse SLES 11 system running automount 5.0.3 which stubbornly refuses to do variable substitution.

friesian:/etc/sysconfig # automount -V
Linux automount version 5.0.3
Directories:
config dir: /etc/sysconfig
maps dir: /etc
modules dir: /usr/lib64/autofs
Compile options:
DISABLE_MOUNT_LOCKING ENABLE_FORCED_SHUTDOWN ENABLE_IGNORE_BUSY_MOUNTS
WITH_LDAP WITH_SASL LIBXML2_WORKAROUND

I've got LOCAL_OPTIONS="-DNERCARCH=linux" in /etc/sysconfig/autofs (I've also tried "-D NERCARCH=linux", "-D NERCARCH='linux'").

I've stopped nscd.

I've restarted automount /etc/init.d/autofs restart

friesian:/etc/sysconfig # ps -ef|grep automount

root 14378 1 0 11:12 ? 00:00:00 /usr/sbin/automount -p /var/run/automount.pid -O -DNERCARCH=linux

If I now do a ls /nerc/bin (one of my automounted directories),
friesian:/etc/sysconfig # ls /nerc/bin
ls: cannot open directory /nerc/bin: No such file or directory
friesian:/etc/sysconfig #

and I get the following in syslog.

Jul 28 10:30:03 friesian automount[13976]: lookup_mount: lookup(ldap): bin -> -ro mercury:/local/master/$NERCARCH/bin
Jul 28 10:30:03 friesian automount[13976]: parse_mount: parse(sun): expanded entry: -ro mercury:/local/master//bin

No substitution of the NERCARCH variable, it stays as //.

On another system, this time CentOS 5.5, it all works fine.

Linux automount version 5.0.1-0.rc2.143.el5
Directories:
config dir: /etc/sysconfig
maps dir: /etc
modules dir: /usr/lib64/autofs
Compile options:
DISABLE_MOUNT_LOCKING ENABLE_IGNORE_BUSY_MOUNTS WITH_HESIOD WITH_LDAP
WITH_SASL

[root@who1 sysconfig]# ps -ef|grep auto
root 10263 1 0 10:59 ? 00:00:00 automount -DNERCARCH=linux
root 10320 10162 0 10:59 pts/4 00:00:00 grep auto

[root@who1 sysconfig]# ls /nerc/bin
env_clean lookup rc.d setup_type
[root@who1 sysconfig]#

I get in syslog,

Jul 28 10:52:26 who1 automount[10210]: lookup_mount: lookup(ldap): bin -> orwell:/itsspool/master.itss/$NERCARCH/bin
Jul 28 10:52:26 who1 automount[10210]: parse_mount: parse(sun): expanded entry: orwell:/itsspool/master.itss/linux/bin

Which is what I would expect to see. $NERCARCH gets set to linux.

Any suggestions as to what I might be doing wrong on the Suse box?

tia, Dick
 
Old 07-31-2010, 09:43 AM   #2
cjcox
Member
 
Registered: Jun 2004
Posts: 307

Rep: Reputation: 42
:-)

You'll hate me... but you need to place the -DNERCARCH=linux line inside of AUTOFS_OPTIONS

The LOCAL_OPTIONS are used as an argument to -O to provide options to the mounts.

Perhaps the /etc/sysconfig/autofs file could be a bit clearer...
 
Old 08-02-2010, 04:01 AM   #3
dick1690
LQ Newbie
 
Registered: Jul 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Thank you forthat, worked like a dream. And I spent best part of a day on it.

friesian:/etc/sysconfig # vi autofs
friesian:/etc/sysconfig # grep OPTIONS autofs
AUTOFS_OPTIONS="-DNERCARCH=linux"
# each map entry (see also APPEND_OPTIONS)
LOCAL_OPTIONS=""
#LOCAL_OPTIONS="-DNERCARCH=linux"
# Determine whether LOCAL_OPTIONS are appended to map entry options
APPEND_OPTIONS="yes"
friesian:/etc/sysconfig #

friesian:/etc/sysconfig # /etc/init.d/autofs restart
Shutting down automount done
Starting automount done
friesian:/etc/sysconfig # ls /nerc/bin
env_clean lookup rc.d setup_type
friesian:/etc/sysconfig # ps -ef|grep automount
root 31632 1 0 09:56 ? 00:00:00 /usr/sbin/automount -p /var/run/automount.pid -DNERCARCH=linux
root 31653 31033 0 09:56 pts/0 00:00:00 grep automount
friesian:/etc/sysconfig #
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Suse 10.2 autofs not working reliably paulikus SUSE / openSUSE 9 11-12-2011 08:53 AM
Can't get AutoFS working, Arch Wiki page erroneous? MrCode Linux - Software 0 05-21-2010 01:11 AM
NIS and autofs clients not working on Fedora 9 heberrdacruz Linux - Networking 2 11-28-2008 07:13 AM
automounting with autofs not working.. logicalfuzz Linux - Networking 2 11-21-2005 05:41 AM
autofs not working in Fedora Core 2 mle Fedora 1 03-04-2005 09:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration