Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Nitrousoxide
May 30, 2011

do not buy a oneplus phone



Does that bypass the normal safeguard against
code:
rm -rf /
? I know bash will normally refuse to execute that, though it will execute
code:
rm -rf /*
I'm not really eager to test it for obvious reasons.

Nitrousoxide fucked around with this message at 02:35 on May 20, 2024

Adbot
ADBOT LOVES YOU

Volguus
Mar 3, 2009
I don't think it's bash, but rm itself refusing to do that kind of damage. You can do it in a VM, though, no harm there. Do not, under any circumstances, execute that on a real machine. Though it is fixed now with the latest kernels, it used to be possible to remove UEFI variables in /sys as well, and you could end up with a bricked machine. As in ... dead dead. Maybe possible to revive on motherboards that can update UEFI from USB stick, but I don't know if anyone really tried it.

Just ... dont.

BlankSystemDaemon
Mar 13, 2009




Klyith posted:

The Unix philosophy is a program should do one thing and do it well.

Systemd does one thing and does it well. It manages the system. Perfectly compliant with unix philosophy.
You forgot the part about handling text streams, and it being a universal interface - and yet journald uses binary files.

Klyith
Aug 3, 2007

GBS Pledge Week

BlankSystemDaemon posted:

You forgot the part about handling text streams, and it being a universal interface - and yet journald uses binary files.

Ooof. Time to re-take Unix Philosophy 101 in summer school. One cannot correctly interpret the sayings of the great sages of the ancient world when one is confused about the difference between a stream and a file.


(Meanwhile, storing logs as a basic database is such an amazing quality of life upgrade that even if some dude in the '70s had said "all files should be plain text", they should be regarded as clearly wrong by all intelligent people. A plain text log was ok when a computer did less stuff and a database was non-trivial overhead. But a modern machine runs so many things at once that some organization is a self-evident improvement.)

xzzy
Mar 5, 2009

My main complaint with journalctl is opening the log and then hitting shift+g to get to the end. It takes way too long to process as it seeks through the whole database.

However, if you run journalctl -r it reverses the log and you can see the newest messages instantly. journalctl -f is instant too.

'view /var/log/messages' can jump to the end a text file is also instant. I know it's a different workload but that's the response I crave.

:iiam:

Voodoo Cafe
Jul 19, 2004
"You got, uhh, Holden Caulfield in there, man?"
systemd's binary logging is something that i'm ideologically opposed to, at least in theory. my first instinct is still almost always to grep a bunch of text files. but in practice i've had literally zero issues with it, and journalctl -xefu $UNIT_NAME is much better than trying to remember which log file in /var/log corresponds to which service

in general i think systemd a bit over-designed but the network effect that it has in simplifying the implementation of _other_services (not having to roll your own pid/lock files, log management and rotation logic, double-fork daemonization, resource limits, parallelizing/mandating service dependencies, etc) is really very valuable

i know FreeBSD was experimenting a few years ago with openrc as a replacement init system, did that ever go anywhere?

BlankSystemDaemon
Mar 13, 2009




Voodoo Cafe posted:

i know FreeBSD was experimenting a few years ago with openrc as a replacement init system, did that ever go anywhere?
It wasn’t.
One of the downstream projects was, but even then there wasn’t much point, because OpenRC didn’t do anything rc doesn’t.
The only “benefit” was that it has parallelized start, but it was disabled by default, and had a few undiagnosed bugs that’d cause the system not to boot correctly.

FreeBSDs own rc has a patch to add parallelization that was merged-to-CURRENT at one point, but it was backed out when it was found to have some bugs, and I haven’t heard much about it since.

ExcessBLarg!
Sep 1, 2001

pseudorandom name posted:

He's not a douche, he's German.
So is datenwolf.

ExcessBLarg!
Sep 1, 2001

Tiny Timbs posted:

I read systemd stuff for like two hours the other night and I still have no clue how to make a service run last and why rc.local is evil now
systemd has explicit support for rc.local. See rc-local.service(8).

pseudorandom name posted:

What does "make a service run last" mean?

edit: ok, I don't feel like doing socratic questioning. Units continuously become active and inactive in reaction to changing circumstances over the lifetime of the system. The "last" unit runs immediately before the syscall telling the computer to power off is made. You're going to have to explain your problem better because you're deep in XY territory.
The rc.local use-case is to allow a sysop to start a service "at the end of boot" when it can reasonably be assumed that most other system services are up without having to rigorously define the service's dependencies.

I personally prefer to write normal service units myself, but I can understand why someone who wants to cut through the mud and "start something at boot" would find rc.local appealing, especially if they're used to it.

My issue with rc.local is that--at least in the past--if it exists at all then it adds another boot-time synchronization point depending on the network being online, although from the documentation it seems they may have made that particular requirement optional.

Personally I like systemd. There's definitely a learning curve associated with it, but once you have a need to deal with a less-common use case you'll find that systemd generally does have reasonably-well documented accommodations for them--especially compared to upstart's less-well documented accommodations or sysvinit's ad-hoc poo poo show.

ExcessBLarg!
Sep 1, 2001

Voodoo Cafe posted:

systemd's binary logging is something that i'm ideologically opposed to, at least in theory.
Any sufficiently large service--particularly one that handles lots of traffic/requests--ends up implementing a binary logging system as it ends up being necessary in order to usefully query and follow logs. The best example I can think of is phk's Varnish Cache, which has a logging system that both predates, and is also remarkably similar to journald, despite phk being BSD-head and often pragmatically at odds with stuff that happens in GNU/Linux lands.

Klyith
Aug 3, 2007

GBS Pledge Week

xzzy posted:

My main complaint with journalctl is opening the log and then hitting shift+g to get to the end. It takes way too long to process as it seeks through the whole database.

However, if you run journalctl -r it reverses the log and you can see the newest messages instantly. journalctl -f is instant too.

Another good trick is -n 1000 to load the last 1000 lines, which makes both load & seek instant and gives you the normal order.

BattleMaster
Aug 14, 2000

ExcessBLarg! posted:

The rc.local use-case is to allow a sysop to start a service "at the end of boot" when it can reasonably be assumed that most other system services are up without having to rigorously define the service's dependencies.

Then that's what multi-user.target is for, that's when all of the core stuff has started up, the network is up, everything is mounted, and the system is ready to start running arbitrary things for users. If you need some other post multi-user.target services as dependencies for your service, like a database or something, you can set THAT as the dependency instead.

Now if you for some (probably XY problem reason tbh) need your service to be the absolute last thing that starts even after every random thing like your motd generator and your Quake server, then maybe I guess you need to shove in a new target. But for your actual typical use case that's not necessary.

Klyith posted:

Ooof. Time to re-take Unix Philosophy 101 in summer school. One cannot correctly interpret the sayings of the great sages of the ancient world when one is confused about the difference between a stream and a file.

"umm actually a stream is a file too" I say before someone beats me down with fstat's man page showing that posix differentiates between regular on-disk files and special files like streams and sockets

ExcessBLarg!
Sep 1, 2001

BattleMaster posted:

Then that's what multi-user.target is for, that's when all of the core stuff has started up, the network is up, everything is mounted, and the system is ready to start running arbitrary things for users.
Right, I mean, the use-case of rc.local is that of a sysop, not a package manager (where a more rigorous understanding of service dependencies is beneficial). Creating a service unit that's WantedBy multi-user.traget is generally equivalent and recommended, but possibly requires more effort than is desired by someone who is used to just appending /etc/rc.local.

Tiny Timbs
Sep 6, 2008

ExcessBLarg! posted:

systemd has explicit support for rc.local. See rc-local.service(8).

Hilariously I can find people having this exact same discussion about whether this should be used 12 years ago: https://bbs.archlinux.org/viewtopic.php?id=147790

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

ExcessBLarg! posted:

Any sufficiently large service--particularly one that handles lots of traffic/requests--ends up implementing a binary logging system as it ends up being necessary in order to usefully query and follow logs. The best example I can think of is phk's Varnish Cache, which has a logging system that both predates, and is also remarkably similar to journald, despite phk being BSD-head and often pragmatically at odds with stuff that happens in GNU/Linux lands.

oh man, a phk/varnish reference that’s in support of systemd

Blankfriend must be conflicted!

BlankSystemDaemon
Mar 13, 2009




Subjunctive posted:

oh man, a phk/varnish reference that’s in support of systemd

Blankfriend must be conflicted!
Just mildly amused that someone can pretend that the kind of engineering done for Varnish is also necessary for systemd.

BattleMaster
Aug 14, 2000

Yeah you're right, because varnish is an HTTP cache nothing that it does is possibly applicable to anything that isn't an HTTP cache. I am the smartest boy in the room

cruft
Oct 25, 2007

Nitrousoxide posted:

Does that bypass the normal safeguard against
code:
rm -rf /
? I know bash will normally refuse to execute that, though it will execute
code:
rm -rf /*
I'm not really eager to test it for obvious reasons.

this is why we have containers!

F_Shit_Fitzgerald
Feb 2, 2017



I update my system (Linux Mint + awesome wm) every Monday.

Ever since doing this today, I've been having a strange problem in Firefox where I can't click and drag tabs, either pinned or unpinned). I also can't click and drag selected text. The keyboard shortcuts for moving tabs still work, but in order to reorder my tabs, I have to right-click and select 'move to end' or 'move to start'. This is not a huge deal but is annoying when

This was getting out of the scope of the Firefox thread, so I'm asking here if anyone knows what the issue is or how to fix it? No one else has apparently had this issue, so I don't know what could be going on in my system to cause it (unless Firefox didn't update correctly).

Inceltown
Aug 6, 2019

Have you tried deleting your userChrome and creating a new profile?

F_Shit_Fitzgerald
Feb 2, 2017



I'm not sure I have one.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

F_Shit_Fitzgerald posted:

I update my system (Linux Mint + awesome wm) every Monday.

Ever since doing this today, I've been having a strange problem in Firefox where I can't click and drag tabs, either pinned or unpinned). I also can't click and drag selected text. The keyboard shortcuts for moving tabs still work, but in order to reorder my tabs, I have to right-click and select 'move to end' or 'move to start'. This is not a huge deal but is annoying when

This was getting out of the scope of the Firefox thread, so I'm asking here if anyone knows what the issue is or how to fix it? No one else has apparently had this issue, so I don't know what could be going on in my system to cause it (unless Firefox didn't update correctly).

Does this happen if you create a new profile? (How was this out of scope for the Firefox thread? I joined SA almost 20 years explicitly to provide user support for Firefox?)

What version of Firefox are you running?

F_Shit_Fitzgerald
Feb 2, 2017



Subjunctive posted:

Does this happen if you create a new profile? (How was this out of scope for the Firefox thread? I joined SA almost 20 years explicitly to provide user support for Firefox?)

What version of Firefox are you running?

I've never created a profile at all, to my knowledge. Version 126.

I figured since I was using Linux it was straying more into Linux troubleshooting than Firefox. Maybe not; I have no idea. This is the first time I've had a semi serious issue with Firefox.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

F_Shit_Fitzgerald posted:

I've never created a profile at all, to my knowledge. Version 126.

Yeah, I’m recommending that you do so, to narrow down the cause.

https://support.mozilla.org/en-US/kb/profile-manager-create-remove-switch-firefox-profiles

F_Shit_Fitzgerald
Feb 2, 2017



Nice...thanks.

F_Shit_Fitzgerald fucked around with this message at 12:50 on May 21, 2024

Klyith
Aug 3, 2007

GBS Pledge Week

F_Shit_Fitzgerald posted:

I figured since I was using Linux it was straying more into Linux troubleshooting than Firefox. Maybe not; I have no idea. This is the first time I've had a semi serious issue with Firefox.

Since you said in the firefox thread you use awesomeWM, I'd say it's most likely to be awesomeWM troubleshooting.

On awesomeWM is firefox actually putting the tabs up in the titlebar, or is it using the default window manager titlebar? If the first, I'd bet that switching it out of that mode would fix it.

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

Klyith posted:

(Meanwhile, storing logs as a basic database is such an amazing quality of life upgrade that even if some dude in the '70s had said "all files should be plain text", they should be regarded as clearly wrong by all intelligent people. A plain text log was ok when a computer did less stuff and a database was non-trivial overhead. But a modern machine runs so many things at once that some organization is a self-evident improvement.)

I wonder if it would be (1) possible (2) a significant performance hit to have journald use something like DuckDB as a backend.

That would allow use of standardised tools, and potentially enable a lot of new integrations, without going back to flat files.

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
Just learnt the trick that you can set a mount point directory to immutable (chattr +i <file>) to avoid accidently writing to it when it's not mounted. Useful for network shares or encrypted drives that aren't guaranteed to always be available.

isaboo
Nov 11, 2002

Muay Buok
ขอให้โชคดี
What's the best way to create a systemd service unit that runs a bash script inside of a python virtual environment?

The following works, but I'm sure there's a better method for the ExecStart line

code:
[Unit]
Description=OpenWebUi service
After=network.target

[Service]
User=isaboo
ExecStart=/bin/bash -c 'cd /home/isaboo/open-webui/backend && source venv/bin/activate && bash start.sh'
Restart=always

[Install]
WantedBy=multi-user.target

xzzy
Mar 5, 2009

You can directly call the python inside the virtualenv. Maybe have to set up the environment variables so it can find any modules you installed into the venv but it should "just work" if you prefix with the path to the python symlink.

I think your biggest speedbump is you're running a shell script. You might want to change it to being a python script.

So:

ExecStart=/home/isaboo/open-webui/backend/bin/venv/bin/python /home/isaboo/open-webui/backend/bin/start.py

Or whatever.

isaboo
Nov 11, 2002

Muay Buok
ขอให้โชคดี
Yeah the bash script is what threw me, I get how to do it in venv with a python script. The app ships with the start.sh script and I haven't looked into converting it to python. It works so I'll leave it as is.

Framboise
Sep 21, 2014

To make yourself feel better, you make it so you'll never give in to your forevers and live for always.


Lipstick Apathy
Unsure if this is the right place to ask, but I've been working on a project of turning an old laptop into network storage/server and such. However, last night I screwed something up I couldn't figure out how to fix, so I just started fresh, under the same server name and username and static IP (Using Ubuntu Server LTS). I managed to get Samba reinstalled just fine and that's all fine and good, but while getting Jellyfin set up, it's acting strange. Rather than trying to let me set up a new account there, it's asking me to sign in with my username/password from before I wiped everything and started fresh, but it won't let me connect or get set up or anything. It seems like it's trying to connect to the old server under the same name, which no longer exists.

Did I gently caress something up by using the same server name/username/static IP or something?

Klyith
Aug 3, 2007

GBS Pledge Week

Framboise posted:

but while getting Jellyfin set up, it's acting strange. Rather than trying to let me set up a new account there, it's asking me to sign in with my username/password from before I wiped everything and started fresh, but it won't let me connect or get set up or anything. It seems like it's trying to connect to the old server under the same name, which no longer exists.

Was your wipe of the first install done with a full clear of the HD, all partitions deleted? Or did you just install Ubuntu again?

The thing that would make sense would be if you still files from the old install and so it was seeing the configs from the first time you set it up.

Apparently the configs for the server are stored in /usr/share/jellyfin/web/config so you could try uninstalling jellyfin with the package manager, wiping any files left in there, and then install it again.

Framboise
Sep 21, 2014

To make yourself feel better, you make it so you'll never give in to your forevers and live for always.


Lipstick Apathy
I completely wiped everything and started fresh. The only thing that persisted between the first server setup I did and the current one is that the static IP assigned to that old laptop.

I did as you had mentioned and the issue still is going on. It's autodetecting the server and expecting the credentials from before, but if I can't set up the new server on there, it's just saying "Invalid Username or Password". And when I go to "Forgot Password", all it says is "Please try again within your home network to initiate the password reset process."

I'm not even sure where to start with that. This is my first time learning how to do server stuff, using the same laptop I used as a guinea pig for Linux a few months ago, before I consider looking into getting a NAS and such.

VictualSquid
Feb 29, 2012

Gently enveloping the target with indiscriminate love.

Framboise posted:

Unsure if this is the right place to ask, but I've been working on a project of turning an old laptop into network storage/server and such. However, last night I screwed something up I couldn't figure out how to fix, so I just started fresh, under the same server name and username and static IP (Using Ubuntu Server LTS). I managed to get Samba reinstalled just fine and that's all fine and good, but while getting Jellyfin set up, it's acting strange. Rather than trying to let me set up a new account there, it's asking me to sign in with my username/password from before I wiped everything and started fresh, but it won't let me connect or get set up or anything. It seems like it's trying to connect to the old server under the same name, which no longer exists.

Did I gently caress something up by using the same server name/username/static IP or something?

This sounds more like an issue with the browser cache on your access device then with the jellyfin install.

Framboise
Sep 21, 2014

To make yourself feel better, you make it so you'll never give in to your forevers and live for always.


Lipstick Apathy

VictualSquid posted:

This sounds more like an issue with the browser cache on your access device then with the jellyfin install.

That does indeed seem to be the case; clearing the cache for Jellyfin fixed it. Thanks!

Now I just need to figure out how to get the drat thing to work on my TV; there's no app for it on the TV itself, nor for PS5, and the one on Xbox just doesn't loving work at all.

Klyith
Aug 3, 2007

GBS Pledge Week

Framboise posted:

Now I just need to figure out how to get the drat thing to work on my TV; there's no app for it on the TV itself, nor for PS5, and the one on Xbox just doesn't loving work at all.

reddits say just use the web browser on playstations

On the TV you could try using DLNA but that seems poorly documented. Does your TV have a web browser? Apparently there's some way to make the TV open the webview but then keep your phone as the remote control.

BattleMaster
Aug 14, 2000

isaboo posted:

What's the best way to create a systemd service unit that runs a bash script inside of a python virtual environment?

The following works, but I'm sure there's a better method for the ExecStart line

code:
[Unit]
Description=OpenWebUi service
After=network.target

[Service]
User=isaboo
ExecStart=/bin/bash -c 'cd /home/isaboo/open-webui/backend && source venv/bin/activate && bash start.sh'
Restart=always

[Install]
WantedBy=multi-user.target


Assuming start.sh is +x and has a shebang line (#!/bin/sh or whatever) at the top, can you not just make a script of your own that's like:

code:
#!/bin/sh
cd /home/isaboo/open-webui/backend
source venv/bin/activate
./start.sh
then set it to +x and do

ExecStart=/path/to/my/script.sh

or is there something subtle that I am missing?

But this is functionally identical to what you did (or so I think it is) and requires an extra file so maybe your original method wasn't so bad after all.

edit: Thing is unless you need to reuse this for several services (like making a script that does a similar thing but with arguments so you use it in several places for slightly different things) there's probably no point to doing it another way even if the original line looks bad

BattleMaster fucked around with this message at 17:49 on May 21, 2024

Combat Pretzel
Jun 23, 2004

No, seriously... what kurds?!
What's my option in Gnome to get something like a "normal" start menu instead of this fullscreen menu? Other than installing another DE, that is.

Adbot
ADBOT LOVES YOU

Tiny Timbs
Sep 6, 2008

Combat Pretzel posted:

What's my option in Gnome to get something like a "normal" start menu instead of this fullscreen menu? Other than installing another DE, that is.

https://extensions.gnome.org/extension/1160/dash-to-panel/

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply