mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-14 02:54:28 +05:00
fix: apply required changes due to introduction of PolicyKit and PackageKit in Moonraker
This commit is contained in:
@@ -2,6 +2,13 @@
|
||||
|
||||
This document covers possible important changes to KIAUH.
|
||||
|
||||
### 2022-01-29
|
||||
* Starting from the 28th of January, Moonraker can make use of PackageKit and PolicyKit.\
|
||||
More details on that can be found [here](
|
||||
https://github.com/Arksine/moonraker/issues/349) and [here](https://github.com/Arksine/moonraker/pull/346)
|
||||
* KIAUH will install Moonrakers PolicyKit rules by default when __installing__ Moonraker
|
||||
* KIAUH will also install Moonrakers PolicyKit rules when __updating__ Moonraker __via KIAUH__ as of now
|
||||
|
||||
### 2021-12-30
|
||||
* Updated the doc for the usage of the [G-Code Shell Command Extension](docs/gcode_shell_command.md)
|
||||
* It became apparent, that some user groups are missing on some systems. A missing video group \
|
||||
|
||||
@@ -8,6 +8,7 @@ WantedBy=multi-user.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
SupplementaryGroups=moonraker-admin
|
||||
User=%USER%
|
||||
RemainAfterExit=yes
|
||||
ExecStart=%MR_ENV%/bin/python %MR_DIR%/moonraker/moonraker.py -l %MR_LOG% -c %MR_CONF%
|
||||
|
||||
@@ -111,6 +111,9 @@ moonraker_setup(){
|
||||
### step 4: create final moonraker instances
|
||||
create_moonraker_service
|
||||
|
||||
### step 5: create polkit rules for moonraker
|
||||
moonraker_polkit
|
||||
|
||||
### confirm message
|
||||
if [[ $INSTANCE_COUNT -eq 1 ]]; then
|
||||
CONFIRM_MSG="Moonraker has been set up!"
|
||||
@@ -297,3 +300,22 @@ print_mr_ip_list(){
|
||||
i=$((i + 1))
|
||||
done
|
||||
}
|
||||
|
||||
### introduced due to
|
||||
### https://github.com/Arksine/moonraker/issues/349
|
||||
### https://github.com/Arksine/moonraker/pull/346
|
||||
moonraker_polkit(){
|
||||
SYSTEMDDIR="/etc/systemd/system"
|
||||
MOONRAKER_SERVICES=$(find "$SYSTEMDDIR" -regextype posix-extended -regex "$SYSTEMDDIR/moonraker(-[^0])?[0-9]*.service")
|
||||
for service in $MOONRAKER_SERVICES; do
|
||||
HAS_SUPP="$( grep -cm1 "SupplementaryGroups=moonraker-admin" "$service" || true )"
|
||||
if [ "$HAS_SUPP" -eq 0 ]; then
|
||||
status_msg "Adding moonraker-admin supplementary group to $service ..."
|
||||
sudo sed -i "/^Type=simple$/a SupplementaryGroups=moonraker-admin" "$service" \
|
||||
&& ok_msg "Adding moonraker-admin supplementary group successfull!"
|
||||
fi
|
||||
done
|
||||
### execute moonrakers policykit-rules script
|
||||
"${HOME}"/moonraker/scripts/set-policykit-rules.sh
|
||||
sudo systemctl daemon-reload
|
||||
}
|
||||
@@ -283,13 +283,17 @@ update_moonraker(){
|
||||
bb4u "moonraker"
|
||||
status_msg "Updating Moonraker ..."
|
||||
### pull latest files from github
|
||||
cd $MOONRAKER_DIR && git pull
|
||||
cd "$MOONRAKER_DIR" && git pull
|
||||
### read PKGLIST and install possible new dependencies
|
||||
install_moonraker_packages
|
||||
### install possible new python dependencies
|
||||
MR_REQ_TXT="$MOONRAKER_DIR/scripts/moonraker-requirements.txt"
|
||||
$MOONRAKER_ENV/bin/pip install -r $MR_REQ_TXT
|
||||
"$MOONRAKER_ENV"/bin/pip install -r "$MR_REQ_TXT"
|
||||
update_log_paths "moonraker"
|
||||
|
||||
### required due to https://github.com/Arksine/moonraker/issues/349
|
||||
moonraker_polkit
|
||||
|
||||
ok_msg "Update complete!"
|
||||
do_action_service "restart" "moonraker"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user