[prev in list] [next in list] [prev in thread] [next in thread] 

List:       net-snmp-users
Subject:    Re: creating persistent directory
From:       Harish Jadhav <harish () tecknodreams ! com>
Date:       2012-06-28 6:19:17
Message-ID: 4FEBF495.2040405 () tecknodreams ! com
[Download RAW message or body]

Hello All,

Using SNMP_PERSISTENT_DIR variable, I am setting the directory path of 
my wish for 2 MIB directories.  The variable is set in multiple processes
and all processes will start almost at the same time.

Most of the time everything works fine as it creates the mib files under 
the directory which
I specified by 0 and 1. But sometimes it tries to create in 
c:\usr\snmp\persist\mib_indexes and during this it creates with indexes 
0,1, 2, 3 (May be as multiple processes started at same time,
it is creating multiple directories where 0 &2 are having same content, 
1&3 are having same content) and  it leads to crash(segmentation 
violation) one of the process.

Please let me know if any clue on this, as I have set this variable for 
all the processes.

Thanks
Harish



On 1/12/2012 2:39 PM, Harish Jadhav wrote:
> Thanks Dave.
>
> The thing is, due to some files under c:\usr\snmp\persist\mib_indexes, 
> it was causing my application to crash at snmp_init("myapps"). I am 
> loading mibs from
> two directories. In persistent folder I found 4 index files which 
> suppose to be 2 as I am loading only two directories.
>
> So, I deleted the folder c:\usr and restarted the application. It 
> created the  c:\usr\snmp\persist\mib_indexes folder again with 2 
> files. Then application seems to work fine.
> I am wondering what could be the reason for crash and why it created 4 
> files at the first instance.
>
> Please help me to understand.
>
> Thanks
> Harish
>
> On 1/12/2012 1:56 PM, Dave Shield wrote:
>> On 12 January 2012 06:01, Harish Jadhav<harish@tecknodreams.com>  wrote:
>>> I have compiled netsnmp 5.7.1 for windows version
>>> I am loading mibs from my application directory in the code using
>>> setenv(mibdirs,path, 0) but it is creating the index files in
>>> c:\\usr\snmp\persist directory.
>> Yes - that is correct.
>>
>>> In ealier version, it is used to create the index in folders where 
>>> mibs are
>>> present( which is my appliation dir) but now it is creating a new 
>>> directory
>>> c:\\usr\snmp\persist.
>> This change was introduced about five years ago (see SVN revision 15693)
>> although the first release that used this approach was 5.5, which 
>> came out
>> in mid 2009.
>>
>> The relevant log message is:
>>      "Maintain MIB directory index files under /var/net-snmp
>>       (in line with File Hierarchy Standard specifications)
>>       See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=389434
>>       and discussion "MIBs in net-snmp" on coders list (Oct 2006)"
>>
>>
>> The problem was that under Unix-style systems (which is the traditional
>> focus of this problem), the MIB files could easily be present on a 
>> read-only
>> partition, so it might not be possible to create the .index files there.
>>
>> Given that these files are only ever used by the library, which doesn't
>> actually care where they reside - the cleanest solution was to move
>> them to the persistent directory (which is necessarily writable).
>>
>>
>>> How can I override this, please suggest.
>> There's not really an easy way to change this.
>> The simplest would probably be to set the persistent directory
>> (either globally as Bart suggests, or within the application).
>> If this is being done in a client application which has no real
>> use for the persistent directory at all, then it *might* work to
>> set the persistent directory to be on a non-existent drive, in
>> which case it would simply fail to create the .index files at all.
>> I haven't tested this, but it ought to work.
>>
>>
>> Alternatively - what is the problem about leaving the index
>> files in their new location?   I know it's a change from the old
>> (5.[0-4].x) behaviour, but does it really matter?
>>
>> Dave
>>
>>
>>
>


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic