openSUSE / docserv

A server for building and publishing documentation with DAPS
https://opensuse.github.io/docserv/
GNU General Public License v3.0
4 stars 3 forks source link

user issues when uninstalling then reinstalling #89

Open ghost opened 5 years ago

ghost commented 5 years ago

i zypper rm'd the ~0.9.20 package, then zypper in'd the 0.9.21 package and suddenly the docserv user did not exist anymore. hence the service failed with:

docserv:/etc/docserv # systemctl status docserv@docserv
● docserv@docserv.service - Docserv2 with docserv.ini
   Loaded: loaded (/usr/lib/systemd/system/docserv@.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Fri 2019-01-04 18:44:59 UTC; 9min ago
  Process: 3432 ExecStart=/usr/bin/docserv docserv (code=exited, status=217/USER)
 Main PID: 3432 (code=exited, status=217/USER)

Jan 04 18:44:59 docserv systemd[1]: Started Docserv2 with docserv.ini.
Jan 04 18:44:59 docserv systemd[3432]: docserv@docserv.service: Failed to determine user credentials: No such process
Jan 04 18:44:59 docserv systemd[1]: docserv@docserv.service: Main process exited, code=exited, status=217/USER
Jan 04 18:44:59 docserv systemd[1]: docserv@docserv.service: Unit entered failed state.
Jan 04 18:44:59 docserv systemd[1]: docserv@docserv.service: Failed with result 'exit-code'.

questions:

svenseeberg commented 5 years ago

Also note that deleting and readding the user leads to problems itself: if the user id changes, the ownership of all directories (/etc/docserv, /var/cache/docserv/) is wrong and the files are not writable for the daemon without running a chown first.

tomschr commented 5 years ago

I've asked Reinhard and he said:

You shouldn't remove any users in the %postun section. Any created user in the system should be kept due to security reasons.

This exact reason was already written by Sven above. To answer Stefan's questions:

why was the docserv user not reinstated when installing?

The user and group should never be deleted. If you keep them, the above problems disappear.

should we delete the docserv user during uninstallation?

No. :-)


For the reasons stated above, we should close that "bug" as invalid.

ghost commented 5 years ago

updated the spec file to no longer delete the docserv user or group. not yet closing this issue, as this still essentially untested and i am not sure the issue is fixed completely yet.