sorted by: new top controversial old
[-] 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)

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

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)

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

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 GlassHalfHopeful@beehaw.org to c/linux@lemmy.ml

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 6 points 1 year ago* (last edited 1 year ago)

Full article.

Judge sides with young activists in first-of-its-kind climate change trial in Montana By AMY BETH HANSON and MATTHEW BROWN

11 mins ago

HELENA, Mont. (AP) — A Montana judge on Monday sided with young environmental activists who said state agencies were violating their constitutional right to a clean and healthful environment by permitting fossil fuel development without considering its effect on the climate.

The ruling in the first-of-its- kind trial in the U.S. adds to a small number of legal decisions around the world that have established a government duty to protect citizens from climate change.

District Court Judge Kathy Seeley found the policy the state uses in evaluating requests for fossil fuel permits — which does not allow agencies to evaluate the effects of greenhouse gas emissions — is unconstitutional.

Judge Seeley wrote in the ruling that “Montana’s emissions and climate change have been proven to be a substantial factor in causing climate impacts to Montana’s environment and harm and injury” to the youth.

However, it’s up to the state Legislature to determine how to bring the policy into compliance. That leaves slim chances for immediate change in a fossil fuel-friendly state where Republicans dominate the statehouse.

Julia Olson, an attorney representing the youth and with Our Children’s Trust, an Oregon environmental group that has filed similar lawsuits in every state since 2011, celebrated the ruling.

“As fires rage in the West, fueled by fossil fuel pollution, today’s ruling in Montana is a game-changer that marks a turning point in this generation’s efforts to save the planet from the devastating effects of human-caused climate chaos,” Olson said in a statement. “This is a huge win for Montana, for youth, for democracy, and for our climate. More rulings like this will certainly come.”

Emily Flower, spokeswoman for Montana Attorney General Austin Knudsen, decried the ruling as “absurd,” criticized the judge and said the office planned to appeal.

“This ruling is absurd, but not surprising from a judge who let the plaintiffs’ attorneys put on a weeklong taxpayer-funded publicity stunt that was supposed to be a trial,” Flower said. “Montanans can’t be blamed for changing the climate — even the plaintiffs’ expert witnesses agreed that our state has no impact on the global climate. Their same legal theory has been thrown out of federal court and courts in more than a dozen states. It should have been here as well, but they found an ideological judge who bent over backward to allow the case to move forward and earn herself a spot in their next documentary.”

Attorneys for the 16 plaintiffs, ranging in age from 5 to 22, presented evidence during the two-week trial in June that increasing carbon dioxide emissions are driving hotter temperatures, more drought and wildfires and decreased snowpack. Those changes are harming the young people's physical and mental health, according to experts brought in by the plaintiffs.

The state argued that even if Montana completely stopped producing C02, it would have no effect on a global scale because states and countries around the world contribute to the amount of C02 in the atmosphere.

A remedy has to offer relief, the state said, or it’s not a remedy at all.

73

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?

26
62

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

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

Full article

Hops for beer flourish under solar panels. They're not the only crop thriving in the shade. | AP News MATTHIAS SCHRADER, DANA BELTAJI 7 - 9 minutes

Published 1:57 PM EDT, July 21, 2023

AU in der HALLERTAU, Germany (AP) — Bright green vines snake upwards 20 feet (six meters) toward an umbrella of solar panels at Josef Wimmer’s farm in Bavaria.

He grows hops, used to make beer, and in recent years has also been generating electricity, with solar panels sprawled across 1.3 hectares (32 acres) of his land in the small hop-making town of Au in der Hallertau, an hour north of Munich in southern Germany.

The pilot project — a collaboration between Wimmer and local solar technology company Hallertauer Handelshaus — was set up in the fall of last year. The electricity made at this farm can power around 250 households, and the hops get shade they’ll need more often as climate change turbocharges summer heat. This photograph provided by William Collins shows the string bean fields that were decimated at his farm's fields by flood waters about a week earlier at Fair Weather Growers, Sunday July 16, 2023, in Rocky Hill, Conn. Prior to the flooding, the fields were thriving. When devastating rains swept through the region, farmers in the Northeast were dealt a devastating blow at the worst possible time. (William Collins photo via AP)

When rains swept through the Northeast, farmers in the region were dealt a devastating blow at the worst possible time. FILE - An employee of the Romanian grain handling operator Comvex oversees the unloading of Ukrainian cereals from a barge in the Black Sea port of Constanta, Romania, on June 21, 2022. Five European Union countries will extend their ban on Ukrainian grain to protect their farmers’ interests. But agriculture ministers from Poland, Slovakia, Hungary, Bulgaria and Romania said Wednesday, July 19, 2023 that food can still move through their land to parts of the world in need after Russia pulled out of a deal allowing Black Sea shipments. (AP Photo/Vadim Ghirda, File)

Five European Union countries will extend their ban on Ukrainian grain to protect their farmers’ interests. A man displays imported and local grain in Dawanau International Market in Kano Nigeria, Friday, July 14, 2023. Nigeria introduced programs before and during Russia's war in Ukraine to make Africa's largest economy self-reliant in wheat production. But climate fallout and insecurity in the northern part of the country where grains are largely grown has hindered the effort. (AP Photo/Sunday Alamba)

Nigeria is trying to make Africa’s largest economy reliant on its own wheat production. But climate change and violence in the northern part of the country, where grains are largely grown, have hindered these efforts. This photo taken from video released by Russian Defense Ministry Press Service on Wednesday, July 19, 2023, shows two Russian 152 mm self-propelled howitzers fire toward Ukrainian positions at an undisclosed location. (Russian Defense Ministry Press Service via AP)

Russia unleashed intense overnight drone and missile attacks that officials said damaged critical port infrastructure in southern Ukraine, including grain and oil terminals, and wounded at least 12 people.

Solar panels atop crops has been gaining traction in recent years as incentives and demand for clean energy skyrocket. Researchers look into making the best use of agricultural land, and farmers seek ways to shield their crops from blistering heat, keep in moisture and potentially increase yields. The team in Germany says its effort is the first agrivoltaic project that’s solely focused on hops, but projects have sprouted around the world in several countries for a variety of grains, fruits and vegetables.

Beer-making hops can suffer if exposed to too much sun, said Bernhard Gruber, who’s managing the project’s solar component — and since there were already solar installations on the farm, it made sense to give them a second purpose by mounting them on poles above the crops.

In addition to shielding plants from solar stress, the shade could mean “water from precipitation lasts longer, leaving more in the soil” and that “the hops stay healthier and are less susceptible to diseases,” Gruber said. A scientific analysis of the benefits for the plants will be concluded in October.

The farm is working with researchers to understand how to get the balance right, so the hops get enough shade and sunlight for the best harvests each year.

In the U.K., where weather is also getting hotter and more variable, a team of researchers is looking at how to retrofit solar panels onto greenhouses or polytunnels — frames covered in plastic where crops grow underneath — with semi-transparent or transparent installations.

“You can get your renewables from the land that you do have covered and you don’t need to do these massive solar arrays on good agricultural land, which is what you’ve tended to see around to date,” said Elinor Thompson, a reader at Greenwich University who’s leading the research.

Thompson, a plant biologist, and her team are working with a fruit farm in Kent in southern England to make sure the plants also get the best out of solar structures.

“Nobody can afford to lose crop, especially in current conditions,” she said. “We are assuming that British summers are going to get hotter, we have a problem with water shortages, we need to be efficient in all parts of agriculture.”

Having shade where it’s useful and monitoring the effects of different arrangements of solar panels on a variety of crops will help the world prepare for a more climate-variable future, Thompson said.

In East Africa, which has suffered from a long and punishing drought that scientists said was worsened by human-caused climate change, solar panels can also help keep moisture in plants and soil and reduce the amount of water needed, said Richard Randle-Boggis, a research associate at the University of Sheffield who’s developing two agrivoltaic systems in Kenya and Tanzania.

Randle-Boggis said the systems can be used for “climate change resilience and a way of improving the growing environment for crops, while also providing low carbon electricity.” He said that some of the crops under the partial shade of solar panels are using around 16% less irrigation.

The solar-covered farms saw increased yields for maize, Swiss chard and beans, and while growers experienced lower yields for onions and sweet peppers, they still had the added benefit of clean electricity generation.

But crop yields can also “vary depending on the weather conditions because we’re seeing the climate changing,” said Randle-Boggis, although he added he was “really surprised and impressed with some of the results that we’re seeing” for solar-covered crops.

“Maize is grown by about 50% of farmers in Tanzania. Maize is also a sun loving plant. So the fact that we had an 11% yield increase in maize ... is a phenomenal result,” he said.

And Randle-Boggis said these projects can continue to be replicated around the world for many different crops, as long as systems are “designed with the local context in mind.”

A future with more crops under solar is Gruber’s hope for beer-making hops, too.

“At the end of the year we will set up another solar park over hops,” which will have about 10 times the electricity-generating potential as the current project, Gruber said.

But that’s still just the beginning.

“We’re getting lots of inquires from hop farmers,” he said, “even from abroad.”


Beltaji reported from London.


Associated Press climate and environmental coverage receives support from several private foundations. See more about AP’s climate initiative here. The AP is solely responsible for all content.

25
1

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.

1

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

[-] GlassHalfHopeful@beehaw.org 0 points 1 year ago

⚠️ I have reported this post to the proper authorities.

view more: next ›

GlassHalfHopeful

joined 1 year ago