Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 442002 - net-analyzer/iptraf-ng-1.1.3.1-r1 - Cannot write to '/var/lock'
Summary: net-analyzer/iptraf-ng-1.1.3.1-r1 - Cannot write to '/var/lock'
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
: 449536 (view as bug list)
Depends on:
Blocks: keepdir-var-run_lock
  Show dependency tree
 
Reported: 2012-11-06 10:09 UTC by Jorge Manuel B. S. Vicetto
Modified: 2013-01-02 15:14 UTC (History)
3 users (show)

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 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2012-11-06 10:09:36 UTC
Following the stabilization of =net-analyzer/iptraf-ng-1.1.3.1-r1 on bug 441426, the admincd is failing to build with the following error:

!!! Cannot write to '/var/lock'.

I've built this package on the same build box without any error. Could we be missing /var/lock in the admincd?


Complete build log:

>>> Installing (81 of 242) net-analyzer/iptraf-ng-1.1.3.1-r1
>>> Failed to install net-analyzer/iptraf-ng-1.1.3.1-r1, Log file:
>>>  '/var/tmp/portage/net-analyzer/iptraf-ng-1.1.3.1-r1/temp/build.log'
 * Package:    net-analyzer/iptraf-ng-1.1.3.1-r1
 * Repository: gentoo
 * Maintainer: netmon@gentoo.org
 * USE:        amd64 elibc_glibc kernel_linux multilib userland_GNU
 * FEATURES:   sandbox
 * Applying iptraf-ng-1.1.3.1-kernel-v3.5-kill-off-token-ring-support.patch ...
 [ ok ]
IPTRAF_VERSION = 1.1.3.1
x86_64-pc-linux-gnu-gcc -o src/tui/input.o -c -MF src/tui/.depend/input.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/tui/input.c
x86_64-pc-linux-gnu-gcc -o src/tui/labels.o -c -MF src/tui/.depend/labels.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/tui/labels.c
x86_64-pc-linux-gnu-gcc -o src/tui/listbox.o -c -MF src/tui/.depend/listbox.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/tui/listbox.c
x86_64-pc-linux-gnu-gcc -o src/tui/menurt.o -c -MF src/tui/.depend/menurt.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/tui/menurt.c
x86_64-pc-linux-gnu-gcc -o src/tui/msgboxes.o -c -MF src/tui/.depend/msgboxes.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/tui/msgboxes.c
x86_64-pc-linux-gnu-gcc -o src/tui/winops.o -c -MF src/tui/.depend/winops.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/tui/winops.c
x86_64-pc-linux-gnu-gcc -o src/error.o -c -MF src/.depend/error.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/error.c
x86_64-pc-linux-gnu-gcc -o src/log.o -c -MF src/.depend/log.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/log.c
x86_64-pc-linux-gnu-gcc -o src/getpath.o -c -MF src/.depend/getpath.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/getpath.c
x86_64-pc-linux-gnu-gcc -o src/bar.o -c -MF src/.depend/bar.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/bar.c
x86_64-pc-linux-gnu-gcc -o src/parseproto.o -c -MF src/.depend/parseproto.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/parseproto.c
x86_64-pc-linux-gnu-gcc -o src/fltselect.o -c -MF src/.depend/fltselect.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/fltselect.c
x86_64-pc-linux-gnu-gcc -o src/ipfilter.o -c -MF src/.depend/ipfilter.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/ipfilter.c
x86_64-pc-linux-gnu-gcc -o src/fltmgr.o -c -MF src/.depend/fltmgr.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/fltmgr.c
x86_64-pc-linux-gnu-gcc -o src/ipfrag.o -c -MF src/.depend/ipfrag.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/ipfrag.c
x86_64-pc-linux-gnu-gcc -o src/serv.o -c -MF src/.depend/serv.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/serv.c
x86_64-pc-linux-gnu-gcc -o src/servname.o -c -MF src/.depend/servname.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/servname.c
x86_64-pc-linux-gnu-gcc -o src/instances.o -c -MF src/.depend/instances.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/instances.c
src/ipfilter.c: In function 'gethostparams':
src/ipfilter.c:139:5: warning: format not a string literal and no format arguments
src/serv.c: In function 'addtoportlist':
src/serv.c:248:18: warning: comparison between signed and unsigned integer expressions
src/serv.c: In function 'servmon':
src/serv.c:1014:21: warning: comparison between signed and unsigned integer expressions
x86_64-pc-linux-gnu-gcc -o src/timer.o -c -MF src/.depend/timer.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/timer.c
x86_64-pc-linux-gnu-gcc -o src/revname.o -c -MF src/.depend/revname.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/revname.c
x86_64-pc-linux-gnu-gcc -o src/pktsize.o -c -MF src/.depend/pktsize.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/pktsize.c
x86_64-pc-linux-gnu-gcc -o src/landesc.o -c -MF src/.depend/landesc.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/landesc.c
x86_64-pc-linux-gnu-gcc -o src/isdntab.o -c -MF src/.depend/isdntab.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/isdntab.c
x86_64-pc-linux-gnu-gcc -o src/options.o -c -MF src/.depend/options.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/options.c
x86_64-pc-linux-gnu-gcc -o src/promisc.o -c -MF src/.depend/promisc.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/promisc.c
src/revname.c: In function 'rvnamedactive':
src/revname.c:65:2: warning: signed and unsigned type in conditional expression
src/revname.c:65:2: warning: signed and unsigned type in conditional expression
src/revname.c: In function 'revname':
src/revname.c:172:5: warning: signed and unsigned type in conditional expression
src/revname.c:172:5: warning: signed and unsigned type in conditional expression
src/revname.c:180:9: warning: signed and unsigned type in conditional expression
src/revname.c:180:9: warning: signed and unsigned type in conditional expression
src/options.c: In function 'loadoptions':
src/options.c:174:6: warning: ignoring return value of 'read', declared with attribute warn_unused_result
x86_64-pc-linux-gnu-gcc -o src/ifaces.o -c -MF src/.depend/ifaces.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/ifaces.c
x86_64-pc-linux-gnu-gcc -o src/usage.o -c -MF src/.depend/usage.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/usage.c
x86_64-pc-linux-gnu-gcc -o src/iptraf.o -c -MF src/.depend/iptraf.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/ -DIPTRAF_VERSION='"1.1.3.1"' -DIPTRAF_NAME='"iptraf-ng"' src/iptraf.c
src/promisc.c: In function 'save_promisc_list':
src/promisc.c:96:8: warning: ignoring return value of 'write', declared with attribute warn_unused_result
x86_64-pc-linux-gnu-gcc -o src/itrafmon.o -c -MF src/.depend/itrafmon.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/itrafmon.c
x86_64-pc-linux-gnu-gcc -o src/wrapper.o -c -MF src/.depend/wrapper.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/wrapper.c
src/ifaces.c: In function 'get_next_iface':
src/ifaces.c:50:8: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result
x86_64-pc-linux-gnu-gcc -o src/parse-options.o -c -MF src/.depend/parse-options.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/parse-options.c
src/ifaces.c: In function 'open_procnetdev':
src/ifaces.c:32:8: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result
src/ifaces.c:33:8: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result
src/serv.c:827:10: warning: 'sortwin' may be used uninitialized in this function
src/serv.c:828:9: warning: 'sortpanel' may be used uninitialized in this function
x86_64-pc-linux-gnu-gcc -o src/packet.o -c -MF src/.depend/packet.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/packet.c
x86_64-pc-linux-gnu-gcc -o src/tcptable.o -c -MF src/.depend/tcptable.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/tcptable.c
src/iptraf.c:297:57: warning: 'I_opt' defined but not used
src/iptraf.c: In function 'main':
src/iptraf.c:437:11: warning: ignoring return value of 'freopen', declared with attribute warn_unused_result
src/iptraf.c:438:11: warning: ignoring return value of 'freopen', declared with attribute warn_unused_result
src/iptraf.c:439:11: warning: ignoring return value of 'freopen', declared with attribute warn_unused_result
x86_64-pc-linux-gnu-gcc -o src/othptab.o -c -MF src/.depend/othptab.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/othptab.c
x86_64-pc-linux-gnu-gcc -o src/ifstats.o -c -MF src/.depend/ifstats.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/ifstats.c
x86_64-pc-linux-gnu-gcc -o src/detstats.o -c -MF src/.depend/detstats.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/detstats.c
x86_64-pc-linux-gnu-gcc -o src/deskman.o -c -MF src/.depend/deskman.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/ -DIPTRAF_VERSION='"1.1.3.1"' -DIPTRAF_NAME='"iptraf-ng"' src/deskman.c
src/othptab.c: In function 'printothpentry':
src/othptab.c:407:4: warning: format not a string literal and no format arguments
src/othptab.c:427:4: warning: format not a string literal and no format arguments
src/othptab.c:502:4: warning: format not a string literal and no format arguments
x86_64-pc-linux-gnu-gcc -o src/hostmon.o -c -MF src/.depend/hostmon.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/hostmon.c
src/serv.c: In function 'removeaport':
src/serv.c:1442:18: warning: 'ptmp' may be used uninitialized in this function
x86_64-pc-linux-gnu-gcc -o src/fltedit.o -c -MF src/.depend/fltedit.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/fltedit.c
src/serv.c: In function 'addmoreports':
src/serv.c:1308:15: warning: 'port_min' may be used uninitialized in this function
src/serv.c:1308:25: warning: 'port_max' may be used uninitialized in this function
x86_64-pc-linux-gnu-gcc -o src/cidr.o -c -MF src/.depend/cidr.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/cidr.c
src/hostmon.c: In function 'addethnode':
src/hostmon.c:230:19: warning: comparison between signed and unsigned integer expressions
x86_64-pc-linux-gnu-gcc -o src/counters.o -c -MF src/.depend/counters.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/counters.c
x86_64-pc-linux-gnu-gcc -o src/rate.o -c -MF src/.depend/rate.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/rate.c
x86_64-pc-linux-gnu-gcc -o src/rvnamed.o -c -MF src/.depend/rvnamed.o.d -MMD -MP   -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/  src/rvnamed.c
src/hostmon.c: In function 'hostmon':
src/hostmon.c:792:10: warning: 'sortwin' may be used uninitialized in this function
src/hostmon.c:793:9: warning: 'sortpanel' may be used uninitialized in this function
x86_64-pc-linux-gnu-gcc  -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/ -o rvnamed-ng \
         src/rvnamed.o src/getpath.o -Wl,-O1 -Wl,--as-needed 
x86_64-pc-linux-gnu-gcc  -O2 -pipe -Wall -W -std=gnu99 -I. -Isrc/ -o iptraf-ng \
         src/tui/input.o src/tui/labels.o src/tui/listbox.o src/tui/menurt.o src/tui/msgboxes.o src/tui/winops.o src/error.o src/log.o src/getpath.o src/bar.o src/parseproto.o src/fltselect.o src/ipfilter.o src/fltmgr.o src/ipfrag.o src/serv.o src/servname.o src/instances.o src/timer.o src/revname.o src/pktsize.o src/landesc.o src/isdntab.o src/options.o src/promisc.o src/ifaces.o src/usage.o src/iptraf.o src/itrafmon.o src/wrapper.o src/parse-options.o src/packet.o src/tcptable.o src/othptab.o src/ifstats.o src/detstats.o src/deskman.o src/hostmon.o src/fltedit.o src/cidr.o src/counters.o src/rate.o -Wl,-O1 -Wl,--as-needed  -L/usr/lib64 -lncurses -lpanel

!!! Cannot write to '/var/lock'.
Comment 1 Sebastian Heyn 2012-11-21 08:09:45 UTC
Same thing here.

Only seems to happen on fresh installs:

/var/lock is linked to /run/lock

so I fixed it by 

mkdir /run/lock
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2013-01-02 13:06:33 UTC
*** Bug 449536 has been marked as a duplicate of this bug. ***
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2013-01-02 13:11:00 UTC
I don't readily see how this bug or its duplicate is related to bug #332633 unless we revise that tracker bug's purpose.

We should rather set up a new tracker bug for /var/lock.
Comment 4 Diego Elio Pettenò (RETIRED) gentoo-dev 2013-01-02 13:15:34 UTC
/var/lock has been changed the same way as /var/run with the introduction of /run. We can rename it to "keepdir-var-run-lock" but I don't think it's worth it.

It's basically the same problem, /var/lock should not be packaged, but rather created by init scripts.
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2013-01-02 13:22:08 UTC
iptraf-ng, like many other packages, uses $localstatedir to determine what to use for PREFIX/[[[var/]]]{lib,log,lock}/iptraf-ng. Now some of these move to /run/ (lock) while some others do not (lib, log).</rant>
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2013-01-02 13:23:24 UTC
(In reply to comment #4)
> It's basically the same problem, /var/lock should not be packaged, but
> rather created by init scripts.

It isn't the same problem when the lock file is used when no init.d script is used.
Comment 7 Diego Elio Pettenò (RETIRED) gentoo-dev 2013-01-02 13:33:44 UTC
It is fine because /var/lock -> /run/lock symlink should be created by openrc itself, and should be accessible without having to change the localstatedir setting for iptraf-ng.

As for the directory to be needed without an init script, that's the same as munin (on the master side), and can either be solved with a local.d file or with a recent openrc and tmpfiles.d
Comment 8 Jeroen Roovers (RETIRED) gentoo-dev 2013-01-02 14:56:17 UTC
That's odd. iptraf-ng's -B mode is broken, which helps explain why its locking features are completely unused - the only references to LOCKDIR (which points to /var/run by default) are apparently obsolete. Fixed, then.
Comment 9 Jeroen Roovers (RETIRED) gentoo-dev 2013-01-02 14:57:27 UTC
Oh, oversaw a few uses there.
Comment 10 Jeroen Roovers (RETIRED) gentoo-dev 2013-01-02 14:57:35 UTC
*overlooked
Comment 11 Jeroen Roovers (RETIRED) gentoo-dev 2013-01-02 15:14:55 UTC
It's even easier than I previously assumed. The subdir is created automatically when missing so there is no need for keepdir, we just need to make sure /run/lock is used instead of /var/lock. Fixed in the stable ebuild too, since this is a build error, after all.