GlassHalfHopeful

joined 1 year ago
[–] [email protected] 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.

[–] [email protected] 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 😁)

[–] [email protected] 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.

[–] [email protected] 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
[–] [email protected] 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

[–] [email protected] 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.

[–] [email protected] 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...

18
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 

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

[–] [email protected] 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. ☝

[–] [email protected] 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.

[–] [email protected] 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?

 

A judge has now clarified that this is basically a legal distinction without a real-world difference. He says that what the jury found Trump did was in fact rape, as commonly understood.

Kaplan also flatly rejected the Trump team’s suggestion that the conduct Trump was found liable for might have been as limited as groping of the breasts.

The reason? Trump was not accused of that, so the only alleged offense that would have qualified as “sexual abuse” was forced digital penetration. Beyond that, Trump was accused of putting his mouth on Carroll’s mouth and pulling down her tights, which Kaplan noted were not treated as alleged sexual abuse at trial.

“The jury’s finding of sexual abuse therefore necessarily implies that it found that Mr. Trump forcibly penetrated her vagina,” Kaplan wrote, calling it the “only remaining conclusion.”

11
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 

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.

 

Binged the first five episodes last weekend and the sixth just now (Prime). It's a crime drama interwoven with comedy.

It's definetly vulgar, often tiresomely so, with one of the characters. Tonight though, I saw a very human side of her that was really tender and lovely... despite the vulgarity. 😏

On the other hand, Kate Box plays a detective that simply continues to draw me in further with each episode. I want to watch her work. I can feel the reasons why she is who she is. I can see what drives her. I see her brokenness and also what makes her great. I want to know her. I admire her. Tonight, I could truly empathize with her in ways that I haven't been able to with others folks for a long time. I love good story telling like this. 💜

Anyway, it's been worth the watch and I look forward to finishing it out.

What do you all think?

 

One of the primary reasons I love Star Trek so much is because of the continued hope it fills me with as I imagine a better future for humanity.

I'm grateful for all those who resist and stand up for justice and equality. For the lives lost. For those fighting each day. While my heart feels so often crushed, I can't help but look forward with hope and longing.

Never forget that humanity has done better. We've done great harm, but have also grown in light of that. We will continue to see change so long as we keep fighting for change.

Such a good episode to watch this evening. I'm a bundle of emotions. 💜

#HumanRights #Justice #Equality #LGBTQ #Racism #BLM #WomensRights #Migrants #Refugees #Poverty

view more: next ›