-
rwp
polyex, Which logs? messages? Or auth.log? messages is already 644, right? But auth.log is 600 due to the sensitive nature of it.
-
rwp
If you are the only one on the system and it is on the LAN not WAN then that seems acceptable. I wouldn't do it on a public server machine because it might be used as a chain to something else if there is a first exploit.
-
polyex
daemon logs like postgres
-
rwp
I am not familiar specifically with postgres but that seems like it would be reasonable to be 644 there.
-
rwp
Another frequently configured way is to make the group of the logs readable by group wheel or a group like adm and then add yourself to that group. Then you and only you can read the logs easily by group permissions but other users are not allowed.
-
rwp
To change the group of a logfile of course the /etc/newsyslog.conf file can list the user:group in the 2nd column for that logfile and set the mode to 64something.
-
polyex
tyvm
-
scoobybejesus
This is what I get when I run liquidsoap -h icy.update_metadata (in a jail, in a non-root user shell running bash) (it's filled with escape codes)
bsd.to/O5W7
-
VimDiesel
Title: dpaste/O5W7 (Plain Text)
-
scoobybejesus
it would be nice to understand the cause. it seems they have some sort of colored log. maybe the pager (on this box that has no X or anything on the host or in the jail) is expected to behave differently
-
pkubaj
VVD: blender builds on BE after all
-
polyex
why are so many rc.d files 655? they should be 555 i think
-
polyex
like rsyncd
-
polyex
should rc.d scripts have "networking" or "NETWORKING" for the REQUIRE: field?
-
angry_vincent
got thinkpad t480. now install time
-
lw
polyex: NETWORKING, but whether it's case sensitive is not documented
-
lw
at least not in rcorder(8)
-
dch
Gotta be uppercase
-
lw
des@ vs /usr/sbin/adduser. FIGHT!
-
lw
-
polyex
dch why does it gotta be uppercase? because it's a special purpose symbol and not an actual rc script name?
-
polyex
lw in man rc there's a "ALLUPPERCASE" about these virtual REQUIRES items
-
lw
it's not exactly virtual
-
lw
-r-xr-xr-x 1 root wheel 287 Apr 15 22:04 /etc/rc.d/NETWORKING*
-
polyex
s/virtual/dummy
-
lw
if you want to ask why it's uppercase you probably need to take that up with lukem
-
entikan
my hostname is changed but not in my /etc/rc.conf
-
entikan
changed to "ConnectOn" but I have no idea why.
-
entikan
also, is there a way to disable starting firefox as certain users?
-
rwp
entikan, Generally speaking if the hostname became "ConnectOn" then I would look for that string because I suspect "hostname [options] ConnectOn" was applied somehow.
-
rwp
Back on HP-UX which does not support any options it was pretty common for people to run a script and their hostname would become "-f" due to the linux world's proclivity to use "hostname -f" to read out the hostname as a FQDN by reverse DNS lookup. It happened quite a bit.
-
rwp
entikan, Re: blocking users from running any particular program. Generally no. Because a user can always simply copy in a program from elsewhere.
-
rwp
One could remove programs from the system. But then I could always copy that program in from elsewhere into my home directory and run it from there.
-
entikan
grepping the whole disk for "ConnectOn" doesn't show anything. But it did happen after logging in to someone elses router. Perhaps it happened there?
-
rwp
Or I could compile the source code and have a natively compiled executable.
-
rwp
By some chance is the host setting the hostname to the reverse DNS for the IP address that it was dynamically assigned by DHCP?
-
rwp
That always seemed crazy to me but RHEL/Rocky/Alma/CentOS do exactly that! It's an unreasonable configuration to my sensibilities but they do.
-
entikan
rwp: That's fine, it's just for myself. I need firefox for some administrative purposes but I'd rather have some hoop to jump through for before it starts up (logging into a seperate user for it for example) or I get sucked into old habits
-
entikan
how do I check the reverse DNS?
-
rwp
If it is just for you and you want to restrict an executable to some particular user then chmod go-x,u+x and it will be executable only by that user that owns it, and then set the owner to the user you want to be able to execute it.
-
rwp
Or alternatively the same thing using group permissions. Actually... Using group permissions for that is probably more sensible.
-
rwp
Using one of "host", "dig", or "drill" look up the IP address. For example looking up "host 142.250.72.69" here says "69.72.250.142.in-addr.arpa domain name pointer den16s09-in-f5.1e100.net." (That's mail.google.com by the way)
-
entikan
I'll try that out next time I'm logged into that network, thanks!
-
entikan
and I'll look into group permissions, this is very helpful yaaay
-
rwp
For dig it could be "dig -x 142.250.72.69 +short" and for drill basically the same syntax as dig almost always.
-
lw
do not dig
-
lw
omg what will you find
-
lw
there could be anything down there
-
lw
if god wanted us to dig we would have been born with /usr/bin
-
ferz
Hi.
-
ferz
I need to truss a command. How can I avoid following error?
-
ferz
truss: Unable to enable LWP events for pid 99999: Operation not permitted
-
ferz
Which permissing I've to grant to this user to be able to execute truss?
-
ferz
s/permissing/permission/
-
rwp
lw, If dog wanted us to wear clothes we would have been born that way! :-)
-
ferz
security.bsd.unprivileged_proc_debug is enough?
-
CountryBall0
github.com/freebsd/freebsd-src/blob/main/sys/amd64/conf/NOTES ---- from 'CPU OPTIONS' , '# Options for CPU features.' is empty. from where i can look up to for avaible choices for 'options for CPU Features' ?
-
VimDiesel
Title: freebsd-src/sys/amd64/conf/NOTES at main · freebsd/freebsd-src · GitHub
-
ndo-
hello!
-
VVD
CountryBall0, AFAIK there is only one for amd64 - "cpu HAMMER"
-
ndo-
i cant interact with the installer because keyboard is acting funny on a very old hp laptop (from 2006). not a single key is functional, not even arrows, enter, tab... nothing. jsut shift seems to act like enter. any advice? thanks!
-
VVD
ndo-, can you connect USB keyboard?
-
CountryBall0
VVD, below that there is 'options for CPU features' tho and it doesnt listed any options for 'cpu HAMMER' , its blank. what are the CPU feature options for 'cpu HAMMER' tho ? (at sys/amd64/conf/NOTES 'options for CPU features' is blank :/)
-
ndo-
VVD: gonna try.
-
VVD
CountryBall0, this part is template - check NOTES for i386.
-
CountryBall0
VVD, yes it seems i386 NOTES file has that 'cpu options' . so from this I should understand as; amd64 has only 'cpu HAMMER' option and no CPU features options as kernel options? (thanks btw for pointing to the i386 notes)
-
VVD
CountryBall0, probably yes.
-
ndo-
VVD: its working with the usb keyboard
-
ndo-
but if i manage to install the whole thing i'll be stuck with the external keyboard i guess
-
polyex
if my rc.d script needs networking and daemon, i only need to specify REQUIRE: DAEMON right? because DAEMON implies networking too because DAEMON has REQUIRE: NETWORKING
-
VVD
ndo-, try to install using it and after reboot from disk check internal keyboard
-
ndo-
VVD: ok thanks
-
CountryBall0
VVD, thanks
-
mrelcee
I think thats a lot of whst actually bothers me, since i spend way more time tending to BSD and Leenoochs systems from my mac desktop - and Unix just flat out lets you juggle running chainsaws and play russian roulette with a semi auto if you want... so getting nerfed on stuff on my desktop stings
-
mrelcee
.
-
ndo-
VVD: ok, installed
-
ndo-
VVD: no internal keyboard, same behaviour
-
polyex
what's better style, cmd --foo=bar or cmd --foo bar?
-
rwp
polyex, How long is a piece of string? Personally I prefer --var=foo style when using long options.
-
polyex
why?
-
rwp
It just clumps the entire set of characters together visually and I think makes it more visible what is happening.
-
rwp
But "--var foo" is also valid. It's valid so I can't say it is wrong.
-
VVD
ndo-, :-( maybe u have options in BIOS?
-
ndo-
VVD: i dont know, i'll just finish to setup DE and then try to investigate
-
ndo-
i dont even know what kind of information to look for
-
mrelcee
Rwp: its as long as the universe needed it to be
-
VVD
ndo-, something about keyboard
-
VVD
btw, maybe u can configre keyboard in DE
-
polyex
any upside to having daemons log to their own log file instead of just dumping it all into syslog?
-
rwp
mrelcee, Right! And since there are likely three different valid forms for -v foo, --var=foo, --var foo, all being valid I think all are valid. But I prefer --var=foo visually.
-
rwp
Various programs have different option processing however. There are a lot of variations.
-
rwp
polyex, Programs which generate A LOT of output tend to use their own log file. nginx/apache dump a lot of output for example and tend to write to their own log file.
-
rwp
It's a judgement call for the program. If something is going to completely dominate a file with output then I would put it into a dedicated log file.
-
rwp
If something is going to occasionally make a log entry like cron or something then using the existing system log framework is most appropriate.
-
polyex
hm
-
rwp
polyex, WDYT?
-
polyex
well just to make monitoring easier, i kinda want to just stuff everything possible into syslog. but i also want to limit logging output to warns or higher severity
-
rwp
Then I say just do it. Often things just need to be done in order to know if it is the right thing to do or not. Then make corrections only if needed.
-
mrpops2ko
how do i adjust the msi-x interrupt vectors on my nic? i've been looking at the iflib settings to see if i can gleam where they are but im winging most of it
-
polyex
rwp also i run into probs where i don't know to look in /var/log/messages or in /var/log/mydaemon/mydaemon.log for daemon probs
-
polyex
not like it's hard to check but stuffing everything i can into syslog helps reduce that
-
polyex
got a opentelemetry-collector running as a daemon. it's made in Go. when i run sudo service otelcol restart log file says "Error: failed to shutdown service after error: failed to shutdown pipelines: sync /dev/stderr: invalid argument; sync /dev/stderr: invalid argument". anyone know what that means in Go code?
-
ketas
polyex: but does it otherwise work?
-
polyex
ya
-
ketas
i wonder what daemon even does with stderr
-
rwp
Is that daemon running in a container? Does the container have a /dev/stderr and if so is /dev/fd mounted?
-
rwp
I am one of those people who despise seeing /dev/stderr because it creates this extra dependency that isn't otherwise needed. Just write to fd 2!
-
polyex
ya it is running in a container
-
rwp
Does the container set "mount.devfs" for it?
-
polyex
ls -la /dev/stderr -> fd/2
-
ketas
oh indeed
-
rwp
Right. And therefore /dev/stderr depends upon /dev/fd having been mounted. That's an extra worthless dependency that shouldn't be required.
-
polyex
jail's config has mount.devfs in it yet
-
polyex
ya*
-
ketas
those files are useful for scripts
-
ketas
only scripts
-
ketas
/dev/std*
-
ketas
@files"
-
ketas
"
-
rwp
Well, then /dev/stderr should work. I would jexec into the jail and verify that it works. If so then the problem is somethign else.
-
polyex
how do i verify it works?
-
rwp
ketas, It's only extremely rarely useful in scripts.
-
ketas
opening that in some other code is wtf
-
rwp
polyex, "jexec -l jailname login -f username" (username is possibly root) and then ls -ld /dev/stderr /dev/fd/2; echo foo > /dev/stderr and see if it works there.
-
ketas
well if it's not written to have - thing or separate option, sometimes some util can open stdin "file"
-
polyex
rwp that echo'd "foo"
-
ketas
limited use, yes
-
rwp
ketas, People use /dev/stderr because they read it somewhere and learned about it but it didn't even exist until like 1999 or something.
-
polyex
how do i disable it?
-
polyex
if it's just a hack
-
polyex
is it just a hack or an actual improvement?
-
rwp
<rant mode> So in a shell I want to print an error: echo "Error: this thing failed" 1>&2
-
ketas
1>&2?
-
rwp
polyex, It's just a hack but if that is not your problem case then I would not touch it. Instead your daemon has some other reason it is printing that error message. Keep looking for the root cause of that error.
-
polyex
should i take "mount.devfs;" out of my jail config?
-
rwp
ketas, If you are not a shell programmer then that is gobblygook. 0 is stdin, 1 is stdout, 2 is stderr. echo prints to stdout 1 by default. 1>&2 assigns fd 2 (stderr) into the fd 1 (stdout) so that when echo prints it then prints to 1 which is mapped to stderr.
-
ketas
well 1> works too
-
ketas
stdout is assumed by default...
-
rwp
On the command line both stdout and stderr go to the terminal. So both will appear to "work" such as it is. But in a script if you redirect stdout then stderr should continue to go to the terminal.
-
rwp
The idea is that errors happen out-of-band to the normal flow so that you see them.
-
ketas
sometimes it's annoying too
-
rwp
grep foo file1 | awk '{print$2}' | tr a b | sed ... you get the idea. If any of those print an error then the error goes to stdout and NOT into the stdout going into the pipeline.
-
ketas
have | less, stderr doesn't go there
-
ketas
:p
-
rwp
The order of assignment is important too. That's why if one wants to discard all output it is "if grep foo file1 >/dev/null 2>&1; then" in that order > then 2>&1 and not a different order.
-
ketas
i think most don't use redundant 1>
-
rwp
The first > sends fd 1 to /dev/null and the next 2>&1 assigns fd 2 to the same place as fd 1.
-
ketas
hence wtf
-
ketas
is there a shell that required fd number?
-
rwp
"1>" is just the same as ">" so not really the idiom. It's okay to have it there. It's redundant as you say. But we started of with why one does not need /dev/stderr usually almost never.
-
rwp
AFAIK there has never been a shell that required a number there.
-
ketas
yeah, shells, perl, python, c, they all allow you internal stderr usage
-
ketas
so no idea why
-
ketas
something something easier?
-
ketas
we have urandom too
-
ketas
you don't really need to open that "file"
-
ketas
but i get the idea
-
ketas
it's always there, as a "file"
-
polyex
rwp so that bug is from somewhere else?
-
polyex
got a opentelemetry-collector running as a daemon. it's made in Go. when i run sudo service otelcol restart log file says "Error: failed to shutdown service after error: failed to shutdown pipelines: sync /dev/stderr: invalid argument; sync /dev/stderr: invalid argument". anyone know what that means in Go code?
-
polyex
that 1
-
rwp
What bug?
-
rwp
I guess I don't know if that is a bug yet.
-
polyex
well is the OS working right?
-
polyex
the container
-
rwp
Sure it produced an error message. But neither you nor I know what that error message actually means at the root cause of it yet. I can't say it is a bug yet.
-
rwp
I don't see anything leading me to believe the jail container is not working right.
-
polyex
ok ty
-
rwp
I mean jails have been around for years, are very mature, people run thousands of programs in them, and then this one program is giving an error message. I am more likely to think this one program is where the problem is located.
-
rwp
But until I would get to the root cause of it then I don't know if it is a bug or not.
-
polyex
putting that aside, would you disable the /dev/stderr hack?
-
polyex
like so /dev/stderr doesn't even exist
-
rwp
Nope. I would let the jail mount /dev and just keep moving with it there. It doesn't hurt anything to have it and then programs that use /dev/stderr will work without changes. (Even if I don't like that they are using it.)
-
polyex
ok so your containers have mount.devfs; too?
-
rwp
Yes. I always have those in my jail.conf file globally.
-
rwp
Reading that error message seems like quite a bit of gobblygook to me. "sync /dev/stderr: invalid argument" What's it really doing there? is it calling fsync(2) on the fd and it is producing an error? Perhaps the fd is closed at that moment? Maybe.
-
polyex
ok ty
-
polyex
the app is being run by daemon
-
rwp
Do you have the source to this Go-lang program?
-
polyex
-
VimDiesel
Title: GitHub - open-telemetry/opentelemetry-collector: OpenTelemetry Collector
-
rwp
Also if run under daemon with -f it will redirect stdout, stderr to /dev/null so that it is a bitbucket receiver. But sometimes I see people /close/ the fd and that could cause an invalid argument error for example as fsync(2) on a closed fd would do that.
-
polyex
my rc.d command line for it is daemon --output-file=/var/log/otelcol/otelcol.log --sighup --supervisor-pidfile=/var/run/otelcol/otelcol.pid --close-fds /usr/local/bin/otelcol --config=/usr/local/etc/otelcol/otelcol.yaml
-
polyex
tried -f and no 0f
-
ketas
hmmm
-
polyex
-f
-
rwp
Hmm... "--close-fds" but that's an argument to opentelemetry-collector, right? So that /shouldn't/ be the problem.
-
ketas
daemon is really cute util btw
-
polyex
no that's to daemon rwp
-
ketas
that's also a hack kind of
-
rwp
daemon is great! :-)
-
ketas
just close fd's and fork off
-
ketas
but then it also catches pids and restarts if needed
-
rwp
When I read the man page for daemon I see no --close-fds listed there. Is that new in 14? I am still on 13.
-
rwp
It's new in 14.
-
polyex
it's same as -f
-
polyex
i'm on 13.3
-
rwp
daemon -f does not close file descriptors though as they are redirected to /dev/null.
-
rwp
I think 14 introduced a bug in that they say --close-fds redirects but then they are NOT closed! BUG! Gack.
-
rwp
It was introduced in 13.3 and 13.2 does not have that option.
-
rwp
This is just one of those examples of things that get worse instead of better. Oh well. Corey Doctorow was right.
-
» rwp can't upgrade past 13.2 yet because my radeonkms driver from ports is tied to the kernel in 13.2 and I rather like X working and haven't had time to compile a new version for myself
-
CountryBall0
# Do we want the config file compiled into the kernel?
-
CountryBall0
INCLUDE_CONFIG_FILE opt_config.h <<--- what happens if we dont compile kernel config file into the kernel ?
-
rwp
ketas, I generally agree that programs should turn themselves into daemons as needed. It's not that difficult. But...
-
rwp
Oh look at the time! I must run off. Good luck!