YunoHost-Apps / restic_ynh

Restic package for YunoHost
https://restic.net/
GNU Affero General Public License v3.0
6 stars 9 forks source link

restore script does not recreate the restic user #12

Open matlag opened 2 years ago

matlag commented 2 years ago

Describe the bug

Restoring the restic app does not recreate the user 'restic', resulting in a failure to execute.

Context

Steps to reproduce

-Re-install system -Invoke `yunohost backup restore archive --apps restic -sudo systemctl start restic

Expected behavior

Should launch a backup, instead hands back prompt

Logs

restic.service: Failed to determine user credentials: No such process restic.service: Failed at step USER spawning /usr/local/bin/backup-with-restic: No such process

Manual fix

ls -lh /usr/local/bin/backup-with-restic retrieve UID and GID of file, then:

groupadd -g $GID restic
useradd -u $UID -g restic restic
cat > /tmp/restic_sudoer << EOSUDOER
restic ALL = (root) NOPASSWD: /usr/bin/yunohost*, /bin/journalctl*, /usr/bin/find /etc/yunohost/apps -name backup, /opt/yunohost/restic/check_method_restic
EOSUDOER
visudo -cf /tmp/restic_sudoer && mv /tmp/restic_sudoer /etc/sudoers.d/restic