tor, torproxy: Fix daemon services are running after reboot when app is disabled
Mask disabled Tor systemd services to prevent services starting by the Tor master service after system reboot.
Also:
- Fix torproxy app always enabled after setup.
- Minor privileged code cleanup - removed unused functions.
Tests performed on Debian stable and testing:
- Installed and disabled the apps, rebooted the system, then applied the patch. Ensured that apps are upgraded successfully and apps are disabled after upgrade. Ensured that tor@default, tor@plinth and tor@fbxlocal services are masked and not running.
- After 1)enabling and 2)disabling both apps and 3)rebooting the system:
- Ensured that the tor@default service is not running and is masked.
- Ensured that tor@plinth or tor@fbxproxy service states match the states of the app.
- Uninstalled the apps, ensured that only the tor@default service masked state remains in the systemd.
- All the tor and torproxy tests pass.
Closes #2369 (closed), #2454 (closed).
Signed-off-by: Veiko Aasa veiko17@disroot.org