> Does "make -V '$VARIABLE'" (or without the $, depending on exactly what
> you want) not work? I must be missing something.
The point is to do this in a makefile, not as an isolated invocation of make.
So something like ${VAR:wfile} or ${VAR:|echo >file}.
Following a discussion (make mdi: shell limit exceeded) on tech-pkg@,
I keep asking myself whether there's a sensible way to output the contents
of a make variable to a file (or pipe), even if the contents exceeds ARG_MAX.
I think it depends on what you consider valid use cases of strtoi().
> This is the case when the number is out of range, and there's trailing
> garbage -- e.g., s="42z", min=3, max=7.
Is it correct to consider the first non-digit character garbage? I.e., would
you regard it as an abuse of
Oh well.
> It effectively does -- the calls to _malloc_prefork/postfork(_child)
> are baked into fork in NetBSD's libc:
It does in -current, but the problem shows up in -8.
I'll try to back-port the changes.
Am I right that I'll need the changes of malloc.c 1.60, jemalloc.c 1.53
(and 1.48),
I've a long-standing problem of a process eating cpu time without doing
anything useful, which, most probably, goes like this:
Of a multi-threaded process,
one thread is in malloc() while another thread fork()s.
(So the child is born with the malloc lock held.)
The child process (becoming
What about certctl.conf in the etc set defaulting to "manual" and sysinst
(optionally?) changing it to automatic mode?
Of course, then, updating to -10 wouldn't give you automatic mode.
> It also is a wrong way to build self-configuration; such a test is
> vulnerable to both false positives and false negatives. It should be
> reported upstream as a bug. Much righter is to test whether epoll, if
> present, produces the behaviour the program expects in the uses it
> makes of it.
I think the de-facto rationale for a larger network goes like this:
-- You don't want to get your IPs blacklisted because infected clients
send spam from within your network.
-- Other sites will allow mail submission on their submission port only
after authentication (SASL).
So you block
> Can you post the build log for this and the
>
> /var/work/pkgsrc/pkgtools/pkg_install/work/libfetch/libfetch.a
>
> file itself?
attached (gzip-ed and .work.log renamed).
dot_work.log.gz
Description: Binary data
libfetch.a.gz
Description: Binary data
> For "reasons" I have been looking to build nss-pam-ldapd
I've already done that eight years ago: see pkg/49804.
And another weird problem:
Using a lang/gcc8 compiler patched to use gas and gld from devel/binutils
2.26.1 (see other thread), when building pkgtools/pkg_install, I get
/usr/pkg/bin/gld:
/var/work/pkgsrc/pkgtools/pkg_install/work/libfetch/libfetch.a(common.o)(.text+0x1e5):
[Adding tech-userlevel for the base system questions]
For involved reasons, I patched lang/gcc8 to use gas/gld from devel/binutils
(analogous to what is done to use gas on Solaris).
This makes lang/gcc8 fail to build, it segfaults (cc1 nil pointer reference
in etc_set_father() calling
I haven't investigated this further, but it worked to ktrace -p and
revealed openat() as the culprit. It's detected by autoconf on the -6 chroot on
-8 while -6 doesn't implement it.
> (a) I'd say it shouldn't stop ktracing
I suspect it stops as soon as sudo calls setuid.
> As root, ktrace -i the shell (or other process) it's started by.
That gives me a ktrace that stops in the middle of the GIO where
sudo is reading the sudoers file.
I have an interesting problem: How do you debug or ktrace a setuid binary
that exhibits the problem only when run as non-root?
(Specifically, this is sudo built for NetBSD-6 via kver in a chroot on -8
failing to read the timestamp files on real -6. When called as root, it
doesn't use the
> How about instead adding an option that sets the first name explicitly
> and keeps the "abort on failure" behaviour?
That looks like a much better idea to me.
> About the only argument for retaining csh that makes zero
> sense is to retain it for scripts.
I guess it's a matter of (varying) taste. I used to prefer csh at some time,
and that was definetely after V7 appeared.
Also, there are csh scripts out there. Anyone fully converted metamail
to sh?
> what difference does the user 'w' (or 'r' ... 'x' does matter) permission
> bit really make on a root owned file?
To me, it implies that the file should not be written regardless of the
fact that it technically can.
If you need the base version of a utility, why not call it by full path?
OTOH, if people need a newer version of foo, I install foo from pkgsrc and
want that to take precedence over the base version.
If I write a wrapper around bar, I put it in /usr/local/bin.
> if /rescue/tar is going to run gzip as a subprocess, it should have
> the full path /rescue/gzip (or gzcat or whatever) baked in so
> its behaviour doesn't depend on PATH.
Yes, that looks lihe TRT to me.
> Fortunately, I could /rescue/gzcat base.tgz >base.tar and tar x that
I also couldn‘t /rescue/gunzip base.tgz. Why?
I nearly locked myself out updating a server (from -6 to -8).
I booted the new kernel (single user), mounted /usr, /var and /tmp,
extracted base.tgz (excluding /rescue, fortunately), but had forgotten
to remount / rw.
After that (I interrupted tar), tar didn't work any more.
Well, I had
> No, this is just too early in the init sequence.
> It shouldn't be using err()...
Then someone(TM) should fix that?
Shall I file a PR?
EF> What I don't understand is why it dumps core while reporting an error.
KRE> Perhaps NetBSD 6 required an explicit setprogname() which is no longer
KRE> required?
But that's a matter of the C library, no?
> you could test with paxctl on the cmake file
With paxctl +m /usr/pkg/bin/cmake (inside the chroot, of course),
it now core dumps even earlier in the build, with
#0 0x0079d33c in
cmsys::SystemTools::FilesDiffer(std::__cxx11::basic_string, std::allocator > const&,
> Ktrace it
As mentioned, that doesn't work (well, it works, which is the problem).
> there are 3 err() calls in pthread__init()
Starting with
#8 0x71b551460ac0 in err () from /usr/lib/libc.so.12
#9 0x71b55240c47b in pthread__init () from /usr/lib/libpthread.so.1
I
> but it's got to mean _something_
Timing?
> Ktrace it
That, way, it proceeds past the error.
I can then interrupt it and proceed with a normal make build.
That core dumps again (later); ktrace-d, it proceeds past the error again.
Interrupt, proceed normal. core dumps.
Finally, I get a core dump with the ktrace-d run, but no sensible
In order to be able to build packages for -6 on a -8 machine, I set up a
subdirectroy in /var/chroot containing a tar-ed copy of a real -6 machine.
I then chroot into there with kver -r 6.1_STABLE /bin/sh.
I tried to build icinga2, but I cmake core dumps with this backtrace:
#0
> Make the script require CRITLOCALMOUNTED (in -current, or mountcritlocal
> in older versions)?
I don't get that. That wouldn't mount /usr, no?
My (second) question was about patching the binary so it would link to
libc, libm and libpcap from /lib, not /usr/lib. Or would it do that
Two probably very basic questions:
Is there a way to check whether an rc.d script was invoked from rc
(as opposed to running it manually, via service(8) or whatever?
During autoboot, rc_fast is set, but if I go single user and back multi user
or boot to single user and go multi user from there,
Oops, it looks like /usr/bin/printf will only exit non-zero because it receives
SIGPIPE. If called with SIGPIPE ignored, it will still exit 0.
Is it on purpose that sh's (at least, NetBSD-8's sh's) built-in printf doesn't
give a non-zero rc if the underlying write(2) fails (with EPIPE, in my case)?
It turns out that this
{ sleep 1; printf "Hallo" || echo "ERROR">&2; } | echo Foo
doesn't print "ERROR" with both sh and bash,
> Then add an option to wait [...] to indicate that wait should complete
> if the [...] process enters stopped state
I guess "enters stopped state" includes the case where the process already was
in the stopped state when the wait command was issued?
> My inclination is to go that way, rather
> I don't see a real problem with deciding to mount all local filesystems
> (marked auto of course) at mouncritlocal time.
What if /usr is on NFS and /usr/local is local?
> BPB is PC specific and linked to MBR if I'm not mistaken. What seems to
> me problematic is that you mention fdisk (i.e. MBR) first and the
> error message is about GPT...
I'm using MBR, not GPT. But fdisk provokes an error message about GPT.
> If you are trying to setup the machine for NetBSD only use
It's NetBSD only.
> - if you are UEFI booting from a FAT partition
No, it's plain old BIOS boot (the server is from 2005).
> - if you really want ffsv1 boot code, then sd0e better not be a FAT file
>system
sd0e is fstype RAID.
> I see no explicit indication of which port you're doing this on.
Ah, sorry, it's amd64.
What does
installboot: Old BPB too big, use -f (may invalidate filesystem)
mean?
I have a RAIDframe level 1 RAID consisting of /dev/sd0e and /dev/sd1e.
Now, sd0 failed. I replaced the disc, fdisk'ed and disklabel'ed it and
performed a raidctl -R, which succeeded. Now, I need to write the
> apart from patching collectd
For the record: https://github.com/collectd/collectd/pull/3954
> It is irrelevant to the questino you asked. But people often ask "how
> do I do XYZ?" when their problem is actually "how do I do ABC?" and
> they believe XYZ is the only way (or sometimes, the correct way) to do
> ABC. Such people are often wrong; there are often other ways to do ABC.
Ah, OK,
I'm confused. Is my english so bad that no-one understands what I'm asking
or is my understanding of SIGPIPE wrong?
> Can't you just close() the pipe?
Yes, of course. I wrote:
EF> Of course, when the tail exits, the head will get SIGPIPE as soon as it
EF> tries to output something, but can the
Is there a sane way to kill a pipe's head from within the pipe's tail, at least
on tail exit? Of course, when the tail exits, the head will get SIGPIPE as soon
as it tries to output something, but can the tail explicitly kill it earlier?
I just stumbled over the fact that NetBSD userland seems to be missing the
fuser(1) command mandated by (the XSI extension of) POSIX.
Is there any reason (other than "nobody cared") for that?
EF> Is there any cons[e]nsus among shell developers what the prefer[e]d
EF> behaviour is?
I just noticed that you understood "shell developers" as "people writing
shell code" whereas I originally meant "people writing shells".
But, of course, both are interesting.
> Incidentally, this means
I've noticed a subtle difference between our sh and bash when applying
test -nt to a pair of files where the first one exists, but the second
doesn't: In bash, the result is true (0), while with our sh (and /bin/test),
it's false (1).
Unfortunately, test -nt is not specified by SUS.
Is there
> However, I took a quick look at the source yesterday and it seems the
> code comes as 52 source files numbered 01-52, which is not, shall we
> say, entirely auspicious. :-|
Well, any decent C programmer would have called them z00.c through z51.c.
EF> Is there a way to make a process dump core on exit no matter what?
EF> I have a deamon dying (or whatever) from time to time with no trace to the
EF> cause and guess a backtrace from a dump would help.
KR> Start under a debugger, break on 'exit'.
I tried to set proc.$pid.stopexit, but when I
> devpubd does that in-tree.
OK. Is there a sane way of obtaining VendorId/ProductId in the devpub script?
Does NetBSD provide any framework that allows USB device ownership/permissions
to be autmatically set on USB VendorId/DeviceId?
E.g., if a USB device with VendorId/ProductId 06da/0002 appears and becomes
ugen0, do chown nut:nut /dev/ugen0.*; chmod 0660 /dev/ugen0.*
Is there a way to make a process dump core on exit no matter what?
I have a deamon dying (or whatever) from time to time with no trace to the
cause and guess a backtrace from a dump would help.
I just replaced a failed (SAS) disc in a RAIDframe RAID with an identical one.
Everything seems to have worked well, only fdisk utters
fdisk: Can't read secondary GPT header: Invalid argument
combined with a kernel message
sd0(ahd0:0:0:0): Check Condition on CDB: 0x28 00 04 47 e0
> This is elegant and I would like to see it. Just remove /usr entirely and
> collapse its contents into / - no /usr/bin, no /usr/lib, etc.
This thread started because syslogd lives in /usr, mounting of /usr
depends on NETWORK, and so network daemons are unable to log to syslog
(at least in the
> This is the whole purpose of METAFONT. METAFONT is a rasterizer.
I'm somewhat sceptical that the results will be usable at the low resolution of
a console frame buffer.
I once again ran into an oddity with bmake's .for loops.
It looks like that .if !empty(i:Mxxx) doesn't work if i is a .for loop variable.
Assigning the loop variable to another var makes it work.
Oddly enough, .if !empty(:U123:Mxxx) (outside a .for loop) works as expected.
[I'm aware that [0-9]*
> I was asked for truss(1) by Christos back some time ago. So here it is.
I'm surely missing something, but what's the advantage of truss over ktruss?
> IMO, they're both at fault.
I'm not at all an expert on the field of dynamic linking, but what strikes
me as odd is:
1. The dynamic linker should be able to notice that two libraries are
pulled in which export conflicting symbols and warn about it, no?
That would have saved me three working
I'm not sure at which level this needs to be dealt with.
libgs, in its infinite wisdom, exports SHA384_Update, which of course clashes
with OpenSSL's well known symbol of the same name. Which means that as soon as
you pull in libgs, your TLS may fail in mysterious ways.
[In my case, it was
> IIRC Irix had this, both for EFS and XFS.
No, as far as I remember and see, neither dump nor xfsdump had this.
I didn't actually start my O2, though.
> So, one solution to this might be to add a new builtin command
> something like this:
>
> specialvar variable ...
While I concur that there's a problem to be solved (looks like it may even
be a security problem to setenv RANDOM or the like), I guess such a change
will only make sense if
> only current use for the (posix "is undefined") relative path in $ENV is
> if the intent is to run the script relative to whatever directory the
> shell happens to start in. I doubt that is often intended.
I would guess the most probable intent is to run it from $HOME (and wonder
why it
> Y'all seem to think it's totally reasonable to telnet in the open internet
What's the problem with "telnet www.uni-bonn.de http"?
> send hate mail my way.
I guess you are over-looking my (and probably a lot of other network
administrator's) primary use case for /usr/bin/telnet: connect to a
HTTP/SMTP/IMAP/whatever port and speak the protocol.
> I'm considering, if it seems reasonable to those here, to change sh so it does
> not read profile files (any of them) from relative paths (simply ignore any
> such attempt).
Yes, that sounds reasonable to me. I don't know how many people's profiles
it might break, though. In the current
> X=/ cd $X
>
> cd's to $HOME, not to / ...
>
> This really violates the POLA, I'd say...
Depends on how much shell programming you do. I used to trip over it often
enough.
The point is that $X is expanded before X=/ is assigned. You run cd (with no
arguments) with X set to /.
> All other shells seem to not exit
As even dash seem not to exit: Did they change their behaviour on purpose to
match ksh/bash?
I guess it would be better to line up with ksh/dash unless there's some
compelling reason to keep the differing behaviour.
> But there's nothing in that bit that implies (to me!)
> "You can't subsequently call dirname(3) on the results of
> a previous call to dirname(3)".
You are calling dirname() on an argument that may be destroyed by
that very call.
You are calling dirname() on a possibly invalid argument.
> or are we restricted by some standard from having dirname(3)
> be able to be called on the results of a previous dirname(3) call
Not exactly restricted from, but
This is not strictly a bug; it is explicitly allowed by
IEEE Std 1003.1-2001 (``POSIX.1'').
> in which case we
I don't get that.
It looks like you are looking for a script that reads and understands the
documentation (which is wrong wrt. the current implementation) and would
get confused if you change the documentation to match actual behaviour?
Or are you looking for a script that reads and
> You're using an old version, not NetBSD current (or 8) right?
6.1, mostly (for the ash part), yes.
> and now the only way for a script to make a job vanish from the
> jobs table (and so, from being seen in the output of jobs -p) is
> to "wait" for it.
Surely you've digested what SUS says about
> You mean xargs -p, essentially?
xargs -L 1 -P (capital) would have done the job if
a) had I known about it (thanks for the hint!)
b) it were POSIX
I could probably as well directly mail kre@, but who knows.
The objective was to write s shell script that parallelized invocations of
some command, but only up to a certain number of jobs running in parallel.
There were two ideas to implement this, one using the jobs utility to track
the
A bit late due to vacation:
> To me, a command substitution that runs in the background seems weird
> and like something to avoid. Is there really a case where this is useful,
> or would it be reasonable to include a suggestion that it's best to avoid
> such a construct?
The case that led to
> It just stops after printing the package list:
1. What's the exit code?
2. If you run it with sh -x, do you see where it exits?
> I have susv4tc2.
AOL.
> It is specified
Possibly yes.
> but clarification should be done
Surely yes.
> Enclosing the full parameter expansion string in double-
> quotes shall not cause the following four varieties of
> pattern characters to be quoted, whereas _quoting_
>
It has been brought to my attention that quoting the "word" in sh's
substring processing causes word to be matched literally rather than
being treated as a pattern. I.e.,
x="abc"
y="?"
echo "${x#"$y"}"
outputs "abc", while
x="abc"
y="?"
echo
> Pages are only removed from swap when they are freed or accessed.
Ah, I see, thanks!
Can I find out which processes own pages that are paged out?
EF> It appears to me that swapctl -l lists how much of the swap devices
EF> have ever been in use since they were configured.
JS> No? It seems to list exactly how much space is currently in use.
Sorry, I was confused by sysstat vm not showing any paging acivity.
Looks like I have some daemons
It appears to me that swapctl -l lists how much of the swap devices have ever
been in use since they were configured.
Is there a way to display how much swap is currently in use in the sense of
"how many pages are currently swapped out"?
Maybe due to my lack of undestanding of vm the question
> Won't O_NONBLOCK cover this?
No. POSIX says:
O_NONBLOCK
When opening a FIFO with O_RDONLY or O_WRONLY set:
If O_NONBLOCK is set, an open() for reading-only shall return
without delay. An open() for writing-only shall return an error if no process
currently has the file
> similar to the -x option available in find(1)?
YES!
It appears to me that empty(), defined() etc. do not work on .for loop
variables, at least not on NetBSD 7's make and bmake-20150505.
Assigning the loop variable to anothe rintermediate var seems tu cure it.
.for i in aXa bYb
.if defined(i)
.info DEFINED
.else
.info UNDEFINED
.endif
.if
> there might be NetBSD applications currently which are assuming
> that the input string is not modified by these functions
I'd be heavily surprised if that change wouldn't break half (OK, 10%)
the consumers, either because they call both functions on the same path
argument or because they
> What "to standard error" means there, that is, which version of stderr,
> isn't clear.
So, can anyone imagine a use case where "follow whatever stderr happens to
be subsequently redirected to" (current behaviour) would make more sense
than "whatever stderr currently points to" (after your
This looks very useful to me. I guess SUS doesn't specify this?
> For this, stderr is remembered only when tracing turns from off to on,
> if it is on already, and another "set -x" is performed, nothing changes.
I can't unambigiously parse that. On second reading, treating the comma at
the end
EF> Ah yes, of course. Stupid me. Thanks.
So what I've learned (thanks!) from this discussion:
Calling getaddrinfo() with a hint of AF_INET/AF_INET6 means "if you try hard,
can you make this a IPv4/IPv6 address" (e.g., look up 1.2.3.4.numerical.org
or ::1.i-like-colons.org)
If you want "does
> At least inet_pton parses a numerical IPv4 addresses without any dots.
Despite the man page claiming so, it actually doesn't (on 6.1):
#include
#include
#include
int main(int argc, char *argv[]) {
char buf[16];
printf("%d\n", inet_pton(AF_INET, "1", buf));
return 0;
> I suspect there's some misunderstanding.
Yes. It's about numerical IPv4 addresses being looked up with an AF_INET6 hint.
check_ping tries to figure out whether it needs to call ping6 (suppose
wer'e on a system where ping6 is different from ping).
Suppose that check_ping is invoked without
> That's what AI_NUMERICHOST is for?
No (or so I think).
I would like to save the resolver lookup if we know beforehand we don't need it.
> It's not clear whether it should or should not parse the behavior
I can't parse that sentence.
What's wrong with the following argument?
1a. domain name
I have no idea why one would wnat to do what you intend to do, but you could
use the Linux emulation and the SuSE compat packages in pkgksrc.
> However, there's another way which comes pretty close - the process group id
> assigned is (in practice, and perhaps required) always the process id of the
> process group leader
I think it's required:
If the calling process is not already a session leader, setpgrp() sets
the process
> For what little it's worth, here's where this silly requirement can be found
> (in case you're still looking for it):
>
> http://pubs.opengroup.org/onlinepubs/9699919799.2016edition/utilities/V3_chap01
As this is in the "introduction" section and there's a more precise (and more
sensible)
> This leads to the crux of the matter - I have been told that POSIX
> actually requires that all of the commands in this third category (actually
> all the sh built-in commands, except the special built-ins) have an
> executable that can be subject of an execvp(2) call. The second group
>
> IMHO that problem was already faced by supervisor's authors - for
> example s6's author puts some thoughts and summaries on their pages:
But there's a difference between a general-purpose notification mechanism
and a process notifying it's (grand)parent exactly once upon statup, no?
I would suggest clarifying the documentation that the test returns false
if either file doesn't exist.
And perhaps add a CAVEAT that other shells have different semantics in case
one of the files is missing.
I can't make sense out of the ksh bevaviour. I could make sense out of
"true if file2
> The list in _Advanced Programming in the Unix Environment_
That list answeres just a tiny subset of my questions (mainly, that indeed
SYSV is the system where a session leader automatically acquires a control
tty if it happens to open a tty).
Strangely, it doesn't mention the re-parenting at
> That's quite the editorial liberty you've taken there.
> I'm speaking of our Almquist derivative, not dash.
To fully quote from TLS's statement and your reply:
TLS>
In the direction you seem to be headed lies the true and vivid idiocy of
the Debian shell, which is *larger* than our shell
TLS> I strongly disagree and note the obvious internal inconsistency in your
TLS> argument (such as it is):
I> If you want features for a scripting environment, use a different shell.
I>
I> The /bin/sh is an environment intended primarily to execute scripts.
I> In what way is this inconsistent?
> I can create a simple CLI tool for it, but I won't be able to manage
> ones that require heavy use of javascript or captchas. Is anyone's
> captive portal requiring that?
>
> I would like examples (wget -r, please) of captive portals.
With the one I wrote, you simply need to do a HTTP Basic
1 - 100 of 116 matches
Mail list logo