Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ask user for old service file #2966

Merged
merged 2 commits into from
Apr 4, 2022

Conversation

Pitillo
Copy link
Contributor

@Pitillo Pitillo commented Mar 22, 2022

As discussed here I've added questions to the postinst file to ask the user whether he wants to keep the service file under /etc/systemd/system/evcc.service and the binary under /usr/local/bin/evcc

For now I didn't have time to test this. If anyone can do so, feel free.

@andig
Copy link
Member

andig commented Mar 23, 2022

Sieht Klasse aus, bräuchte aber noch den erwähnten Test. Kann ich unter OSX leider nicht machen :/

@Pitillo Pitillo reopened this Apr 3, 2022
- shell doesnt know source, only .
- && instead of -a
- copy paste errors
- set -e doesnt allow for examining the exitstatus, has to be done in same line using ||
@Pitillo
Copy link
Contributor Author

Pitillo commented Apr 3, 2022

Ich habe mir jetzt heute die Zeit genommen und das ganze Mal getestet. Ein paar kleine Bugs waren drin. Hier der Output des Tests:

root@JHPC:~/projects/evcc# rm /etc/evcc-userchoices.sh
root@JHPC:~/projects/evcc# dpkg -i release/evcc_0.89.0_amd64.deb
(Reading database ... 41569 files and directories currently installed.)
Preparing to unpack release/evcc_0.89.0_amd64.deb ...
Unpacking evcc (0.89.0) over (0.89.0) ...
Setting up evcc (0.89.0) ...
An alternate service file was detected under '/etc/systemd/system/evcc.service'.
This is probably due to a previous manual installation.
You probably want to delete this file now. Your evcc configuration stays untouched!
Shall '/etc/systemd/system/evcc.service' be deleted? [Y/n]:
y
The file will be deleted.
Deleting old service file '/etc/systemd/system/evcc.service'
removed '/etc/systemd/system/evcc.service'
root@JHPC:~/projects/evcc# ls /etc/systemd/system/evcc.service
ls: cannot access '/etc/systemd/system/evcc.service': No such file or directory
root@JHPC:~/projects/evcc# cp /lib/systemd/system/evcc.service /etc/systemd/system/evcc.service
root@JHPC:~/projects/evcc# dpkg -i release/evcc_0.89.0_amd64.deb
(Reading database ... 41569 files and directories currently installed.)
Preparing to unpack release/evcc_0.89.0_amd64.deb ...
Unpacking evcc (0.89.0) over (0.89.0) ...
Setting up evcc (0.89.0) ...
An alternate service file was detected under '/etc/systemd/system/evcc.service'.
This is probably due to a previous manual installation.
You probably want to delete this file now. Your evcc configuration stays untouched!
Shall '/etc/systemd/system/evcc.service' be deleted? [Y/n]:
n
Ok. We will keep that file. Keep in mind that you may need to alter it if any changes are done upstream. Your answer is saved for the future.
root@JHPC:~/projects/evcc# ls /etc/systemd/system/evcc.service
-rw-r--r-- 1 root root 304 Apr  3 19:32 /etc/systemd/system/evcc.service
root@JHPC:~/projects/evcc# dpkg -i release/evcc_0.89.0_amd64.deb
(Reading database ... 41569 files and directories currently installed.)
Preparing to unpack release/evcc_0.89.0_amd64.deb ...
Unpacking evcc (0.89.0) over (0.89.0) ...
Setting up evcc (0.89.0) ...
root@JHPC:~/projects/evcc#```

@Pitillo Pitillo marked this pull request as ready for review April 3, 2022 17:34
@andig
Copy link
Member

andig commented Apr 4, 2022

Klasse- also rein damit?

@Pitillo
Copy link
Contributor Author

Pitillo commented Apr 4, 2022

Aus meiner Sicht schon, also habe es halt wie im Log zu sehen rudimentär mit 3 mal installieren ausprobiert und es scheint genau so zu funktionieren, wie ich es mir vorstellen würde :D

@andig andig merged commit 11d7852 into evcc-io:master Apr 4, 2022
@andig
Copy link
Member

andig commented Apr 4, 2022

Top, vielen Dank!

@Pitillo Pitillo deleted the manual-service-file-delete branch April 16, 2022 20:04
dontbyte pushed a commit to dontbyte/evcc that referenced this pull request Aug 2, 2022
Co-authored-by: Jahn-Hendrik Krämer <admin@herrpitillo.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants