Skip Navigation

User banner
β“β“žπŸ…žπŸ…πŸ…”
β“β“žπŸ…žπŸ…πŸ…” @ GlassHalfHopeful @beehaw.org
Posts
15
Comments
68
Joined
2 yr. 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.

  • 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 😁)

  • 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.

  • 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
  • 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

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

  • 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...

  • Linux @lemmy.ml

    Redirecting a command to a running process?

  • 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. ☝

  • 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.

  • 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

  • Please no. Even after ripping all my music, I still have a one foot thick ream of CDs that I wish I could part with but my partner would murder me over.

  • And this is so true. Both the ripping your own content and then the DRM implications of it all. And all so frustrating.

    And here I just want to buy things. And keep them. In my preferred format. Forever. The end.

  • Yes, this is what I was thinking was the matter. And someone else in this thread posted at a guardian link saying something to the same effect. It's still mind-boggling to me that to save money the answer is to remove everything completely. It feels like these big production companies are failing people and their use of the tax system is furthering that so they can save money. It just seems strange that they have to axe a show from existence to be able to prove it as a loss to the government.

  • Hot garbage they spent a whole lot of money on that could still be served without ever showing on the main title screens. They clearly had to have made a determination that the show would cost them more to keep it available, even though it doesn't entirely make sense to me how that all works.

  • This is what I had heard at some point. It's a tax thing. Even though there are no details, it makes more sense to me now. Reduced value == less taxes. Would love to hear the guts if this... but also at the same time pulling out hair. So much blood, sweat, and tears going into producing something only having it then wiped from existence. smh.

    And I hadn't realized that Westworld was axed too. For a show that made such a huge hubbub and then to remove it entirely?! Ugh

  • Not physical media again. Haha. We got rid of all our DVDs to trim down on all the...stuff. No more stuffffff.

    But it's that or someone hosts it, which costs money and circle around again...

  • Entertainment @beehaw.org

    Please explain how removing access to shows saves money?

    Environment @beehaw.org

    Judge sides with young activists in first-of-its-kind climate change trial in Montana

    World News @beehaw.org

    Ukrainian official says drones hit naval ship in Russian port. It's the latest attack inside Russia

    U.S. News @beehaw.org

    Both expelled members of β€˜Tennessee Three’ win back their state House seats

    U.S. News @beehaw.org

    Prepare to flick off your incandescent bulbs for good under new US rules that kicked in this week

    World News @beehaw.org

    A Desperate Push to Save Florida’s Coral: Get It Out of the Sea

    Environment @beehaw.org

    Hops for beer flourish under solar panels. They're not the only crop thriving in the shade.

    World News @beehaw.org

    Hops for beer flourish under solar panels. They're not the only crop thriving in the shade.

    U.S. News @beehaw.org

    Judge clarifies: Yes, Trump was found to have raped E. Jean Carroll

    Nature and Gardening @beehaw.org

    Managing Moles, Voles, and other Varmints

    Connect for Lemmy App @lemmy.ca

    I just want to say... I love your filters!

    Science @beehaw.org

    99% of humans are about to experience sunlight at the same time

    World News @beehaw.org

    Climate activist faces 10 years in jail for a fake letter 'canceling' an oil industry conference | CNN

    Entertainment @beehaw.org

    Deadloch (TV Series; Australian noir comedy, crime drama)