-
shbrngdo
burie - can you create a 2nd virtual hard drive for output and then point /usr/obj at it? just a thought [then you can compress and save it when done]. Just temp add to fstab after setting it up for your VM so it loads on boot.
-
shbrngdo
(format UFS simplest)
-
shbrngdo
I sometimes do this kind of thing on embedded devices like RPi if I do not use a cross-compile, allows me to use NFS even for the output files or an external USB drive
-
drijen
gents, i have a fresh install of bsd that im configuring, and after putting up pf, i see i have 3 persistent connections to ips in amazon's cloud. its driving me up a wall trying to figure out what is talking; any ideas
-
drijen
is it pkgtool?
-
Jeanne-Kamikaze
I'm a noob, but doesn't lsof do that?
-
kevans
sure. sockstat should as well
-
Jeanne-Kamikaze
Ah, cool. Clearly, if neither lsof or sockstat report anything, then you have an NSA backdoor. :)
-
drijen
thats exactly it
-
luke_jobless_sb
shbrngdo: it's opinion that rpi should be categorized different from embedded system unless you touch baremetal. you may miscommunite with others.
-
l00py
rwp you were right about the unable to setup mem prob not being zfs arc. i needed to destroy the vm then i could start it fine
-
l00py
bhyvectl --destroy
-
dch
considering adding a 3rd vdev to my main zpool mirror, on a large box downstairs, via iscsi, as a temporary backup.
-
dch
its 1GiB network only so copying ~ 1.5TiB will take a while
-
l00py
is that like your version of the meme "feeling cute might expand my zpool"?
-
dch
heh. no, its a prudent move (3-way mirror) while I upgrade the firmware on the 2 nvme in the zpool
-
shbrngdo
luke_jobless_sb - good point, though I always seem to be using them for embedded systems, touch screen controllers basically. working on one todY ctually
-
s2r
Does anybody run Syncthing?
-
zip
I do, though not on FreeBSD
-
rtprio
s2r: i do, on many platforms
-
rtprio
drijen: did you figure out what your rogue connections were?
-
s2r
rtprio: me too, I wanted to know if you had any issues with cpu consumption.
-
s2r
rtprio: I've got it in a jail and it consumes almost the same as a vm running linux+mssql. I read about kqueue but I wanted to know if anybody was able to fine tune it.
-
rtprio
i don't notice anything; it has several of minutes of cpu time over the past two months, my system's not pegged or anything
-
rtprio
s2r: i think it can also depend on your workload, if it's watching, say, your mp3 library continously, rather than every 12 hours
-
s2r
rtprio: I sync "My Documents" from different laptops, my thunderbird archived emails and also my photos folder however I paused the last one. I will try changing the frequence.
-
s2r
frequency, sorry
-
rtprio
PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND
-
rtprio
90783 elliot 1 68 0 32M 22M select 6 227:13 0.39% tmux
-
rtprio
74952 elliot 159 34 9 1586M 172M uwait 5 137:59 0.00% syncthing
-
rtprio
I do not know if that's a lot or a little cpu time
-
s2r
PID JID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND
-
s2r
34035 3 983 15 97 9 1525M 215M uwait 2 71.3H 0.01% syncthing
-
s2r
rtprio: uptime 52 days.
-
dch
huh is `ctl(1)` single threaded?
-
ivy
if anyone uses databases/prometheus-postgres-exporter, please feel free to test this patch to update to 0.16.0:
bugs.freebsd.org/bugzilla/show_bug.cgi?id=282695
-
ivy
(i feel that i may be the only person in the world who uses freebsd and postgres and prometheus, but who knows!)
-
Hecate
ivy: so do I! although this week is pretty hectic for me, I'll try after wednesday :)
-
last1
is there a program or script that can run some commands, and if any of them fails, to e-mail me the output ?
-
ek
last1: Sure. You can do that in a script quite easily.
-
ivy
last1: is this is for cron, i usually use a wrapper script that runs the command and emails the output to root on failure, which is fairly easy to write
-
ivy
then just use 'set -e' in your actual scripts so they abort on failure
-
ivy
Hecate: if you test it and it works, please leave a comment on the bug with your freebsd version/arch as this helps committers see that the patch works
-
last1
well, it is for cron, but I want it to run like 5-6 commands, one after another, so I'd rather put it in a shell script
-
last1
vs 5-6 cron entries
-
ivy
i don't mean you have 5-6 cron entries
-
ivy
i mean you have one cron entry which is like '/usr/local/bin/cronjob /usr/local/bin/my-actual-script'
-
rwp
Write a script. Have the script save up output and email upon an error. Call the script from cron.
-
ivy
my-actual-script uses set -e, and cronjob just runs it and emails the output to root if it exits <> 0
-
last1
yes, but that script runs itself 5-6 commands, so so it's irrelevant on whether the script itself fails or succeeds
-
last1
(I guess)
-
last1
I care about the status of each internal command
-
ivy
set -e causes the script itself to fail if the commands it runs fail
-
rwp
As a counter point, I am in the camp that does not like set -e because it doesn't do what people think it does.
-
rwp
-
rwp
Don't let that it is a bash faq fool you. I always use /bin/sh for scripts and the same applies.
-
cracauer
For the symbolic names in /dev/ufs and /dev/diskid, how do I find out why /dev/ada or /dev/da device they map to? It was geom-something.
-
rwp
?? geom -t ??
-
cracauer
Thank you!
-
rwp
I am mostly using zfs not ufs, I am using gpt labels not glabel labels, but I am hoping that still produces the info.
-
last1
may be overkill but I asked chatgpt to write me a perl script that runs commands and e-mails me in case of failure
-
rwp
If something is worth doing then it is worth doing to excess.
-
rwp
I have a strategy where with anything I run by cron I use a semaphore so that on a busy system a command that doesn't finish before the next one starts won't make the system load climb endlessly trying to start more cronjobs.
-
rwp
I then create a temporary file and redirect all output to the temporary file. But using a temporary file requires signal handles to cleanup when interrupted.
-
rwp
Then if the task has an error I mail the contents of the temporary file.
-
rwp
This is a template of what I do.
paste.debian.net/plain/1335215
-
ivy
last1: why would you use perl for that, it's like 5 lines of shell script
-
rwp
I think the shell is better for it too. The basic being: if ! somecommand; then echo failed | mailx -s error $(whoami); fi
-
last1
seemed easy, but then I wanted to use a remote smtp server
-
rwp
Configure dma to use the remote server. And then everything from then forward that sends email on the system works.
-
rwp
(I am a postfix fan but dma is in fashion these days.)
-
last1
rwp: I use semaphores too, in fact, since I love Perl, I use a module to ensure a script only runs if no other instances exist
-
last1
but I find that even so, somehow, semaphores get stuck
-
last1
I need to use ipcrm to get rid of them
-
rwp
Stale semaphores are a problem! (shrug) It probably means that the program is exiting by some route that is not cleaning up the semaphore.
-
rwp
In perl if fcntl() locks are used then the kernel will guarantee that cleanup when the creating process exits. That should resolve the problem.
-
rwp
In shell, what I am using, there is no easy way to do that. So I drop a semaphore-dir in /tmp and my systems clean /tmp on boot. I almost never see problems but sometimes a system will hit the ground and start digging and I will reboot the system and that guarantees that everything will have a clean start after a reboot.
-
ivy
rwp: do you often create semaphores in shell scripts?
-
ivy
i'm not sure i ever had a use case for that
-
rwp
ivy, Only in cron scripts. It's only in cron scripts where there is a danger of the cron not finishing before the next cron starts a new one. In that case the semaphore prevents repeating cron tasks from continuously stacking up new processes and making the problem worse.
-
rwp
Something that runs once a day is almost never going to be a problem. But something that needs to run, say, every five minutes, definitely runs into a danger of having processes create too many more processes and overpopulate the system.
-
rwp
That can happen for network file systems that get wedged. That can happen with bare metal local file systems that are suffering some failure. And for other reasons.
-
rwp
Sometimes I am running a find and delete cleaner on what starts out as a small directory of files used for something and then over time the directory grows to ten godzillian files and it takes a long time to run, perhaps too long, especially if something else has pushed out the read cache causing things to run even slower. Just as an example of how bad things can happen.
-
ek
rwp: I do the same thing. Especially for backups and cleanups, like you're mentioning.
-
rwp
I am also working with other people and not writing everything myself. I like to have a little safety net built into other people's code.
-
rwp
Backup! My desktop one time started to take more than 24 hours to complete the backup. It was always eventually successful. No errors. But then I noticed that things were slow and saw I had overlapping backups running!
-
last1
yeah, exactly, semaphores are good for that
-
ek
rwp: Exactly!
-
ek
And, I too dump to tmpfile and email the contents of said tmpfile if anything exists with non-zero (usually.)
-
rwp
It's a time honored strategy! :-)
-
ek
Yep. It simply works and I don't need to put a lot of time or energy into it. Set it and forget it.
-
cracauer
rwp, do you know that in bourne shell scripts you can trap on EXIT, same way as a signal handler? I use that for cleanup.
-
rwp
cracauer, I do. And I do use that. That's so my cleanup handler is always exercised even in the normal script exit.
-
rwp
If you are Martin though then I know you know that different shells handle that differently. For example in bash the EXIT trap is triggered upon interrupt too. But dash does not so those signals must be associated explicitly.
-
cracauer
Ah. Good to know.
-
rwp
I see your nick and I am thinking:
cons.org/cracauer/sigint.html
-
cracauer
Yeah, that's me.
-
rwp
Respect! :-)
-
rwp
I figured you saw my paste earlier and were commenting upon it.
paste.debian.net/plain/1335215
-
cracauer
Didn't see that, no.
-
rwp
One of the problems that often happens is that people write code that needs an at-exit type of cleanup. And they call it at exit time.
-
rwp
But that also needs to happen upon signal handling exit time too.
-
rwp
But a lot of people then do that again in the signal handler. That violates the DRY principle Don't Repeat Yourself.
-
rwp
I feel that the cleanup should always be called the same way for both of those cases so that it is always exercised.