-Coders,
how is a non-root "agentuser" intended to work together with persistent storage (usually /var/net-snmp/snmpd.conf)?
AFAICS, 5.1.2 snmpd creates /var/net-snmp/snmpd.conf as *root* *before* switching to the "agentuser" uid. When shutting down, it consequently fails to save the persistent data (now running as the agentuser). Logfile reads:
NET-SNMP version 5.1.2 Received TERM or STOP signal... shutting down... read_config_store open failure on /var/net-snmp/snmpd.conf read_config_store open failure on /var/net-snmp/snmpd.conf read_config_store open failure on /var/net-snmp/snmpd.conf
Relevant strace snippets:
- --- snip ---
open("/var/net-snmp/snmpd.conf", O_WRONLY|O_APPEND|O_CREAT|O_LARGEFILE, 0666) = 9
[...]
close(9) = 0
[...]
setuid32(0x258) = 0
[...]
write(3, "Received TERM or STOP signal... "..., 50) = 50
[...]
stat64("/var/net-snmp/snmpd.conf", 0xbfffd4f0) = -1 EACCES (Permission denied)
umask(077) = 022
stat64("/var", {st_mode=S_IFDIR|0755, st_size=408, ...}) = 0
stat64("/var/net-snmp", {st_mode=S_IFDIR|0700, st_size=112, ...}) = 0
open("/var/net-snmp/snmpd.conf", O_WRONLY|O_APPEND|O_CREAT|O_LARGEFILE, 0666) = -1 EACCES (Permission denied)
write(3, "read_config_store open failure o"..., 59) = 59
umask(022) = 077
umask(077) = 022
stat64("/var", {st_mode=S_IFDIR|0755, st_size=408, ...}) = 0
stat64("/var/net-snmp", {st_mode=S_IFDIR|0700, st_size=112, ...}) = 0
open("/var/net-snmp/snmpd.conf", O_WRONLY|O_APPEND|O_CREAT|O_LARGEFILE, 0666) = -1 EACCES (Permission denied)
write(3, "read_config_store open failure o"..., 59) = 59
umask(022) = 077
umask(077) = 022
stat64("/var", {st_mode=S_IFDIR|0755, st_size=408, ...}) = 0
stat64("/var/net-snmp", {st_mode=S_IFDIR|0700, st_size=112, ...}) = 0
open("/var/net-snmp/snmpd.conf", O_WRONLY|O_APPEND|O_CREAT|O_LARGEFILE, 0666) = -1 EACCES (Permission denied)
write(3, "read_config_store open failure o"..., 59) = 59
umask(022) = 077
stat64("/var/net-snmp/snmpd.conf", 0xbfffdef0) = -1 EACCES (Permission denied)
- --- snap ---
I guess this is not to be considered ideal behaviour. Now, how to properly fix this?
+Thomas
-- Thomas Anders (thomas.anders at blue-cable.de)
------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ Net-snmp-coders mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
