GlassHalfHopeful

joined 1 year ago
[–] GlassHalfHopeful@beehaw.org 2 points 1 year ago

Good to know about the main proc. I wasn't aware. And it is indeed set to auto restart. I just hadn't realized the stop alone would trigger that. I had figured I would need to take the additional step.

[–] GlassHalfHopeful@beehaw.org 2 points 1 year ago* (last edited 1 year ago) (2 children)

YEEEESSS!!!! THIS!!! Thank you! I've been able to hobble together a script now that I have a Synology automated task calling early each morning after world backups are complete. I'm so very grateful to you all. I've learned a lot. A proper "stop" is being issues now which reduces the chance of world corruption which would make my family very very grumpy.

Here's the script just in case someone finds themselves in a similar situation as me. This is not my wheelhouse and it's not pretty. I know it can be better, but I've spent too much time on this as it is and need to go fix a washing machine now. Ugh...


#!/bin/bash

# Define the countdown duration in seconds
countdown_duration=20

# Function to send a message to the Docker container
send_cmd() {
  cmd="$1"
  sudo sh -c "echo '$cmd' | socat EXEC:'docker attach mcbe-world',pty STDIN"
}

# Announce
announce_text="Daily server restart commencing in $countdown_duration seconds..."
send_cmd "say $announce_text"

# Perform the countdown
for ((i = $countdown_duration; i >= 1; i--)); do
  #echo "Restaring in $i seconds"
  countdown_text="Restarting in $i seconds"
  send_cmd "say $countdown_text"
  sleep 1
done

# Gracefully shutdown server
#  Note: stopping forces the mcbe container to restart on it's own. 
#  Not sure why that's the case, but it's the end result I want...
send_cmd "stop"

P.S. I really need to figure out how to get the RCON solution working because that would be a more elegant way to handle things.

P.P.S Example run (yes, the timing and spelling were updated after this screenshot 😁)

[–] GlassHalfHopeful@beehaw.org 3 points 1 year ago

Yeah. I see this as being a problem. I was curious how it comes into play.

The popularity of a show really needs to be taken into account.

[–] GlassHalfHopeful@beehaw.org 3 points 1 year ago

Well,RCON has not fared well. Afaik, I've set things up correctly but the client I'm using (mcrcon) keep returning Error 111: Connection refused.

  • This post got me to direct things to the right IP which I could get with docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mcbe-world.
  • docker port mcbe-world shows that the rcon port is open
  • the server.properties files for the mc server has the relevant rcon lines
[–] GlassHalfHopeful@beehaw.org 1 points 1 year ago* (last edited 1 year ago) (2 children)

This looked so promising.

Via SSH, I can indeed use docker attach and from within I can issue a stop for MC server. Works fine.

However, the Synology task scheduler via DSM doesn't seem to be able to similarly attach and then issue the stop command. I get this back via email (for when a scheduled task fails):

Task Scheduler has completed a scheduled task.

Task: MC Graceful Restart Start time: Tue, 29 Aug 2023 17:19:41 -0500 Stop time: Tue, 29 Aug 2023 17:19:42 -0500 Current status: 127 (Interrupted) Standard output/error:

the input device is not a TTY /bin/bash: line 1: stop: command not found

[–] GlassHalfHopeful@beehaw.org 4 points 1 year ago* (last edited 1 year ago)

Ooh. I was not aware of the RCON protocol. Looking into now. This may be the exact thing I need. Thanks for the lead.

[–] GlassHalfHopeful@beehaw.org 1 points 1 year ago (1 children)

docker exec mcbe-world just gives access to the container so commands can be executed. /stop is a specific command for the MC server running in that container. The process is already running and I am trying to figure out how to issue a command to it... and the other comment in this post referencing "rcon" might be a solution...

 

Note: Still trying to navigate communities here on Lemmy to replace those from Reddit. If there is a better place such a question, I would welcome the suggestion.

I'm running a Synology NAS, which uses some flavor of Linux distribution. From there, among everything else running, I have a docker container hosting a Minecraft Bedrock Server. The MCBE server is great for fun, but not so great for resource usage. To handle this, most folks setup something to schedule the server to restart.

Within Synology, there is a task scheduler where I can run a user-defined script to restart the whole container: docker restart mcbe-world

This works, but it's a dirty reboot though. I worried about corrupting the world (which I do regularly backup). From within the Minecraft server terminal, the /stop command will gracefully shut it down.

I can't update the container with another application, like screen, because each MCBE update means replacing the entire container (and so destroying the changes). I am looking to somehow redirect a command to the server if possible.

Using docker exec -it mcbe-world , I can execute what I want within the container.

The person here said, one can "inject commands by running the command as the appropriate account and redirecting it into the server" and they gave the example sudo su -s /bin/bash -c "echo say foobar > /run/service@name" Unfortunately, this isn't so clear and straight forward to me.

Would anyone here be able to articulate this more clearly for me or have an idea as to how I might issue that /stop command from the Synology scheduled script BEFORE restarting the container?

Thanks!

UPDATE: Solution here: https://beehaw.org/comment/1088961

[–] GlassHalfHopeful@beehaw.org 3 points 1 year ago

it’s a ridiculous loophole. They are literally saying, “I have this thing that’s so valuable, but I ‘accidentally’ threw it away, it’s worthless now, I need to mark this down as a loss.” They are destroying their own products for tax purposes.

This. ☝

[–] GlassHalfHopeful@beehaw.org 5 points 1 year ago (3 children)

If this is accurate, then it would make a hell of a lot more sense. But... it sounds like these "residuals" need to be payed out differently because this sucks for consumers and... honestly... I think for those that poured themselves into making the content in the first place.

[–] GlassHalfHopeful@beehaw.org 1 points 1 year ago

But imagine Willow to be entirely Disney. I imagine the tax benefit of cutting it is the best answer to my question, but hell... gah

 

Would you all explain to me how removing content we expect to have access to is a "cost savings" measure?

The following is from the Willow Wikipedia page, which led me to the linked URL:

The series was removed from Disney+ on May 26, 2023, amidst a Disney+ and Hulu content removal purge as part of a broader cost cutting initiative under Disney CEO Bob Iger.

I've been abroad for a month and earned some time off afterwards. One of my kids reminded me that we never finished Willow, so I said "let's do it now!" The show wasn't perfect for many reasons, but I wanted to finish it for nostalgia's sake and my child legit found it interesting. Lo and behold, the series isn't on Disney+ any more!

A quick search later, I see the above referenced quote linking to the article associated with this post... which only made things worse. The Mysterious Benedict Society was something my whole family could watch and enjoy without arguments! Turner and Hooch was dorky, but something my youngest loved and it was a super safe and easy pick for us bond over.

This post isn't about whether the shows are good. And it isn't about how nearly every show I like ends up cancelled. The point is that I paid for access, they were then quietly removed (for various platforms), and I have zero understanding as to how this saves these companies money.

Would someone explain?

P. S. Yes, I know this is old news. However, this is just how I am. I'm not up to date with anything in the entertainment world. I intentionally wait a few seasons for things because I loath when shows are cancelled after a season. (I'm looking at you, Firefly.) I'm the same way with books, often waiting to read a trilogy after its published because I don't like the wait in between books. (Thanks, Rothfuss).

I just don't take cancellation wells, especially when I was on top of everything including summer podcasts and such. (Now anything with the names Abrams, Lindelof, or Cuse makes my skin crawl.)

I know. I'm weird and stuff.

 

Am I wrong in feeling some hope in this (at least concering US law and the huge effect the country has on the climate as a whole)? It feels like this is... actually something?

 

The extreme heat has devastated corals.This is a truly heartbreaking read:

“The coral didn’t even have a chance to bleach, it just died. It just felt like, ‘Oh my God, we’re in the apocalypse.’ What’s happening?”

Archive link: https://web.archive.org/web/20230731225349/https://www.nytimes.com/2023/07/31/climate/coral-reefs-heat-florida-ocean-temperatures.html

 

How are you all managing the varmints in your yard? I've lived in a lot of places in my life and it seems I've found quite the mole and vole hotbed also known as my yard. sighs

My dog is able to catch them, but not without digging up tunnels, grass, and making a mess. My neighbor inserts "worms" (poison) into the tunnels, but I don't do that because of our dog.

I wish I could lay a yellow brick road for them to follow to a happier place, but they don't seem to be the type to understand. I don't actually want to harm any critters and thus the inner turmoil of humankind vs nature. I really don't like this post and I'm the one who wrote it.

 

I have been using various filters like "reddit", "threads", and "titan". My goodness, it transforms the Lemmy experience!

And the ability to hide posts. Thank you thank you thank you thank you!

Throw in Lemmy's community blocking...

I'm so glad to be able to create and prune within Connect. 💜🙏

 

At one precise moment this weekend, nearly all of the 8 billion people on Earth will be able to see sunlight in the sky, the counterpart to the "moment of darkness" that unfolds in December.

 

Rosemary Penwarden, [a 64 year old] climate activist in New Zealand, faces more than 10 years in jall for a fake letter canceling an oil conference.

Three years later, after a trial in the Dunedin District Court, Penwarden was found guilty on Wednesday of two charges of creating and using a forged document.

“It was a surprise,” she said. “I’m reminded of the topsy-turvy world we’re in. It should not be the grandmothers on trial, it should be the oil industry, it should be those people who are making massive profits off the destruction of all of our futures.”

 

Based on an initial investigation, Prache said, he concluded that "the conditions for the legal use of the weapon were not met.”

Three persons were in the car when police tried to stop it Tuesday, the prosecutor said. Nahel managed to avoid a traffic stop by running a red light. He was later got stuck in a traffic jam.

Both officers involved said they drew their guns to prevent him from starting the car again.

The officer who fired a single shot said he wanted to prevent the car from leaving and because he feared someone may be hit by the car, including himself or his colleague, according to Prache.

Both officers said they felt “threatened” by seeing the car drive off, he added.

view more: next ›