[luci] uci state vars not updated using lua library
Patrick Grimm
patrick at lunatiki.de
Thu Mar 15 14:09:19 CET 2012
Hi
AFAIK you must use uci.cursor(nil,"/var/state"):save("httpclient") after "set".
Am 15.03.2012 um 13:45 schrieb Conor O'Gorman:
> Hi,
>
> I see differing behaviour between the command line uci tool and the lua
> uci functions.
>
> Can someone tell me if this is my error, possibly fixed in an update, or
> a better email list to post to?
>
> Here is an strace of both actions. The lua version doesn't even attempt
> to write to the state dir. This is on Openwrt backfire x86 in a VM.
>
> strace lua -luci -e 'uci.cursor(nil,"/var/state"):set("httpclient", "default", "active", "y")'
> stat("/var/state/httpclient", {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
> open("/var/state/httpclient", O_RDONLY) = 4
> flock(4, LOCK_SH) = 0
> lseek(4, 0, SEEK_SET) = 0
> fcntl(4, F_GETFL) = 0 (flags O_RDONLY)
> ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfe28840) = -1 ENOTTY (Inappropriate ioctl for device)
> read(4, "", 4096) = 0
> flock(4, LOCK_UN) = 0
> close(4) = 0
> flock(3, LOCK_UN) = 0
> close(3) = 0
> rt_sigaction(SIGINT, {SIG_DFL, [INT], SA_RESTORER|SA_RESTART, 0xb7712e6f}, {0x8049240, [INT], SA_RESTORER|SA_RESTART, 0xb7712e6f}, 8) = 0
> munmap(0xb7704000, 13016) = 0
> munmap(0xb76fa000, 37792) = 0
> _exit(0) = ?
>
> strace uci -P /var/state set httpclient.default.active=y
> stat("/var/state/httpclient", {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
> open("/var/state/httpclient", O_RDONLY) = 4
> flock(4, LOCK_SH) = 0
> lseek(4, 0, SEEK_SET) = 0
> fcntl(4, F_GETFL) = 0 (flags O_RDONLY)
> ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfb0a240) = -1 ENOTTY (Inappropriate ioctl for device)
> read(4, "", 4096) = 0
> flock(4, LOCK_UN) = 0
> close(4) = 0
> flock(3, LOCK_UN) = 0
> close(3) = 0
> stat("/var/state", {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
> ioctl(2147483647, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfb0a360) = -1 EBADF (Bad file descriptor)
> open("/var/state/httpclient", O_RDWR|O_CREAT, 0600) = 3
> flock(3, LOCK_EX) = 0
> lseek(3, 0, SEEK_END) = 0
> fcntl(3, F_GETFL) = 0x2 (flags O_RDWR)
> ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfb0a380) = -1 ENOTTY (Inappropriate ioctl for device)
> write(3, "httpclient.default.active=y\n", 28) = 28
> flock(3, LOCK_UN) = 0
> close(3) = 0
> _exit(0) = ?
>
> Thanks,
> Conor
>
> _______________________________________________
> luci mailing list
> luci at lists.subsignal.org
> https://lists.subsignal.org/mailman/listinfo/luci
-------------- n?chster Teil --------------
Ein Dateianhang mit Binärdaten wurde abgetrennt...
Dateiname : PGP.sig
Dateityp : application/pgp-signature
Dateigröße : 243 bytes
Beschreibung: Signierter Teil der Nachricht
URL : <http://lists.subsignal.org/pipermail/luci/attachments/20120315/28dc906b/attachment.pgp>
More information about the luci
mailing list