Charm needed: minetest server
Bug #1170626 reported by
James Tait
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Juju Charms Collection |
Incomplete
|
Undecided
|
James Tait |
Bug Description
A charm to easily deploy a minetest network server would be useful.
Related branches
To post a comment you must log in.
Hi James
Nice work so far!
A few comments:
1) Hooks with no hooks/*
Your charm declares a provides hook:
provides:
server:
interface: minetest
But does not implement any hooks to support this; I suspect its just not required as clients connect directly (not through another Juju server).
2) hooks/install
Needs a bit more idempotency:
juju-log "Adding minetest user and group"
addgroup --system minetest
adduser --system --home /srv/minetest --ingroup minetest --gecos "Minetest server" minetest
This segment will fail if run twice -and it might be as the upgrade-charm hook runs the install hook. I'd nest each call in a conditional that check to see if the group/user exists first.
3) hooks/config- changed
I don't think that you will be able to change configuration post deployment with sed's like this:
sed -i -e "s/^#port \= .*/port \= ${PORT}/" "$CONFIG_FILE"
Once the configuration option has been set, its not going to be picked up by the pattern match on subsequent executions.
I'd actually recommend a different approach; how about templating the configuration file in the charm; this gives you a better chance of repeatability when it comes to configuring minetest.
Cheers
James